How to address "Cannot resolve 'assembly'" issues

My inspection is throwing up two warnings:

   Cannot resolve assembly 'System.Windows.Forms'
   Cannot resolve namespace 'System'

on these lines:

  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  <data name="DefaultUser" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..\Resources\DefaultUser.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
  </data>

This is in a Resources.resx file. The program works fine so I cannot see how to address these other than ignore them. Is this a ReSharper bug?

This is with ReSharper 8.0.2 Full Edition (build 8.0.2000.2660) running in Visual Studio 2012.

8 comments
Comment actions Permalink

Nobody know? Is this a bug in ReSharper? The code itself works fine and requires these references (which were generated by Visual Studio 2012) so I doubt the problem is on my side.

0
Comment actions Permalink

I'm still seeing this issue with ReSharper 2016.3 and Visual Studio 2015. Also not sure how to address the issue.

0
Comment actions Permalink

Hello Marco,

Please install R# 2016.3.1 bugfix update https://www.jetbrains.com/resharper/download/#, we've fixed a couple of "Can't resolve symbol" issue there. 

Thanks! 

-1
Comment actions Permalink

Thank Alexander! My one remaining problem of that nature was indeed fixed with that release. Have a happy new year...

0
Comment actions Permalink

Marco,

Awesome! Thanks for the update. I wish you a Happy New Year!

Thanks! 

0
Comment actions Permalink

Guys, this warning happens when you try to use WinForms resources file in WPF project (just don't do it).

For more information google smth about : WPF, Resources, ResourcesStream, URI, ...

-1
Comment actions Permalink

I am still getting this warning in Resharper 2017.2.1 under Visual Studio 2017, in a "new-style" (i.e. csproj rather than xproj with project.json) .NET Core project referencing ASP.NET Core 2.0 and .NET Framework 4.7. I also get the error in a WPF project in the same version of Resharper under Visual Studio 2015.

I see no reason why I should not include resx resources in a non-'Windows Forms' project. This is a standard way to provide localization in Visual Studio .NET projects. Windows Forms does not need to be added as a reference to the project; the type ResXFileRef from the System.Windows.Forms assembly is only used by the compiler and the resulting DLL contains embedded actual image data - it doesn't require the ResXFileRef type or otherwise depend on Windows Forms.

0
Comment actions Permalink

I encountered the same issue in VS2017 with Resharper Ultimate 2017.3.5 after I just add a resource file (.resx) in my class library project.

0

Please sign in to leave a comment.