ILMerge & Resharper

I have ILMerged a library assembly, and when I reference it in a project, Resharper does not see any of the classes in the assembly.  The project builds fine with usages of classes from the IL Merged assembly; however, Resharper marks all of those usages red.  It also does not give intellisense for any of those classes, whereas if I disable Resharper then Visual Studio does give intellisense for them.  I am experiencing this with Resharper 5 EAP.   I can't say if it's peculiar to v5 because I have not yet tried it with earlier versions.  I'm guessing probably not.

Any ideas.  Do I need to do something special in the IL Merge?  Resharper bug?  Thanks.

9 comments
Comment actions Permalink

I've just ILMerge'd some assemblies and referenced the result in ReSharper. It works so far.

Could you please send me ( Leonid.Shalupov@jetbrains.com ) the details: resulting assembly and ILMerge arguments?
Or file a bug at http://www.jetbrains.net/jira

0
Comment actions Permalink

I had experimented with ILMerge just prior to 4.5 and found that it didn't work if the projects that I was merging were a part of the current Visual Studio solution.  My goal was to split up some of my shared code into finer grain assemblies and then ILMerge them into a single assembly based on what was needed for a particular solution.  I was using the technique described in

http://www.hanselman.com/blog/MixingLanguagesInASingleAssemblyInVisualStudioSeamlesslyWithILMergeAndMSBuild.aspx, although I wasn't mixing languages at the time.  Without the projects in the solution you lose the debugging and refactoring experience for the source in the merged assembly which wasn't worth it for me.  I think it would be great if Resharper supported this scenario.

0
Comment actions Permalink

You nailed it Jamie!  I had tested the merge by adding a test project to the very same solution I was merging.  It did not occur to me that being in the same solution would affect visibility to Resharper of types in tyhe merged assembly.

Seems like this is a Resharper bug.  However, I have no use case that requires it to work.  So for me, the case is closed.  Thanks!

0
Comment actions Permalink

Found the problem. Actually that not a bug in
ReSharper. Due to some special cases whenever you reference output dll of a project from current solution,
ReSharper actually references source version, so you won't see any types merged from other assemblies.

So better to split solution into two: one with merged projects and one with the code that uses them.
Then you'll get usual ReSharper navigation (read only) in the second solution to the code from first
(implemented since ReSharper 5, feature called "External sources").

0
Comment actions Permalink

Hi Leonid,

Although this solution does work, it is not very practical for developement having two solutions open, one containing the tests for the other solution. Or is there another work around that I am not seeing? Any other advice would be much appreciated..

Thanks

Colin

0
Comment actions Permalink

Hi Leonid,

I agree with Colin that this is not a practial solution. I have a project which ILMerges in a dependent assembly after the build has finished int the AfterBuild task in the project file. I do not want to do this with an external build script as I want to test the assembly as a merged assembly without the dependent assembly being referenced by the test project. Having two solutions open is not viable. Can you suggest another work arround?

Matt

0
Comment actions Permalink

I don't see it as critical, but this is something I would still be interested in - the ability to have the source projects for a merged assembly in the same solution as a project that references the same solution.

0
Comment actions Permalink

There is an issue for this in YouTrack if anyone wants to vote.

http://youtrack.jetbrains.net/issue/RSRP-192616

0
Comment actions Permalink

Thanks for the heads up.  I added my vote today.

0

Please sign in to leave a comment.