Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Build error for Nuget tool package with dependesies
JohanSpannare
#1 Posted : Wednesday, October 5, 2016 9:16:26 AM(UTC)
Rank: Member

Groups: Registered
Joined: 1/7/2016(UTC)
Posts: 10
Location: Sweden

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi

I have and nuget "TOOL" (DatabaseDeployer) package installed into a simple test project. The nuget package has child dependencies in order to work.


SimeTestProject
-> packages
->DatabaseDeployer
->Tool
->DatabaseDeployer.dll + all dependecies

The first time (disable enable ncrunch) all files is copyied as expected. But when ncrunch is compiling for the first time i get an serializationexception:

Quote:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
packages\DatabaseDeployer.0.0.16279.01\build\DatabaseDeployer.targets (14, 5): The "BuildTask" task failed unexpectedly.
System.Runtime.Serialization.SerializationException: Type 'Microsoft.Practices.Unity.ResolutionFailedException' in Assembly 'Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f' is not marked as serializable.

Server stack trace:
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeMessageParts(ArrayList argsToSerialize)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage..ctor(IMethodReturnMessage mrm)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.SmuggleIfPossible(IMessage msg)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()


The project (SimpleTestProject) is building fine in VS2015 Update 3.

When i choose "Reload and rebuild selected component" the ncrunch cache is cleared and an seperat folder is created for the nuget package not containing all dependencies. This causes resolution exception

Quote:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
packages\DatabaseDeployer.0.0.16279.01\build\DatabaseDeployer.targets (14, 5): The "BuildTask" task could not be instantiated from "C:\Users\s68329\AppData\Local\NCrunch\33456\3\packages\DatabaseDeployer.0.0.16279.01\build\..\Tools\DatabaseDeployer.dll".
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f'
at DatabaseDeployer.Tasks.BuildTask..ctor()

Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015\nCrunch.BuildHost461.x86.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2015/
LOG: Initial PrivatePath = NULL
Calling assembly : DatabaseDeployer, Version=0.0.16279.1, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2015\nCrunch.BuildHost461.x86.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Practices.Unity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2015/Microsoft.Practices.Unity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2015/Microsoft.Practices.Unity/Microsoft.Practices.Unity.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2015/Microsoft.Practices.Unity.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2015/Microsoft.Practices.Unity/Microsoft.Practices.Unity.EXE.
LOG: Attempting download of new URL file:///C:/Users/s68329/AppData/Local/NCrunch/33456/1/packages/DatabaseDeployer.0.0.16279.01/Tools/Microsoft.Practices.Unity.DLL.
LOG: Attempting download of new URL file:///C:/Users/s68329/AppData/Local/NCrunch/33456/1/packages/DatabaseDeployer.0.0.16279.01/Tools/Microsoft.Practices.Unity/Microsoft.Practices.Unity.DLL.
LOG: Attempting download of new URL file:///C:/Users/s68329/AppData/Local/NCrunch/33456/1/packages/DatabaseDeployer.0.0.16279.01/Tools/Microsoft.Practices.Unity.EXE.
LOG: Attempting download of new URL file:///C:/Users/s68329/AppData/Local/NCrunch/33456/1/packages/DatabaseDeployer.0.0.16279.01/Tools/Microsoft.Practices.Unity/Microsoft.Practices.Unity.EXE.

packages\DatabaseDeployer.0.0.16279.01\build\DatabaseDeployer.targets (14, 5): The "BuildTask" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name.


I can probably create an simple test solution to repro this issue.

Any suggestions?

Best reg
Johan


Remco
#2 Posted : Wednesday, October 5, 2016 10:17:22 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,145

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Johan,

This looks like an internal problem inside the DatabaseDeployer build logic. It must be making some kind of assumption about its build environment that doesn't always hold true when running under NCrunch.

If you haven't already, I'd suggest using compatibility mode to see if you can identify the NCrunch feature that it doesn't like.

Make sure all dependencies for this package are included using NCrunch's additional files to include setting. It's possible that the package has dependencies that NCrunch hasn't been able to automatically identify.

It's also possible that the Nuget package hasn't been designed to be run repeatedly under MSBuild outside of Visual Studio. Try running MSBuild directly against the solution a few times after a clean to see if this makes any difference.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.054 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download