Lots of false negatives

I have a CF.Net 2.0 application and I encounter a lot of false negatives in my code. I'm working with the latest version, 3.0.517.8.

Some examples are:
- Cannot convert source type 'System.DayOfWeek' to target type 'System.DayOfWeek'. This also happens with other types, e.g. System.Reflection.ConstructorInfo.
- Cannot apply operator '+=' to operands of type 'System.EventHandler' and 'System.EventHandler'.

Also, when using String.Format:
String.Format(CultureInfo.CurrentCulture, " ", now, logLevel), it doesn't see that CultureInfo.CurrentCulture implements IFormatProvider and thus I get the message "Cannot resolve method".

The list goes on, but these are just a few examples. I have the feeling it's not the individual issues, but there's something else going wrong that I get so much false positives.

Any ideas what might be going wrong here?

Thanks,
Jeffry

8 comments
Comment actions Permalink

Hello jeffryvu,

j> Any ideas what might be going wrong here?
Mixed solution. You have CF projects and normal class library or something
like this, all in single solution. ReSharper gets confused by two mscorlibs.
This is a known issue and has been fixed for ReSharper 4.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


j> I have a CF.Net 2.0 application and I encounter a lot of false
j> negatives in my code. I'm working with the latest version, 3.0.517.8.
j>
j> Some examples are:
j>
j> - Cannot convert source type 'System.DayOfWeek' to target type
j> 'System.DayOfWeek'. This also happens with other types, e.g.
j> System.Reflection.ConstructorInfo.
j>
j> - Cannot apply operator '+=' to operands of type
j> 'System.EventHandler' and 'System.EventHandler'.
j>
j> Also, when using String.Format:
j> String.Format(CultureInfo.CurrentCulture, "
j> ", now, logLevel), it doesn't see that CultureInfo.CurrentCulture
j> implements IFormatProvider and thus I get the message "Cannot resolve
j> method".
j> The list goes on, but these are just a few examples. I have the
j> feeling it's not the individual issues, but there's something else
j> going wrong that I get so much false positives.
j>
j>
j> Thanks,
j> Jeffry


0
Comment actions Permalink

Hi Ilya,

Ok, that makes sense. I don't see any explicit references to normal (non-CF) class libraries in my code, but I will have a more thorough look at it.

Thanks,
Jeffry

0
Comment actions Permalink

Hello jeffryvu,

in fact, such references are not normally present explicitly in the code.
Instead, a reference to the standard framework's MSCorlib assembly is implicitly
added to each 'normal'
project.


Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


Hi Ilya,

Ok, that makes sense. I don't see any explicit references to normal
(non-CF) class libraries in my code, but I will have a more thorough
look at it.

Thanks,
Jeffry



0
Comment actions Permalink

Hi Dmitry,

I understand they are not present explicitly in the code. However, I only have CF projects in my solution and the mscorlib in the references of each project is the CF version.

I do have some other dll references in my projects. Maybe one of those references assemblies has a dependency on the normal mscorlib.

0
Comment actions Permalink

Hi,

I noticed having Installer projects (MSI or CAB) in your solution can
cause the same problems.
Making a new solution file adding only CF projects might solve the problem.

Best Regards, Wiebe Tijsma

jeffryvu wrote:

Hi Dmitry,

I understand they are not present explicitly in the code. However, I only have CF projects in my solution and the mscorlib in the references of each project is the CF version.

I do have some other dll references in my projects. Maybe one of those references assemblies has a dependency on the normal mscorlib.

0
Comment actions Permalink

Thanks, I'll give it a try. I did have an installer project in my solution, but not anymore.

Maybe I'll just start with a new clean CF solution and see if the problem still appears.

Thanks,
Jeffry

0
Comment actions Permalink

Hi Ilya,

I see there are nightly builds available for Resharper 4. Is the fix for this issue already available in the nightly build? If so, I might give it a try.

Thanks,
Jeffry

0
Comment actions Permalink

Hello Jeffry,

Yes, the change is already in ReSharper 4 and you can try it.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> Hi Ilya,
IR>
IR> I see there are nightly builds available for Resharper 4. Is the fix
IR> for this issue already available in the nightly build? If so, I
IR> might give it a try.
IR>
IR> Thanks,
IR> Jeffry


0

Please sign in to leave a comment.