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

自闭症网瘾萝莉.ら 提交于 2019-12-11 01:24:13

问题


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.


回答1:


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




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/3500035/how-to-publish-a-full-website-without-compiling-and-without-copying-svn-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!