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

Notification

Icon
Error

TargetInvocationException
Lawrence
#1 Posted : Thursday, March 30, 2017 10:22:52 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/14/2016(UTC)
Posts: 3
Location: United States of America

Was thanked: 1 time(s) in 1 post(s)
I'm using the console version of ncrunch on my build box and I've gotten this error on one of my pipelines:

11:20:44.736 NCrunch Console Tool v3.6.0.2
11:20:44.736 Copyright c 2010-2016 Remco Software Ltd
11:20:44.736 Usage of this tool is permitted only under the terms described in License.rtf
11:20:44.736
11:20:44.736
11:20:44.908
11:20:44.940 Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ComponentModel.Win32Exception: The parameter is incorrect
11:20:44.940 at System.Drawing.Icon.Initialize(Int32 width, Int32 height)
11:20:44.940 --- End of inner exception stack trace ---
11:20:44.940 at System.RuntimeMethodHandle.SerializationInvoke(IRuntimeMethodInfo method, Object target, SerializationInfo info, StreamingContext& context)
11:20:44.940 at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
11:20:44.940 at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
11:20:44.940 at System.Runtime.Serialization.ObjectManager.DoFixups()
11:20:44.940 at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
11:20:44.940 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
11:20:44.940 at System.Resources.ResourceReader.DeserializeObject(Int32 typeIndex)
11:20:44.940 at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
11:20:44.940 at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase, Boolean isString)
11:20:44.940 at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
11:20:44.940 at #=qt_VcUogRcUEkvmdlv0TCL6eie8nI_ZSf4VFP03BiLcexIN0LK9szsekIgW8b2w2E.#=q7hOFOc7XCgWFIGUEuQFMIoql6QiGHs9Rytlu1Kvt0lg=()
11:20:44.940 at #=qt_VcUogRcUEkvmdlv0TCL6eie8nI_ZSf4VFP03BiLcexIN0LK9szsekIgW8b2w2E..ctor()
11:20:44.940 at RM.Product.Model.Client.UserManager.Initialise(IntPtr mainWindowHandle, String productName, Byte[] applicableProductAuthenticationData, DateTime applicableLicensesStartDate, StorageLevel storageLevel, ILicenseProtocol protocol, Boolean licenseServerLeaseRequired)
11:20:44.940 at .()
11:20:44.940 at .(String[] )
11:20:44.940 at .(String[] )
11:20:45.408 Running build failed.
11:20:45.408 Error:
11:20:45.408 System.Exception: BuildSystem\ncrunch\NCrunch.exe exited with error 255
11:20:45.408 at FSI_0005.Build.ShellExec@60.Invoke(String message) in D:\Go\A\pipelines\SomeDir\BuildSystem\build.fsx:line 60
11:20:45.408 at FSI_0005.Build.ShellExec(String command, String args) in D:\Go\A\pipelines\SomeDir\BuildSystem\build.fsx:line 60
11:20:45.408 at FSI_0005.Build.clo@101-8.Invoke(Unit _arg4) in D:\Go\A\pipelines\SomeDir\BuildSystem\build.fsx:line 102
11:20:45.408 at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 511

Oddly the code it's failing on is a blank console app that was added today. The other console apps we have in other pipelines using the same build scripts on the same build box works fine. Even stranger if I pull the pipeline to my local box it compiles fine as well.

Any ideas on what icon it's looking for? I'm honestly not even sure this is a NCrunch issue. I'm guessing the build agents is missing some security permission, but it's an admin on the box, so I'm grasping at straws.
Remco
#2 Posted : Thursday, March 30, 2017 10:44:56 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi, thanks for sharing this problem.

I've seen this happen before, intermittently in a test VM. My understanding at the moment is that it's actually caused by a race condition in the .NET framework itself, which tries to somehow load resources in parallel while the console process is still starting. I remember seeing a stack overflow question describing this issue somewhere though I'm having trouble finding it right now.

There are plans to introduce a workaround for it in the next major fix-up release (I'm hoping this will be v3.7).

You might find that the problem surfaces more in certain environments (i.e. perhaps the machine is running a bit slower than normal?).

pgohier
#3 Posted : Thursday, May 18, 2017 3:36:57 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/17/2017(UTC)
Posts: 2
Location: Canada

Was thanked: 1 time(s) in 1 post(s)
Any news on this ? I am getting the same error.
I have tried installing version 3.7 but to no avail.

Whenever I run NCrunch from command line I don't get the error but from our build server it crashes and I get:

error 18-May-2017 10:27:22 Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ComponentModel.Win32Exception: The parameter is incorrect
error 18-May-2017 10:27:22 at System.Drawing.Icon.Initialize(Int32 width, Int32 height)
error 18-May-2017 10:27:22 --- End of inner exception stack trace ---
error 18-May-2017 10:27:22 at System.RuntimeMethodHandle.SerializationInvoke(IRuntimeMethodInfo method, Object target, SerializationInfo info, StreamingContext& context)
error 18-May-2017 10:27:22 at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
error 18-May-2017 10:27:22 at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
error 18-May-2017 10:27:22 at System.Runtime.Serialization.ObjectManager.DoFixups()
error 18-May-2017 10:27:22 at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
error 18-May-2017 10:27:22 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
error 18-May-2017 10:27:22 at System.Resources.ResourceReader.DeserializeObject(Int32 typeIndex)
error 18-May-2017 10:27:22 at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
error 18-May-2017 10:27:22 at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase, Boolean isString)
error 18-May-2017 10:27:22 at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
error 18-May-2017 10:27:22 at #=qVAZZyAdFwnaUkcO0Iw7OoYToyZaMNv89fpTfjzOXgG0YnlL13v9r7gkLHSTYST6S.#=q2SlOZ5n1gKSQ7GXo0TlOkrFVMBuUxPpVBXoUpf8FU70=()
error 18-May-2017 10:27:22 at #=qVAZZyAdFwnaUkcO0Iw7OoYToyZaMNv89fpTfjzOXgG0YnlL13v9r7gkLHSTYST6S..ctor()
error 18-May-2017 10:27:22 at RM.Product.Model.Client.UserManager.Initialise(IntPtr mainWindowHandle, String productName, Byte[] applicableProductAuthenticationData, DateTime applicableLicensesStartDate, StorageLevel storageLevel, ILicenseProtocol protocol, Boolean licenseServerLeaseRequired)
error 18-May-2017 10:27:22 at  .()
error 18-May-2017 10:27:22 at  .(String[] )
error 18-May-2017 10:27:22 at  .(String[] )



Thanks!
Remco
#4 Posted : Thursday, May 18, 2017 10:03:10 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi, thanks for sharing this. v3.7 did include a fix for this problem, so I'd hoped we'd seen the last of it. It hasn't been showing up anymore in my tests .. but I guess it's still there :(

I'll try something else. Thanks again for letting me know about this.
pgohier
#5 Posted : Thursday, May 25, 2017 5:25:09 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/17/2017(UTC)
Posts: 2
Location: Canada

Was thanked: 1 time(s) in 1 post(s)
FYI
We were able to fix this issue by removing the config file path and regenerating a new xml.
Cheers
1 user thanked pgohier for this useful post.
Remco on 5/25/2017(UTC)
Remco
#6 Posted : Thursday, May 25, 2017 10:14:45 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks for letting me know how you solved this! Can you confirm which config file you needed to replace?
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.079 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download