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

Notification

Icon
Error

Unable to cast transparent proxy to type 'IInnerWeaver'.
bosmanr
#1 Posted : Wednesday, June 23, 2021 8:10:31 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/27/2018(UTC)
Posts: 5
Location: Netherlands

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Dear support forum,

I am happily using Ncrunch for a long time now. But I started facing build problems when we were using Fody's NullGuard. A long time I could just manual rebuild and it would solve itself. But now I can not rebuild either and it stays in an error state of "Build failure".


Fody: An unhandled exception occurred:
Exception:
Unable to cast transparent proxy to type 'IInnerWeaver'.
Type:
System.InvalidCastException
StackTrace:
at IsolatedAssemblyLoadContext.CreateInstanceFromAndUnwrap()
at Processor.ExecuteInOwnAssemblyLoadContext()
at Processor.Inner()
at Processor.Execute()
Source:
FodyCommon
TargetSite:
IInnerWeaver CreateInstanceFromAndUnwrap()


Now this is of course no immediate Ncrunch problem, since its Fody that complains. I also saw older posts on stack overflow, which make me believe this was an older and solved problem in Fody.NullGuard. I also set the "Auto-detect NuGet build dependencies to false (saw it mentioned as a solution).

But now it has become unusable for me.

I am hoping there is an approach were we can still use the NullGuarding and have Ncrunch make my day productive again.

Any solutions or pointers to solution are very welcome.

Regards,

Remco Bosman
Remco
#2 Posted : Wednesday, June 23, 2021 11:49:15 AM(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 Remco,

Thanks for sharing this problem. I'm not sure where to begin on this, so I reached out to Simon Cropp (the developer of Fody) for help. He's wondering if you are able to create a sample that can reproduce the problem? https://twitter.com/SimonCropp/status/1407664240459010049.
bosmanr
#3 Posted : Wednesday, June 23, 2021 11:54:21 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/27/2018(UTC)
Posts: 5
Location: Netherlands

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Well I wonder if I need to add some extra configuration. I found some older posts about copying referenced assemblies and copying the Fody packages. Or should it work out of the box with default settings? Weird thing is the same solution works on my desktop (requiring manual rebuild as well, but I can get it to build) but it all of a sudden stopped on my laptop, same solution.
Remco
#4 Posted : Wednesday, June 23, 2021 12:47:17 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)
bosmanr;15493 wrote:
Well I wonder if I need to add some extra configuration. I found some older posts about copying referenced assemblies and copying the Fody packages. Or should it work out of the box with default settings? Weird thing is the same solution works on my desktop (requiring manual rebuild as well, but I can get it to build) but it all of a sudden stopped on my laptop, same solution.


The 'Copy referenced assemblies to workspace' setting is usually the first one to try, as this makes the build behave in a manner more similar to that of VS (with some performance implications).

I can also recommend trying compatibility mode.

Unfortunately I'm not familiar enough with the internals of Fody to guess at what may be the cause of this exception. If you can put together a sample solution that can consistently produce the problem, Simon is offering to take a closer look.
bosmanr
#5 Posted : Wednesday, June 23, 2021 1:07:32 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/27/2018(UTC)
Posts: 5
Location: Netherlands

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Ok thanks for the reply, i will see how far i can get with these settings and try to make a smaller solution to be able to pinpoint if it always goes wrong. But that will take me a bit more time. And I'll address Fody for this.
1 user thanked bosmanr for this useful post.
Remco on 6/23/2021(UTC)
bosmanr
#6 Posted : Wednesday, July 14, 2021 8:18:39 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/27/2018(UTC)
Posts: 5
Location: Netherlands

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Just to post a bit of an update. The projects were using two Fody weavers, NullGuard and EmptyConstructor. Things seem to work better with just one. I hope I can make a simple test project with this in mind.
1 user thanked bosmanr for this useful post.
Remco on 7/14/2021(UTC)
Lars Witthuhn
#7 Posted : Friday, January 21, 2022 11:05:01 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/17/2016(UTC)
Posts: 1
Location: Germany

Was thanked: 1 time(s) in 1 post(s)
I encountered fody related build issues too. "Copy referenced assemblies" did not help in my case.
After randomly tweeking ncrunch settings it "works on my machines" setting "Build process CPU architecture" in ncrunch settings to x64 instead of the defaulted x86.
Hope it helps anyone :)
1 user thanked Lars Witthuhn for this useful post.
bosmanr on 1/21/2022(UTC)
bosmanr
#8 Posted : Friday, January 21, 2022 12:56:46 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 6/27/2018(UTC)
Posts: 5
Location: Netherlands

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Thanks Lars,

Trying that now and my most cumbersome project seems to be running way smoother now. Never got down to the real problem, since it only happens on larger solutions. I created a test solution with just three projects, it never failed.

Hope it keeps on working.
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.063 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download