Build 2011-04-11 false positives in mixed .NET/SL solutions

First a bit of background...

I have a mixed-mode solution with a couple of "portable library"-like projects and a number of regular .NET 4 Full Profile projects. The portable libraries are really simple DLL projects, built against the common subset of Silverlight 4 and .NET 4 frameworks so they can be used as-is in both types of host applications. In practice, this means they only reference mscorlib, System, and System.Core framework assemblies. As you might know, Visual Studio 2010 (even with SP1) itself has a slight problem with such solutions in that it doesn't allow project references between such mixed mode projects. This restriction is mostly artificial, and the unofficially sanctioned workaround is to simply use DLL references in such cases, until a future update addresses this issue. Although a bit annoying, it works as advertised, so this is what I do here as well.

Onto the problem now...

ReSharper seems to be finding a lot of non-existent problems when analyzing code in the .NET project, which references types and members, defined in the portable libraries. The same code in non-mixed solution results in no report from ReSharper. This was a already a known problem in v5, but was said to being addressed in upcoming v6. When I tried the 2011-04-11 nightly build, I found out that the biggest problems from v5 in this area were indeed fixed, but at the same time, a ton of new ones were introduced.

I'm not sure what the best way to demonstrate all these would be, so I made a couple of screenshots with short explanations of the problems embedded in each. I haven't included all the problems, but I think the ones I did are representative enough. Please see the attachments.

Bottom line is, I think I see a pattern with all the false positives I've encoutered so far. My guess is, when performing analysis of the referenced code, ReSharper loads the DLLs from the wrong framework, and then barfs when even the simplest type comparisons fail. I'm not exactly sure how this is possible or what can be done, since aforementioned system DLLs' metadata are supposed to be binary compatible between frameworks (hence the term "portable subset"). But there you have it.

Anyhow, I hope this can all be resolved soon, because it renders ReSharper nearly unusable in most of my projects.



Attachment(s):
Problem-1.png
Problem-2.png
Problem-3.png
2 comments

Hello Aleksander,

Could you please create a small sample solution demonstrating your configuration
of cross-project references and errors reported by ReSharper and attach it
here? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

First a bit of background...

I have a mixed-mode solution with a couple of "portable library"-like
projects and a number of regular .NET 4 Full Profile projects. The
portable libraries are really simple DLL projects, built against the
common subset of Silverlight 4 and .NET 4 frameworks so they can be
used as-is in both types of host applications. In practice, this means
they only reference mscorlib, System, and System.Core framework
assemblies. As you might know, Visual Studio 2010 (even with SP1)
itself has a slight problem with such solutions in that it doesn't
allow project references between such mixed mode projects. This
restriction is mostly artificial, and the unofficially sanctioned
workaround is to simply use DLL references in such cases, until a
future update addresses this issue. Although a bit annoying, it works
as advertised, so this is what I do here as well.

Onto the problem now...

ReSharper seems to be finding a lot of non-existent problems when
analyzing code in the .NET project, which references types and
members, defined in the portable libraries. This was a already a known
problem in v5, but was said to being addressed in upcoming v6. When I
tried the 2011-04-11 nightly build, I found out that the biggest
problems from v5 in this area were indeed fixed, but at the same time,
a ton of new ones were introduced.

I'm not sure what the best way to demostrate all these would be, so I
made a couple of screenshots with short explanations of the problems
embedded in each. Please see the attachments.

Bottom line is, I think I see a pattern with all the false positives
I've encoutered so far. My guess is, when performing analysis of the
referenced code, ReSharper loads the DLLs from the wrong framework,
and then barfs when simple type comparisons fail. I'm not exactly sure
how this is possible, since aforementioneds

---
Original message URL:
http://devnet.jetbrains.net/message/5300051#5300051



0

I recreated the problems in a fresh solution with only two projects - a portable C# library dll based on subset of Silverlight 4 and a C# WinForms exe that references it.

Relevant parts of my system configuration:

- Windows 7 Professional
- Visual Studio 2010 SP1 with Visual Studio SDK and Silverlight 4 Tools installed
- ReSharper 6 EAP Build 2011-04-11

I inserted comments in the exe project wherever ReSharper underlined my code. See attachment.



Attachment(s):
MixedModeSolution.zip
0

Please sign in to leave a comment.