Question: On my local machine I have checked out a web application and then compiled it with MSBuild, and then pre-compiled and deployed it with the aspnet\_compiler. The command line looks like:

```
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>aspnet_compiler.exe -v / -p C:\<Some Dir> -u C:\<Some Target Dir> -f

```

This works fine locally in testing, meaning the pre-compiled website gets copied to the target directory without copying any .svn directories to it. However, on a remote machine where I have scripted the build for CC.Net, the .svn directories do get copied over. Running the command line manually for the aspnet\_compiler gives the same results (copies over the .svn folders):

```
D:\Program Files\Microsoft Visual Studio 10.0\VC>aspnet_compiler.exe -v / -p D:\<Some Dir> -u D:\<Some Target Dir> -f 

```

In both instances I am running from the x86 VS tools prompt. Any idea why there is different behavior?

Answer: 
Thanks for the responses. It turns out that I was able to just nuke the svn repository itself and re-check it out and run the aspnet\_compiler which solved the problem.
you can publish the code like this which will remove all svn files

```
<Project
        xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"
        name = "AspNetPreCompile"
        DefaultTargets = "PrecompileWeb">
        <Target Name = "PrecompileWeb">
                <AspNetCompiler
                        VirtualPath = "DeployTemp" 
                        PhysicalPath = "Physical source path"
                        TargetPath = "Physical target path"
                        Force = "true"
                        Debug = "false"
                        Updateable = "true"/>
        </Target>
</Project>

```

or you can use like this which remove all svn files recursively

```
<Project
        xmlns = "http://schemas.microsoft.com/developer/msbuild/2003"
        name = "AspNetPreCompile"
        DefaultTargets = "build">

    <ItemGroup>
        <FilesToCopy Include="C:\ProjectWorkingDirectories\YourWebsite\Source\**\*.*" Exclude="C:\ProjectWorkingDirectories\YourWebsite\Source\**\.svn\**"/>
    </ItemGroup>

    <Target Name = "build">
        <CallTarget Targets="PrecompileWeb"/>       
        <CallTarget Targets="CopyFiles"/>       
    </Target>

    <Target Name = "PrecompileWeb">
                <AspNetCompiler
                        VirtualPath = "/Source" 
                        PhysicalPath ="C:\ProjectWorkingDirectories\YourWebsite\Source"/>                     
        </Target>

    <Target Name = "CopyFiles">                
        <Copy SourceFiles="@(FilesToCopy)" DestinationFiles="@(FilesToCopy->'C:\TempProjectPublish\YourWebsite\YourWebsite\%(RecursiveDir)\%(Filename)%(Extension)')" ContinueOnError="true"/>
        </Target>

</Project>

```