views:

69

answers:

3

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  A: 

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

tzaman
That's a good simple command to remember, thanks.
Abel
+1  A: 

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

abatishchev
Great! Now I feel silly. In retrospect, I think I was aware of this option, but totally forgot about it. Exactly what I need.
Abel
@Abel: Glad it helped! :)
abatishchev
+1  A: 

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"&gt;

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

Sayed Ibrahim Hashimi
+1 Looks simple enough, thanks!
Abel