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:
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/documentation/troubleshooting_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
NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/documentation/troubleshooting_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