views:

343

answers:

2

Hi Guys,

I use the Publish command in Visual Studio to deploy a web application to my IIS server. It is very convenient but I have several issues with it, such as:

  • It does not deploy the Crystal Report files (*.rpt) files
  • It deploys the web.config file and overwrites the server specific settings

Is there any way that I can customize what the Publish command does?

Thanks

+2  A: 

When publishing your Web Application, Visual Studio will respect the "build action" set for each file in your project. Make sure you pick the right actions for the files. Here are your options:

None - The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file.

Compile - The file is compiled into the build output. This setting is used for code files.

Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind of Web file.

Embedded Resource - This file is embedded in the main project build output as a DLL or executable. It is typically used for resource files.

In this particular case, the .rpt files should probably be set to Content and the web.config should be set to None. The build action for a file can be changed in the property window when the file is selected in the solution explorer.

Jørn Schou-Rode
Thanks - great solution!
Xavier Poinas