62

I've got an asp.net mvc deployment package that I'm trying to build with team city. The package builds without any problems, but the bin folder contains file that are not needed (and cause the site to fail when present).

If I build the same package from visual studio the additional files are not present.

The additional files are:

Microsoft.VisualBasic.Activities.Compiler.dll
mscorlib.dll
normidna.nlp
normnfc.nlp
normnfd.nlp
normnfkc.nlp
normnfkd.nlp
System.Data.dll
System.Data.OracleClient.dll
System.EnterpriseServices.dll
System.EnterpriseServices.Wrapper.dll
System.Transactions.dll

What can I do to prevent these additional assemblies and .nlp files from being included in the package?

UPDATE

After a bit more digging through log files I've found that the _CopyFilesMarkedCopyLocal build task is copying the files into the bin directory. The odd thing is that the assemblies are not marked as copy local.

ilivewithian
  • 19,476
  • 19
  • 103
  • 165

4 Answers4

62

After a bunch more digging around I noticed that the build server had the .Net framework on, but not the framework SDK. After installing the SDK on the build server the additional assemblies were no longer added.

ilivewithian
  • 19,476
  • 19
  • 103
  • 165
  • What did you have to install? I don't want to install VisualStudio on the build server to get that SDK - is there another you have installed? – stack72 Jun 08 '11 at 17:22
  • 1
    My build server is running Windows 7 so I installed this: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b&displaylang=en – ilivewithian Jun 09 '11 at 09:23
  • 1
    Specifically, I found it was required to install the "Intellisense and Reference Assemblies" feature from the Web Installer. – Tim Iles Oct 20 '11 at 11:15
  • 7
    Wanted to note that this is also the case with .NET 4.5. I had to install the ".NET Framework 4.5 Software Development Kit" option of the "Windows SDK for Windows 8" in order to get these files cleaned out of the build directories on our build server. – brock.holum Sep 12 '12 at 23:11
  • 8
    I had similar issue even after installing the sdk_tools4.msi on the build server. I noticed .net 4.5 reference assemblies were missing in build server. So I copied C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\* to build server on same path. That fixed this issue. – Sathish Naga Jun 13 '13 at 17:36
28

I experienced the same issue on a build server that only had 4.5.1 sdk installed.

Fix

Add the p:FrameworkPathOverride parameter to msbuild. For example:

msbuild /p:FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1"
Edward Wilde
  • 25,967
  • 8
  • 55
  • 64
  • 3
    If I could upvote this 100 times I would. I had an issue were the manifest files included dependencies I did not require nor were specified as part of the clickonce package (breaking my clickonce app). I realised it was the .nlp that was the issue and needed a way to prevent them. This did the trick thanks!! – Cheri Jun 12 '14 at 05:40
  • Unfortunately this didn't unblock me. It keeps trying to use .net 5 when I'm setting the parameter to 4.6.1 – kayleeFrye_onDeck Nov 15 '22 at 19:24
2

Easiest solution was to copy my local C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework up to the build server

matt-dot-net
  • 4,204
  • 21
  • 24
2

On a build server running Windows Server 2012 R2 I experienced a similar problem - the following task was copying unwanted files to the output directory:

[06:47:07]_CopyFilesMarkedCopyLocal
[06:47:07]Copy
[...]
[06:47:07]Copying file from "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" to "bin\Release\mscorlib.dll".
[06:47:07]Copying file from "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normidna.nlp" to "bin\Release\normidna.nlp".
[06:47:07]Copying file from "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normnfc.nlp" to "bin\Release\normnfc.nlp".
[06:47:07]Copying file from "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normnfd.nlp" to "bin\Release\normnfd.nlp".
[06:47:07]Copying file from "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normnfkc.nlp" to "bin\Release\normnfkc.nlp".
[06:47:07]Copying file from "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normnfkd.nlp" to "bin\Release\normnfkd.nlp".

Similar to the answer of @ilivewithian a package was missing: Microsoft .NET Framework 4.5.2 Developer Pack for Windows Vista SP2, Windows 7 SP1, Windows 8, Windows 8.1, Windows Server 2008 SP2 Windows Server 2008 R2 SP1, Windows Server 2012 and Windows Server 2012 R2.

CodeFox
  • 3,321
  • 1
  • 29
  • 41
  • I forgot to mention, that the build that was copying unwanted files is targeting .NET Framework 4.5.2. @cacau, in your case it is probably a different version of the .NET Framework that is missing some Developer Pack or SDK. – CodeFox Aug 25 '15 at 04:50
  • Well - we're targeting 4.5 so the 4.5.2 SDK should be all right I reckon? – cacau Aug 25 '15 at 06:03
  • @cacau, according to the [Overview of .NET SDKs and Downloads](http://blogs.msdn.com/b/dotnet/p/dotnet_sdks.aspx), I guess for 4.5 you either need Visual Studio 2012+ or the [Windows Software Development Kit (SDK) for Windows 8](http://go.microsoft.com/fwlink/?LinkID=310216) installed on your build server. – CodeFox Aug 26 '15 at 08:36