locked
Excluding WDP from building RRS feed

  • Question

  • User606700639 posted

    Hi

    We want to exclude the web deployment project from building when we build our solution inside VS2005.  We have a web deployment project added to our solution and it is under VSS source control.  We have a bat file that runs on the development test server every night to give us a nightly build of our application.  I've been told we need to build this with MSBuild and set the configuration (with the /p switch) to be Debug so that we get full trace output when an exception occurs.  The bat file gets the latest version of the source code from source safe onto the machine, then runs MSBuild to build the solution file.

    This is fine and works, except our solution has to be setup such that the configuration of Debug should NOT exclude the WDP from building.  Normally we would go to the configuration for the solution and uncheck the WDP project in Debug mode so normal debug building by developers would NOT build the WDP.  However, if we do this and check in the SLN file, the server will run the BAT file that night, download the latest SLN file and build it, but the WDP project will be excluded and then we won't get the desired output on the server.

    Is there another way to control whether or not the WDP gets built so that we can build it in Debug configuration mode on the server during the nightly build, but NOt have it built when the solution is built (even though set to Debug configuration) locally on developer machines inside VS 2005?

    Thanks for any help!!

     

    Monday, May 14, 2007 9:27 AM

All replies

  • User1618900539 posted

    Hi!

    If I understood your scenario right, you could use conditional building conditions in the .wdproj file, like:

    <ItemGroup Condition="'$(Configuration)|$(Platform)' == "YourBuildConfig">
        <ExcludeFromBuild Include="$(SourceWebPhysicalPath)\YourWDPFIleName" />
    </
    ItemGroup>

     

    Hope this helps,

    Juan

    Tuesday, May 15, 2007 9:01 PM
  • User606700639 posted

    So, you're saying that we could tell the WDProj file noto to build itself when a certain configuration is set?  Also, I guess you're saying we would create a new configuration instead of just using the default Debut and Release configurations?

    What you have suggested is close if it works.  We would actually change the condition in your example to Debug so that when in the Debug configuration mode (developers will have this set in VS 2005 during development) and the solution is built, the WDProj file would not build, but we could have a configuration called RemoteDeployment that would get set on the msbuild command line with the /p switch to set the configuration to RemoteDeployment.  this configuration could be setup so that it outputs debug symbols etc.

    Question:  When you add a new configuration in VS, is that configuration known on the server when the build is happening there?  I guess the solution file would have the build of the wdproj file turned off (so we could actually handle this in the SLN setting not in the wdproj file as you have above) when configuration is set to Debug, but build the wdproj when set to RemoteDeployment.

    Sorry, I just went through a couple of thoughts "out loud" above.  I hope it makes sense and I would appreciate hearing feedback as to whether this should work or not.   thanks!

    Wednesday, May 16, 2007 6:44 AM
  • User1618900539 posted

    Basically what you could do is to exclude the .wdproj file to be deployed itself with the project, so you get a compiled project without that file (or any other files you want). And yes, you can have as many configurations as you wish, apart from the default "Debug" and "Release".

     About your question, I'm not sure I understand well, so I don't like to answer non-sense here, maybe you want to have a look at the following link.

     http://msdn.microsoft.com/en-us/library/aa479568.aspx

     At the end of the article you'll find an explanation about multiple configurations, exclude files and so on.

    Also, don't forget that you could use #IF "ConfingName" statements to execute code conditionally based on your deployment configuration, like:

    #If DEBUG Then

    'Do something

    Else

    'Do something

    #End If

     

     

     

     

    Friday, May 25, 2007 9:35 PM
  • User-1625098594 posted

     Hi,

     

    Can you please give me steps to build wdproj project from makefile.

    I tried the below commnad in makefile :

    @devenv /nologo /safemode /out $(OUTFILE) $(BFLAGS) $(TARGET) .\project.sln

    and getting below error even though i have installed web deployment project on my machine .

    "\project.wdproj' is not installed.Make sure the application for the project type (.wdproj) is installed. "

     Thanks in advance,

    Tuesday, October 14, 2008 2:03 PM