c#更改框架错误 [英] c# change framework error

查看:35
本文介绍了c#更改框架错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Visual Studio 2010.我只是将项目的框架从 4.0 更改为 3.5.我删除了它要求我删除然后尝试编译的参考 Microsoft.Framework.我现在得到错误:

I am running Visual Studio 2010. I just change the frame work of my project from 4.0 to 3.5. I removed the reference Microsoft.Framework that it asked me to remove then tried to compile. I now get the error:

错误 1 ​​无法加载文件或组装'System.Drawing,版本=4.0.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a' 或它的依赖项之一.系统找不到指定的文件.线123、位置5. C:Users\DocumentsVisual Studio2010Projects\PropertiesResources.resx 123 5

Error 1 Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Line 123, position 5. C:Users\DocumentsVisual Studio 2010Projects\PropertiesResources.resx 123 5

我知道它指的是我的 resources.resx 文件中的代码:

I know that it is referring to code in my resources.resx file:

<resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  <data name="pix-300x300" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..pix-300x300.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
  </data>
  <data name="pix2" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..pix2.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
  </data>
  <data name="pix4" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..pix4.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
  </data>
  <data name="pix3" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..pix3.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
  </data>

既然我的框架是 3.5,我该如何纠正这个问题?

How would i correct this now that my framework is 3.5?

推荐答案

您可以尝试通过右键单击 .resx 文件并从上下文菜单中选择运行自定义工具"来重新生成文件.

You can try regenerating the file by right-clicking the .resx file and choosing 'Run Custom Tool' from the context menu.

在执行此操作之前,更改访问修饰符或添加新值以强制重新生成.

before you do this, change the Access Modifier or add a new value to force a regeneration.

另一个参见 降级从 .net 4.0 到 3.5 的应用程序 另一种可能性

Another edit: See Downgrade an application from .net 4.0 to 3.5 for another possibility

这篇关于c#更改框架错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆