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

Notification

Icon
Error

Inscrutable build error
leechang
#1 Posted : Tuesday, June 26, 2012 4:55:37 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/26/2012(UTC)
Posts: 5

I'm just getting started with NCrunch, and I'm trying to get my solution to build. I have most of the projects building, but this one gives me an exception I can't figure out:

[15:59:53.4119-BuildTask-72] ERROR (Compilation): Framework: (0): System.NotSupportedException: I
at Mono.Cecil.SignatureWriter.WritePrimitiveValue(ElementType type, Object value)
at Mono.Cecil.MetadataBuilder.GetConstantSignature(ElementType type, Object value)
at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
at Mono.Cecil.MetadataBuilder.AddParameter(UInt16 sequence, ParameterDefinition parameter, ParamTable table)
at Mono.Cecil.MetadataBuilder.AddParameters(MethodDefinition method)
at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddNestedTypes(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypeDefs()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0(MetadataBuilder builder, MetadataReader _)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.#=q_HKt4KyEpsXjAHmK6TktdfgeotBZqvsO6ksZLQVDtC8=.#=qJ2SnLZKA$SA7l82N8DyGWeDko5qZW0$cs7R2_cDxdS4=()
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.#=qYplCHUfuaCUZlWkewCsGIw==(Action #=qdnGkCOy79EuVKMQvUz1wKg==)
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.Instrument(ComponentSourceLineMap sourceLineMap, IDictionary`2 codeFileIDsByFilePath, Boolean proxyProcessIsActive, Int32 componentId, IInstrumentationFilter[] instrumentationFilters)
at nCrunch.Compiler.RemoteBuildRunner.#=qvNS9Jn_vovPYj$WawPTGDERaQEDfCgulsnXs2PU1wgs=(ComponentBuildParameters #=qZ0nVDJszjF89iUQrzRa9Xg==, String #=qBsfAvxV6Q9z2WQfszeaUsN9MGIbMJQ5D9TVrLVUxtpg=, BuildOutput #=q2tMm4jnZ3cMEq4QEnstrjg==, String #=qwp0qFZQ$sJ9ZMfapXWl4VtX1l$Da_vESDQ0Myqy7VFA=)
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)

The only funny thing about this one is that it references a C++/CLI (Managed C++) assembly.
Remco
#2 Posted : Wednesday, June 27, 2012 9:56:22 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for posting!

I've seen reports of this exception when compiling C++ assemblies, though not for projects that reference these.

Is the code for this project/solution something you're able to share? I'd really like to know what causes this problem.

It should be possible to work around the issue by setting the 'Instrument Output Assembly' project-level NCrunch configuration option to 'FALSE' for the project that is failing to build - although you will lose code coverage information for the project.
leechang
#3 Posted : Wednesday, June 27, 2012 4:47:22 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/26/2012(UTC)
Posts: 5

Unfortunately, I cannot share the project or solution. Removing "Instrument Output Assembly" did allow it to build, but I love the little dots for coverage! The exception is supposed to show the type that was rejected, but for some reason it's cut off "System.NotSupportedException: I" - is there a way to get the entire message to show up in the window?

Thanks!
Remco
#4 Posted : Thursday, June 28, 2012 9:27:19 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
I have a feeling that 'I' may be the extent of the exception description (some of the exceptions in this area are not very verbose). Though if it has been cut off, you'll likely find the full trace inside the log file used for bug reports. After the exception has occurred, choose 'Submit bug report' from the NCrunch menu, then choose to save the log to disk. Inside the 'Logfile' you should be able to find the exception if you search for it.

I'll make a note to review some of the code in this area. It will be difficult to fix without a reproduction, but maybe I can improve the error reporting in the next release so that we can be a step closer to working this out.
leechang
#5 Posted : Friday, June 29, 2012 10:55:23 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/26/2012(UTC)
Posts: 5

Yeah, I looked at the log, and the error was exactly as above with the type being "I", for whatever that's worth.
Remco
#6 Posted : Monday, July 2, 2012 3:54:21 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks. If you manage to create a smaller shareable reproduction of the issue, please do let me know.
leechang
#7 Posted : Tuesday, August 14, 2012 6:44:00 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/26/2012(UTC)
Posts: 5

Just following up on this again, I figured it out - I think it might be a bug in Mono.Cecil. I had a method with this signature:
private static void Execute(
IntPtr handle,
int operation,
string name,
Action<IntPtr, int> callBack,
IntPtr inBuffer = default(IntPtr),
int inBufferSize = 0)

I removed the "default(IntPtr)" and NCrunch started working. It seems that it doesn't understand the constant.
Remco
#8 Posted : Tuesday, August 14, 2012 9:49:11 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks for the reproduction. I'll note it down to be fixed!


Cheers,

Remco
elDavio
#9 Posted : Monday, March 25, 2013 8:40:53 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/25/2013(UTC)
Posts: 2
Location: United Kingdom

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Hi, did this get fixed in the end?

I'm experiencing something that looks an awful lot like this trying to build the NuGet code base ( available at http://nuget.codeplex.co...rceControl/BrowseLatest ).

A few of the projects have the standard NCrunch errors (implicit dependencies), but the project PowershellHost gives me this error. I'm running NCrunch version 1.44.0.11.

Please help - I honestly can't imagine trying to write code without NCrunch any more!
Remco
#10 Posted : Monday, March 25, 2013 10:40:30 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for posting!

I've introduced a fix for this issue in the 1.45 release, due out within a few days.

In the content of the Nuget solution, I recommend removing the default IntPtr from the NativeMethods.CredUIPromptForCredentials method inside the PowershellHost project as a temporary workaround. It looks as though nothing is using this parameter, so hopefully this will get you working until 1.45 is released :)


Cheers,

Remco
1 user thanked Remco for this useful post.
elDavio on 4/1/2013(UTC)
Remco
#11 Posted : Saturday, March 30, 2013 9:38:59 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
For anyone interested, a fix for this problem has been introduced with the newly released version of NCrunch (v1.45).
elDavio
#12 Posted : Monday, April 1, 2013 3:27:53 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 3/25/2013(UTC)
Posts: 2
Location: United Kingdom

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
It absolutely has! Thanks a bundle for this, I'm going to go off and buy myself a personal licence to go with the one my employer has. Keep up the good work.
1 user thanked elDavio for this useful post.
Remco on 4/1/2013(UTC)
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.084 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download