tags:

views:

344

answers:

4

Well as the title says i have 2 web projects that have the same css files, master page and some resource files, how could i share those? atm i have 2 copies of them...

+2  A: 

Solution 1: bind them into separate assemblies in share it across your projects.

Reference:

Koistya Navin
sounds easy but how do you bind a css file in a seperate assembly? i got my resource file now in a seperate assembly and im using "PublicResXFileCodeGenerator" as build tool..
Petoj
You could have a seporate library project which will be shared in all your website projects. Which will contain CSS files as resources.
Koistya Navin
+1  A: 

In the second project choose "Add existing file", select the file, click on the arrow on the add button and select "add as link".

chris
Probably won't work for debugging, you'll need to publish to link the files in.
meandmycode
ok this does not seem to work at all the files are not added to the build output..
Petoj
It does work; check the properties for the file. Make sure its set to copy always to the output.
Will
didnt help it was still not there...
Petoj
Copy to output will put the static files in subfolders of the /bin (i.e. the project build output) directory - not what you'd want.
Zhaph - Ben Duguid
+1  A: 

Here is an article that describes how to share pages and user controls between applications : HOW TO: Share ASP.NET Pages and User Controls Between Applications by Using Visual Basic .NET. It's solution depends on separate virtual directory that holds the shared files.

And in this article Scott Guthrie describes how to build reusable web assemblies. It's solution depends on making separate assembly by shared files.

Canavar
A: 

Since I cannot vote or comment, I would like to know what the final answer is.

Navin's link http://support.microsoft.com/kb/910445 appears to be a answer but that seems like way more work than what should be required for referencing some files in different projects within the same solution. I tried "In the second project choose "Add existing file", select the file, click on the arrow on the add button and select "add as link"." but I couldn't get that to work either. I tried copy always to the output.

So does anyone know an easy answer to this problem for sharing images, css, and js files across some projects within same solution or not in the same solution without doing the assembly method.

Breadtruck