Search code examples
c#visual-studiovisual-studio-2010embedded-resource

Project Resources variable does not change value


I have an xslt file which I initially added to the "Resources" section of my project through the project properties. Inside of my program I call Resources.MyXsltFile to grab the string and I load it using XslCompiledTransform.Load. My program ran fine initially but after I updated the xslt file I noticed that my Resources.MyXsltFile was still using the original xslt contents and not my updated version. What's the deal?


Solution

  • It turns out that the compiled "Resources.Designer.cs" file that goes along with the 'Resources.resx' for the project does NOT get regenerated when you update one of the resource files. Therefore you have to regenerate the "Resources.Designer.cs" file manually. Here is an article from Marek Grzenkowicz which shows how to regenerate the file by right-clicking on "Resources.resx" and clicking on "Run custom tool". After that I ran my program and it finally used the updated version of my resource file.