TrueWill
TrueWill

Reputation: 25523

System.Windows.Forms reference in Resources.resx

I have a class library project (.NET Framework 4.5.1) that compiles and works. When analyzing with ReSharper, it reported that the generated Resources.resx file references System.Windows.Forms, which isn't referenced in the project.

  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  <data name="MyResource" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>...</value>
  </data>

Upvotes: 2

Views: 1771

Answers (2)

ares_games
ares_games

Reputation: 1067

Although, this is true for Windows where an embedding of System.Windows.Forms is not needed, I am currently in the process of porting an C# application to Linux (using SDL2, Monokickstart etc.) and under Linux I encounter a dll-not-found error that seems to origin in the reference to System.Windows.Forms within the resx file.

Upvotes: 0

Dmitri Trofimov
Dmitri Trofimov

Reputation: 574

You don't need Forms to embed a resource. Although the compiler uses the System.Resources.ResXFileRef that is located in System.Windows.Forms to embed your file into the dll. Just disable the warning.

Upvotes: 2

Related Questions