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

Notification

Icon
Error

Project build failure
steve_evans
#1 Posted : Friday, October 10, 2014 2:29:01 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/10/2014(UTC)
Posts: 3
Location: United Kingdom

Thanks: 1 times
I have just started working on a an existing project and wanted to enable NCrunch but I am getting failure when NCrunch tries to build. The solution builds when initiated through the IDE.

The project that is causing the issue is a class library and the only things of note are that its referencing some VSTO stuff and the clickOnce manifest is signed - as per the Signing tab in VS2013.

I can work around the issue by ignoring the component completely in the NCrunch config and using an assembly reference in my test project rather than a project reference, but would ultimately like not to have to do that.

The error that NCrunch reports is:

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
..\..\..\..\..\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets (176): The "FindRibbons" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'Gas.HourlyVolumes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'Gas.HourlyVolumes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Server stack trace:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage(IMessage reqMsg)

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__20.MoveNext()

=== Pre-bind state information ===
LOG: DisplayName = Gas.HourlyVolumes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2013
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Remco Software\NCrunch for Visual Studio 2013\nCrunch.build.12.0.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2013/Gas.HourlyVolumes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2013/Gas.HourlyVolumes/Gas.HourlyVolumes.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2013/Gas.HourlyVolumes.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/Extensions/Remco Software/NCrunch for Visual Studio 2013/Gas.HourlyVolumes/Gas.HourlyVolumes.EXE.
Remco
#2 Posted : Friday, October 10, 2014 11:16:52 PM(UTC)
Rank: NCrunch Developer

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

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

Thanks for sharing this issue.

I think the first thing we should try here is to put NCrunch in compatibility mode to see if there is an option that can immediately fix this.

Also, what can you tell me about the assembly that cannot be found? Is it the assembly build from the project that is failing? Or is it a direct dependency of the project?

If the build target that is failing isn't needed in order to prepare the project for NCrunch's test environment, you may be able to suppress it entirely using an NCrunch-specific build override - see http://www.ncrunch.net/documentation/troubleshooting_ncrunch-specific-overrides for more details on this. If there is a property that causes the target to run, simply making the property conditional on NCrunch not being resident could allow the build to avoid the problem entirely.
steve_evans
#3 Posted : Monday, October 13, 2014 7:43:50 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/10/2014(UTC)
Posts: 3
Location: United Kingdom

Thanks: 1 times
Hi Remco,

Thanks for responding to my post and for your suggestions. Having copied the compatibility settings and found that everything works, albeit with some warnings, I have found that its the 'Copy Referenced Assemblies To Workspace' setting that seems to be causing the problem/solution. When set to the default value i.e. False, the error that I posted initially is again encountered and when set to true everything is fine.

I am a little unclear of what your question regarding the about the assembly that cannot be found is asking. The assembly mentioned in the error, 'Gas.HourlyVolumes', is referenced (via a project reference) by one of the test projects in the solution. It is this assembly that when I now modify the 'Copy Referenced Assemblies To Workspace' setting causes the behaviour to change.

Does this help? Would you suggest simply enabling the 'Copy Referenced Assemblies To Workspace' setting and leaving it at that or should that be unnecessary and is there something weird with this project that could be causing the error?

Thanks again, Steve
Remco
#4 Posted : Monday, October 13, 2014 9:57:40 PM(UTC)
Rank: NCrunch Developer

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

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

It seems as though this build step requires referenced assemblies to be copied to the build output directory prior to the step being run. Normally, NCrunch suppresses this behaviour as it needs to avoid copying referenced assemblies in order to optimise builds.

Leaving this setting enabled will reduce the responsiveness of the NCrunch engine, but it will get you working with minimal fuss. Alternatively, you could try suppressing the build step using an override (as mentioned above). This would allow you to work with the setting disabled, thus giving you the best performance.

Many people work daily in solutions with the 'Copy referenced assemblies to workspace' setting enabled, as sometimes the effort required to make their builds/tests work without it is more than they can justify spending for the extra performance.


Cheers,

Remco
1 user thanked Remco for this useful post.
steve_evans on 10/14/2014(UTC)
steve_evans
#5 Posted : Tuesday, October 14, 2014 7:29:07 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/10/2014(UTC)
Posts: 3
Location: United Kingdom

Thanks: 1 times
Thanks for the assistance Remco. For now, I'll leave the project configured to copy the referenced assemblies and take a look at using a build step in the future.

Thanks again. Steve
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.056 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download