Reputation: 91
I'm developing an asp.net application atm and it will be used to insert some data in a database. Yesterday, I noticed that I've written the wrong table name in one of my insert statements. Ofc I changed it then, but..! After getting the same "Unknown Column" exception again and again, I opened the SQL Profiler today and looked at the statement. The statement still tries to insert into the wrong table, but not in the "new" right one, which I've actually written in the code.
Why is the application not noticing changes? I tried to load the website without cache by hitting STRG+F5 for like 125392 times. I also deleted the cache folder, also without success.
Thanks in advance!
Edit: U may want to know that this application is running on a server. Therefore I need to edit the .cs-Files with Notepad because there is no Visual Studio installed on this server.
Upvotes: 0
Views: 468
Reputation: 2281
Are you sure this is running as a website project and not a web application?
If it's running as a website project then editing the .cs files should be picked up. The quickest way to check this would be to introduce a deliberate syntax error to prevent a class from compiling.
Web application projects are compiled before deployment. If there's a .cs file in the web folder for that then it's been deployed by a quick copy-paste rather than a proper publish from Visual Studio and, while the site should work just fine, changes to the .cs files will be ignored. As that's a compiled project you'd need to make the changes somewhere that has access to a compiler (ideally VS on your usual dev machine but I think you could use the command line compiler), then deploy those changes - ideally via a publish to leave the project in a clearer state for the next maintainer :-) If you have to do it manually for whatever reason though, remember you need the .aspx/.ashx etc or .cshtml / .vhbtml files and the DLLs.
Upvotes: 1
Reputation: 7
.cs files need to be compiled for changes to be added to running library. It is not recommended to edit files directly on the server.
Upvotes: 0