I've just upgrade my web application from vs2008 to vs2010, I create a new web app from vs2010, then copy across all the existing files from vs2008, then I add a new class file to App_Code folder, the intellisense is not showing up for everything and class etc is also not color in the right color. However, when I open the existing class I created earlier from vs2008, intellisense just working fine and all classes are in different color as well, if I make a copy of existing class, the copied class does not support the intellisense as well. However, if I shut my VS, and reopen it, they all appear to be support with intellisense for existing class, but once I created a new class, intellisense is not support.
Can you tell me what's wrong here? Thanks
Check if your classes build action is set to Compile (right click on your class in solution explorer and click properties).
Apparently when you add classes to the App_code folder it sets the build action by default to Content.
From a post by Microsoft on 8/19/2008 in connect.microsoft.com in regards to a bug report on this issue
Thanks for the feedback. This is actually by design in Visual Studio. App_Code is not supported in Web Application Projects--only in Web Sites (due to architectural reasons). When you add a class file to the App_Code folder, the file is added as "Content" as opposed to "Compile" and you should not get intellisense on it. So when you move it out of your App_Code folder, it will remain as "Content" type and not get compiled, and thus continued no intellisense. To fix this, move the file outside of App_Code, select the file, and change the build action to "Compile" in the property grid.
Thanks, - The Visual Web Developer Team
Note that although in the post it says to move the file out and change the build action, you don't have to actually move the file, you just need to change the build action.
Follow this Process :-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With