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

Notification

Icon
Error

ReflectionOnlyAssemblyResolve error during build
jefim
#1 Posted : Thursday, July 5, 2012 6:39:07 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/5/2012(UTC)
Posts: 4

Hi,

I am totally new to NCrunch. I am trying to make it work with one of our projects and I am failing miserably. So basically I enabled NCrunch, went through the wizard and right after thatI got a failed build (in NCrunch, building normally works like a charm). The exact text I get on the project that fails is:

Code:
[09:29:20.5445-BuildTask-28] ERROR (Compilation): PluginProductManager: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFX.targets (269): Unknown build error, 'ReflectionOnlyAssemblyResolve handlers must return Assemblies loaded for reflection only.'


I do not directly use anything related to ReflectionOnlyAssemblyResolve methods in the code of this assembly. And I have no idea where to look for / how to make NCrunch work.

Just in case here is a list of references I have:

Code:
    <Reference Include="ICSharpCode.AvalonEdit, Version=4.1.0.8000, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL" />
    <Reference Include="System" />
    <Reference Include="System.ComponentModel.Composition" />
    <Reference Include="System.Core" />
    <Reference Include="System.Data.Entity" />
    <Reference Include="System.Xaml" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
    <Reference Include="WindowsBase" />
    <Reference Include="PresentationCore" />
    <Reference Include="PresentationFramework" />


The two not-so-standard refs are:


  1. System.ComponentModel.Composition - I use MEF to load plugins into main app (the project that is failing is a plugin). On the other hand lots of other plugins use this DLL.
  2. ICSharpCode.AvalonEdit - this is the AvalonEdit control (text editor with code highlighting). This is a free component available at http://wiki.sharpdevelop.net/AvalonEdit.ashx. I can try removing this ref, but it is not an option in the long run.



Anyway - does anyone have any ideas where can this error come from?
jefim
#2 Posted : Thursday, July 5, 2012 12:31:13 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/5/2012(UTC)
Posts: 4

Alright, after spending some time playing around with this issue I found a way to "solve" it - if I remove all the XAML files from the project then it compiles. This is not caused by a specific XAML file though - only after deleting ALL of them the build succeeds.
jefim
#3 Posted : Thursday, July 5, 2012 12:57:46 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/5/2012(UTC)
Posts: 4

Alright. I got to the cause of the issue. I have no idea why, but the csproj file of the failing project had the following line:

Code:
<AlwaysCompileMarkupFilesInSeparateDomain>false</AlwaysCompileMarkupFilesInSeparateDomain>


Frankly I have no idea why this was there and when it appeared, but after setting it to "true" (or completely removing it) the project started building without any problems. So... I guess my issue is resolved now.

UPDATE:

Just in case - found a thread about this flag here: link. There is an important point there in the comments:

Quote:
Blend 3 likes to default this to False as well...


Our project was also created in Blend 3 at some point, so I guess that this is where that flag came from. At the moment we are using Blend 4 and it does not set this flag in WPF/WPF lib projects by default (just checked).
Remco
#4 Posted : Friday, July 6, 2012 3:58:28 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting!

I'm glad you managed to find the cause of this issue. Because NCrunch runs builds via the command line tooling, it wouldn't be injecting an override for this property in the same way that Visual Studio does. I'll see what I can do about introducing an override for this in NCrunch builds so that other people won't get hit with this problem in future versions of NCrunch.


Thanks again,

Remco
jefim
#5 Posted : Friday, July 6, 2012 5:51:43 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/5/2012(UTC)
Posts: 4

Well, I do not know if this should necessarily be implemented in the NCrunch itself. But this issue could be added to "Troubleshooting build issues" page in the wiki.
Remco
#6 Posted : Monday, July 9, 2012 2:00:39 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Done! Thanks again.
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.043 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download