tags:

views:

988

answers:

2

We use MSBuild to build our solutions through CruiseControl. We have several assemblies and a website as part of the solution. Building through VS2008 the build is successful. However on the build box we get the following error.

ASPNETCOMPILER (,):

  errorASPCONFIG: The CodeDom provider type "Microsoft.VJSharp.VJSharpCodeProvider, VJSharpCodeProvider, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" could not be located.

The reason for this is that in the scripts folder of the website we have a couple files with the .java extension. We don't want these files built. And really we don't need anything in the scripts folder built.

Is there a way to exclude a folder or an extension from being built within a website project? Or tell MSBuild to follow the same rules VS2008 is using to decide what to compile?

Thanks

A: 

Inside the build file will be an item group with the item/s concerned. Just edit the file to exclude that item.

For example:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    <ItemGroup>
        <Res Include = "Strings.fr.resources" >
            <Culture>fr</Culture>
        </Res>
        <Res Include = "Dialogs.fr.resources" >
            <Culture>fr</Culture>
        </Res>

        <CodeFiles Include="**\*.cs" Exclude="**\generated\*.cs" />
        <CodeFiles Include="..\..\Resources\Constants.cs" />
    </ItemGroup>
...
</Project>

Edit: Correction to answer comment.

If you have only a sln file, could you create meta msbuild script that moves the files out of the way, calls the task to build your solution, and then put them back?

Preet Sangha
I don't think this works for WebSite projects since there is no project file. I looked through the sln file for ways to do this with no luck.
Mike Schall
It's for this reason I don't like web site projects and prefer web applications. You could create an msbuild file just for your CI build though?
KeeperOfTheSoul
A: 

You can use Web Deployment Projects for this. In the WDP you can use the ExcludeFromBuild item to exclude those files. For more info see http://msdn.microsoft.com/en-us/library/aa479568.aspx.

Sayed Ibrahim Hashimi