locked
building Debug and Release web sites using same solution RRS feed

  • Question

  • User1994947427 posted

    hello,

    i am currently buildinng a Release web site from one VS2013 solution and using Publish Web to load it to a production hosted server.  i would also like to use this same solution to deploy to a Debug site on a prodution server.  however, there are many web pages that i need to include/exclude before i deploy to the Debug site.  i then need to re-include/exclude those same files to use again on the Release site.

    is there a better way to include/exclude various solution files during each build process?

    thanks!

    Wednesday, March 19, 2014 1:52 AM

Answers

  • User-166373564 posted

    Hi philos

    Appreciate your feedback.

    If you just want to excluding files and folders via the Web Application’s project file, here are the steps to follow in order to exclude specific file(s) and/or folder(s) from packaging and/or publishing:

    Excluding Specific Files / Folders

    1. Open the web application project file (.csproj or .vbproj) in an editor or from within Visual Studio itself.
    2. Add an <ExcludeFilesFromDeployment> and/or <ExcludeFoldersFromDeployment> element in the desired <PropertyGroup> element.
    3. Save the project file
    4. Reload the project
    5. Build your Deployment Package or Publish Web …

    If you have any concern, please let me know.

    Best regards

    Angie Xu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 23, 2014 10:38 PM

All replies

  • User-166373564 posted

    Hi philos

    is there a better way to include/exclude various solution files during each build process?

    Thanks for your feedback.

    For this issue, right click on the file you want to exclude, choose Property.

    Build Action -> 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.

    Copy to output Directory - > Do not copy

    If you have any concern, please let me know.

    Best regards

    Angie Xu

    Thursday, March 20, 2014 11:33 PM
  • User1994947427 posted

    thank you, but i am not sure how the suggestion will work for me, i may be missing something about the build process.

    an example of my problem...suppose i have a file ProductPageForTesting.aspx in my solution.  sometimes i want this file in the build using Publish Web, and sometimes i do not.  but in my case, i have 25 or so of these files.  having to include/exclude all these files everytime i switch between Debug and Release builds is very time consuming. 

    is there a build file i can edit for each case, Debug and Release.  (i am looking for something similar to the xdt transformation method used with web.config files.)

    Friday, March 21, 2014 3:00 AM
  • User-166373564 posted

    Hi philos

    Appreciate your feedback.

    If you just want to excluding files and folders via the Web Application’s project file, here are the steps to follow in order to exclude specific file(s) and/or folder(s) from packaging and/or publishing:

    Excluding Specific Files / Folders

    1. Open the web application project file (.csproj or .vbproj) in an editor or from within Visual Studio itself.
    2. Add an <ExcludeFilesFromDeployment> and/or <ExcludeFoldersFromDeployment> element in the desired <PropertyGroup> element.
    3. Save the project file
    4. Reload the project
    5. Build your Deployment Package or Publish Web …

    If you have any concern, please let me know.

    Best regards

    Angie Xu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 23, 2014 10:38 PM
  • User1994947427 posted

    that was exactly what i was looking for, thanks very much!  i searched all over but never found this topic in msdn.

    is there a library or reference list with descriptions and examples of all the options that can be used in the .vbproj file? 

    Wednesday, March 26, 2014 3:13 AM
  • User-166373564 posted

    Hi philos

    that was exactly what i was looking for, thanks very much!  i searched all over but never found this topic in msdn.

    Glad that it helps you.

    is there a library or reference list with descriptions and examples of all the options that can be used in the .vbproj file? 

    For this issue, I don't think I can give precise answer for it, it depends on your VB.net project type in Visual Studio, you can check your library or reference list in your VS.

    Best regards

    Angie

    Wednesday, March 26, 2014 10:08 PM
  • User1994947427 posted

    thank you.

    Thursday, March 27, 2014 12:02 AM