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.
Open Solution Explorer add files you want to embed. Right click on the files then click on Properties . In Properties window and change Build Action to Embedded Resource . After that you should write the embedded resources to file in order to be able to run it.
If you cannot open your RESOURCE file correctly, try to right-click or long-press the file. Then click "Open with" and choose an application. You can also display a RESOURCE file directly in the browser: Just drag the file onto this browser window and drop it.
At the top right corner you have a searchbox, try typing it there and see if it finds anything. It should now open the new file with the resources designer. Now open the properties pane for that file (right click it in the solution explorer) and make sure it has the following set: Build Action: Embedded resource.
You need to add them here:
Now you can access them using MyProjectName.Properties.Resources.Filename
Make the file as a resource from its properties as:
BuildAction=Compile
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