views:

849

answers:

3

I am working on an ASP.NET MVC web application, and am working on the Web Setup portion. We are using SVN for version control. One of the issues is that the we are currently having is that the web designers modify and add a lot of html, css and js files that end up in the Content folders, but they don't add them to the VS project, so the new files don't get included in the installer.

One option is that we have to try to teach them to always go into VS and manually add the files, but we're on a large project and it's getting down to crunch time, so trying to get people to learn something new in a technology that they don't know will result in too many mistakes, so I'd like to work around that if possible.

Is there some way to get the setup project just to include files from a folder on the file system, instead of a project's designated content files?

Thanks!

A: 

Unfortunately I don't think there is an out of the box way to do this, as projects maintains references to the files individually.

You could achieve what you need via a custom macro, or asking your other team to edit the .csproj XML file (perhaps simpler or riskier, depending on their background).

MattH
+1  A: 

Right click on the folder in the File System view of the Web Setup project, and select Add, File...

It doesn't look like you can add an entire folder this way though, so you would have to add every file individually to the Setup program.

EDIT:

Aren't all files from your project folder included in a WebSite project in Visual Studio? Then it's just a case of having your WebSite project and Web Setup project in the same solution, then right-click on the Web Application Folder in the Web Setup project, select Add, Project Output... and then select the WebSite Project in the drop down and Content Files from the list box and click OK.

Patrick McDonald
+3  A: 

I think I've figured it out:

Make sure that the installer project includes the Content Files for the web app. Then go into the web app's csproj file with a text editor and find the ItemGroup where the static Content files are listed. Then add an entry with a wildcard in it and the installer will package them in.

<ItemGroup>
    <Content Include="Content\test.html" />
    <Content Include="Content\*.html" />
        <Content Include="Content\*.gif" />
       <Content Include="Content\*.css" />
       <Content Include="Content\*.jpg" />
       <Content Include="Content\*\*.js" />
marcel_g