如何在不编译、不复制SVN文件的情况下发布完整的网站

发布于 2024-09-15 00:11:16 字数 275 浏览 9 评论 0原文

显然,DNN 安装不喜欢预编译(那样它们将无法找到任何本地化字符串)。我们的安装被安全地放入 SVN 中,这意味着我不能只复制整个目录。要发布所有内容,我需要复制整个网站目录,不包含 SVN 文件和目录。到目前为止,我一直在搞乱旧的 DOS 命令,这既耗时又容易出错。

有人可以帮助我使用 MS 构建的脚本或步骤来执行此操作吗?或者我可以使用默认的 Visual Studio 2010 命令来执行此操作吗?

注意:这是一个网站,而不是网络应用程序

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

待"谢繁草 2024-09-22 00:11:16

只需从源代码管理中 svn export 目录,这将为您提供一个干净的副本,其中不含 .svn 内容。

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

冷︶言冷语的世界 2024-09-22 00:11:16

Visual Studio -> 解决方案资源管理器 -> <网站> -> <右键单击> -> 发布网站复制网站

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

枯寂 2024-09-22 00:11:16

如果您有兴趣使用 MSBuild 自动化此操作,那么您可以使用如下所示的方法来实现。

<?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>

因此,当我创建 FilesToCopy 项时,我会排除任何 .svn 文件夹下的所有文件。然后我只需在 CopyFiles 目标内执行复制。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文