开发者

I have to keep changing IIS every time I do a build

开发者 https://www.devze.com 2023-02-19 23:51 出处:网络
I am learning TFS 2010 from scratch and no doubt making every mistake in the book. So hopefully this is a 开发者_StackOverflowsimple question to answer.

I am learning TFS 2010 from scratch and no doubt making every mistake in the book. So hopefully this is a 开发者_StackOverflowsimple question to answer. When I do a build a new directory is created on the build machine. That means I have to go to IIS and change the physical path for the website. I don't want to have to do that, so what should I be doing to stop this?


Deploy new builds to a fixed directory on the machine.


If you go in to the the source control explorer for the build you have created and located the TFSBuild.proj, check it out and edit it. Then add at the bottom

You have to replace the areas in CAPS below, this is for the debug build, so for Release change the area in the create item from Debug to Release. I used this method that I created at work for our dev and test build servers and it works like a charm.

  <Target Name="AfterDropBuild">

    <ItemGroup>
      <FilesToDelete Include="\\NETWORK LOCATION TO WEB DIRECTORY USED BY IIS\**\*" />
    </ItemGroup>

    <Delete Files="@(FilesToDelete)" ContinueOnError="true" />

    <Message Text="My target for deployment"/>
    <CreateItem Include="$(DropLocation)\$(BuildNumber)\Debug\_PublishedWebsites\WEB APPLICATION NAME\**\*.*" >
      <Output ItemName="FilesToCopy" TaskParameter="Include" />
    </CreateItem>

    <Copy
    SourceFiles="@(FilesToCopy)"
    DestinationFolder="\\NETWORK LOCATION TO WEB DIRECTORY USED BY IIS\%(RecursiveDir)"
    SkipUnchangedFiles="false"
    ContinueOnError="true"
    OverwriteReadOnlyFiles="true"/>

  </Target>
0

精彩评论

暂无评论...
验证码 换一张
取 消