Why does the deployment package from my buildserver have additional assemblies?

.NetVisual Studio-2010Teamcity

.Net Problem Overview


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.

.Net Solutions


Solution 1 - .Net

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.

Solution 2 - .Net

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"

Solution 3 - .Net

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

Solution 4 - .Net

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionilivewithianView Question on Stackoverflow
Solution 1 - .NetilivewithianView Answer on Stackoverflow
Solution 2 - .NetEdward WildeView Answer on Stackoverflow
Solution 3 - .Netmatt-dot-netView Answer on Stackoverflow
Solution 4 - .NetCodeFoxView Answer on Stackoverflow