Remco;13227 wrote:This looks like a versioning issue of some kind.
In the Nuget package I've downloaded for CodeSmith.Generator.Task.8.0.0, the CodeSmith.Engine DLL is v8.0.0.0. I assume it's the same in your Nuget package. Are you using different versions of CodeSmith inside the same solution?
Could you try setting your 'Build process memory limit' setting to '1', then reset NCrunch and see if this makes any difference?
Does the project build correctly via a command-line invocation of MSBuild against the .csproj NCrunch has generated in its workspace? You can find the workspace by right clicking on the failed project in the Tests Window, then going to Advanced->Browse to workspace.
ok I turned off the generate on build option (one of the generator files was references other projects we do not have a reference to. MSBuild works from command line now.
Still get this from ncrunch build
..\packages\CodeSmith.Generator.Task.8.0.0\build\CodeSmith.Generator.Task.targets (20, 5): The "CodeSmith" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Server stack trace:
at Microsoft.Build.Evaluation.Context.EvaluationContext..ctor(SharingPolicy policy)
at Microsoft.Build.Evaluation.Context.EvaluationContext.Create(SharingPolicy policy)
at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at #rSc.#BSc.#sSc(String #Go)
at CodeSmith.MSBuild.CodeSmith.#mSc()
at CodeSmith.MSBuild.CodeSmith.#oSc()
at CodeSmith.MSBuild.CodeSmith.#lSc()
at CodeSmith.MSBuild.CodeSmith.Execute()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
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()
=== Pre-bind state information ===
LOG: DisplayName = System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Users/Patrick Glaspey/AppData/Local/NCrunch/BuildSystem/22340/VS2017/
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Patrick Glaspey\AppData\Local\NCrunch\BuildSystem\22340\VS2017\nCrunch.BuildHost462.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: System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///C:/Users/Patrick Glaspey/AppData/Local/NCrunch/BuildSystem/22340/VS2017/System.Collections.Immutable.DLL.
LOG: Attempting download of new URL file:///C:/Users/Patrick Glaspey/AppData/Local/NCrunch/BuildSystem/22340/VS2017/System.Collections.Immutable/System.Collections.Immutable.DLL.
LOG: Attempting download of new URL file:///C:/Users/Patrick Glaspey/AppData/Local/NCrunch/BuildSystem/22340/VS2017/System.Collections.Immutable.EXE.
LOG: Attempting download of new URL file:///C:/Users/Patrick Glaspey/AppData/Local/NCrunch/BuildSystem/22340/VS2017/System.Collections.Immutable/System.Collections.Immutable.EXE.