开发者

How to publish a full website without compiling and without copying SVN files

开发者 https://www.devze.com 2023-01-11 17:02 出处:网络
Apparently, DNN installations do not like to be precompiled (they won\'t be able to find any localized strings then). Our installation is safely put in SVN, which means I cannot just copy the开发者_如

Apparently, DNN installations do not like to be precompiled (they won't be able to find any localized strings then). Our installation is safely put in SVN, which means I cannot just copy the开发者_如何学运维 whole directory. To publish everything, I need to copy the whole website directory without the SVN files and directories. So far, I've been messing with good old DOS commands, which is time consuming and error prone.

Can someone help me to an MS-Built script or step to do just this? Or can I do this using default Visual Studio 2010 commands?

Note: this is a website, not a web application.


Just svn export the directory from source control, which will give you a clean copy without the .svn stuff in it.


Visual Studio -> Solution Explorer -> <web site> -> <right click> -> Publish Web Site or Copy Web Site


If you are ever interested in automating this with MSBuild then you can do that with something like the following.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <ItemGroup>
    <FilesToCopy Include="**\*"
                 Exclude="**\.svn\**"/>
  </ItemGroup>

  <PropertyGroup>
    <Dest>C:\temp\dest\</Dest>
  </PropertyGroup>

  <Target Name="CopyFiles">
    <Message Text="FilesToCopy: @(FilesToCopy)"/>
    <MakeDir Directories="$(Dest)"/>
    <Copy SourceFiles="@(FilesToCopy)"
          DestinationFiles="@(FilesToCopy->'$(Dest)%(RecursiveDir)%(Filename)%(Extension)')"/>
  </Target>

</Project>

So when I create the FilesToCopy item I exclude all the files under any .svn folder. Then I just perform the copy inside the CopyFiles target.

0

精彩评论

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

关注公众号