Click here to Skip to main content
15,884,676 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a login page where user logs in and when he enters wrong password i display a message.
This message in stored in a variable public const string err in Public sealed class Constants.

I want to change this string message but when i do the changes i and rebuild my code in VS 2019 then these changes are not reflected on UI.

Steps i tried:

Changed the value of const variable
Rebuilt the code
Cleared all the cache of browser
Tried ctrl+F5
Reset IIS
Restarted IIS
Deleted site from IIS and added back again

But still nothing helped me.

Kindly me asap......i have been given a deadline to do this.


What I have tried:

Changed the value of const variable
Rebuilt the code
Cleared all the cache of browser
Tried ctrl+F5
Reset IIS
Restarted IIS
Deleted site from IIS and added back again
Posted
Updated 21-Feb-21 9:39am
Comments
Jo_vb.net 20-Feb-21 12:40pm    
My VS is in german, so I'm not sure if "Erstellen" really means "Create" or "Build":

Check in VS Menu "Create" (or "Build") > "Configuration Manager" if "Create" (or "Build") is checked.
Vibhudwivedi 21-Feb-21 0:35am    
Yes all the "Build" checkboxes are checked.
Richard MacCutchan 21-Feb-21 4:48am    
You should be able to see from the build messages that the source file you have changed is recompiled. You should also be able to see where the final linked code is saved (the web site files). So check that you are actually re-installing the correct code after the build completes.

1 solution

"Constants" in a separate dll are "baked into" the code that references them; that's why the "using" code is not recompiled.

Use a readonly field / property instead if your "constant" "changes".
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900