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

4

63

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.

Blemish answered 9/4, 2011 at 9:43 Comment(0)
B
63

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.

Blemish answered 10/4, 2011 at 16:28 Comment(5)
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?Kiushu
My build server is running Windows 7 so I installed this: microsoft.com/downloads/en/…Blemish
Specifically, I found it was required to install the "Intellisense and Reference Assemblies" feature from the Web Installer.Device
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.Delegacy
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.Wessling
J
30

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"
Joelie answered 14/5, 2014 at 12:47 Comment(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!!Invoke
Unfortunately this didn't unblock me. It keeps trying to use .net 5 when I'm setting the parameter to 4.6.1Laundes
My solution was a combination of this, and what "matt-dot-net" commented below about copying over my NETFramework folder over to the build server. My project both wasn't referencing the the right framwork, and the framework didn't exist on the serverMistrust
E
3

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

Erinn answered 2/8, 2015 at 20:59 Comment(0)
I
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.

Impenetrability answered 21/8, 2015 at 5:34 Comment(3)
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.Impenetrability
Well - we're targeting 4.5 so the 4.5.2 SDK should be all right I reckon?Circumference
@cacau, according to the Overview of .NET SDKs and Downloads, I guess for 4.5 you either need Visual Studio 2012+ or the Windows Software Development Kit (SDK) for Windows 8 installed on your build server.Impenetrability

© 2022 - 2024 — McMap. All rights reserved.