Alex Rivera | Logout

Visual Studio: cannot access resources from code

Asked 2012-04-28T22:16:04.380
8

I added several files (HTML, CSS, etc.) as resources to my Visual Studio project. According to MSDN, I should be able to access these resources via

MyProjectName.Properties.Resources.Filename

Unfortunately, IntelliSense doesn't even know the Properties property behind MyProjectName. If I type "MyProjectName.", IntelliSense offers me several things but no properties. I already built the project, but nothing changed.

If this is important: that project is not the main/startup project of my Visual Studio solution.

Edit
Report

1 Answer

12

You need to add them here:

  1. Project menu
  2. MyProjectName Properties
  3. Resources tab
  4. "Click here to create resources" (if necessary)
  5. Select Files menu
  6. Add Resource

Now you can access them using MyProjectName.Properties.Resources.Filename

answered 2012-04-28T22:22:25.817

Your Answer