2015-07-10 52 views
0

我有一個編譯和工作的類庫項目(.NET Framework 4.5.1)。使用ReSharper進行分析時,它報告生成的Resources.resx文件引用System.Windows.Forms,該文件未在項目中引用。Resources.resx中的System.Windows.Forms參考

<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> 
  • 爲什麼我需要形式嵌入的資源?
  • 沒有引用表單有問題嗎? (再次,調用代碼有效)

回答

1

您不需要表單來嵌入資源。儘管編譯器使用位於System.Windows.Forms中的System.Resources.ResXFileRef將文件嵌入到dll中。只需禁用警告。

0

雖然這對於不需要嵌入System.Windows.Forms的Windows而言是正確的,但我目前正在將C#應用程序移植到Linux(使用SDL2,Monokickstart等),而在Linux下,我遇到了一個dll這個錯誤似乎源於對resx文件中System.Windows.Forms的引用。

+0

你可能會考慮問一個單獨的問題(標記爲單聲道等)並鏈接到這個問題。這可以讓人們專門回答你的問題,並可能會得到更多的關注。 – TrueWill