4

How to create an embedded resource in a Web Site project?

In a web application project I can change the 'build action' through the properties window of a file. In an Web Site project there is no properties window. I noticed, in a web application project, the .csproj file is changed when you change the build action of a file. In a Web site project there is no .csproj file of course.

Is it possible to create an embedded resource in an Web Site project?

In mainwhile, we changed the project to a web application project. But I'm still curious..

2 Answers 2

3

You can't add an embedded resource, because web site projects are not pre-compiled. There is no generated dll to embed the resource in.

Sign up to request clarification or add additional context in comments.

Comments

0

You can still get a properties window on a Web Site project - do you mean that you want to mark an item in your website project to be included for deployment? If so that would be done by setting the Build Action property for the selected file in your solution to Content.

Embedded Resource is an option but is aimed at items you wish to embed within the compiled DLL corresponding to your App_Code. You would then need to load the resource from your assembly.

2 Comments

Yes, you can get a properties window on a Web Site project. But not on a file inside a Web Site project. Or I can't find that window... I want that file embedded in the compiled DLL of the Web Site project.
Add your website to a new Solution, that way visual studio can start to manage the files in the solution (of which your website is one project) and you can set properties etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.