c#更改框架错误

c# change framework error(c#更改框架错误)
本文介绍了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#更改框架错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)