Cannot resolve symbol ‘’ error in Visual Studio 2008

9. September 2009

Today I copied over another user control from another project into my current project and the code behind page was giving me an error on the label on the page. The error was :  “Cannot resolve symbol ‘ ’:

After a little investigation I found this is being thrown by my ReSharper Plug-in and the recommended solution was for me to disabled ReSharper and try the build again.

To disable ReSharper I did the following:

1)      Click “Tools”

2)      Select “Add-in Manger …”

            

3)      Then uncheck the ReSharper Plug in and select “OK”

 

 

I built the project and guess what? I got another error. This one read as follows:

The name ‘ ’ Does Not Exist in the Current Context

 

Doh! Okay so here is my real error after peeling back the onion layer of the ReSharper app. I needed to change the way the code behind was building for it to reload the memory. So here is what I believe is occurring.

 

My Visual Studio Website is setup to Use IIS Web Server (Project Properties à Web à Use IIS Web Server)

 

I believe that once the assembly (.dll) has been loaded into IIS memory it is then marked as “in use” and now only IIS can unload or load a fresh copy. When Visual Studio attempts to replace the assembly with a debug build it cannot do so.

 

To get around this problem I opened the properties (F4) of my code behind (.cs) page and changed the Build Action to be Embedded Resource

 

 

 

I compiled and it fixed my problems. Of course you could just try changing the Build Action and not disabled ReSharper, but I wanted to list every step I took to resolve my programming issues.

Below is a list of each Build Action description in case you were interested in the other types of builds such as I was.

·         None:

o   Umm should be obvious

·         Compile

o    Linker and Library compile solution

·         Content

o   Allows you to retrieve a file (in same dir as assembly) as a stream via Application.GetContentStream ( uri ).  For this to work, you need AssemblyAssociatedContentFile custom attribute which visual studio adds when you mark a file as “Custom”

·         Embedded Resource

o   Embeds the file in an exclusive assembly manifest resource

·         CodeAnalysisDictionary

o   This is used when you want to add a custom dictionary to your project. Create new xml file, select Build Action to be CodeAnalysisDictionary and you are now ready to start using your custom dictionary.

·         ApplicationDefinition:

o   Mark the XAML/Class file that defines your application. You specify the codebehind with the x:Class=”Namespace.ClassName” and set the startup form/page with StartupUri=”Window1.xaml”

·         Page:

o   Identifies a XAML markup file whose content is converted to a binary format and compiled into an assembly. Page items are typically implemented in conjunction with a code-behind class

·         Resource

o   Identifies a resource file that is compiled into an application assembly.

·         SplashScreen

o   Allows a developer to add a splash screen “bitmap” to WPF applications. This option is set to show the splash screen dynamically.

·         EntityDeploy

o   This is used by the EntityFramework, but not very useful in Silverlight.

When completed I re-enabled everything "ReSharper" and set my cs file back to "Compile" and everything is working perfectly.

ASP.NET

Add comment


(Will show your Gravatar icon)

biuquote
  • Comment
  • Preview
Loading