无法将多个项目的目标框架从 v4.0 更改为 V4.5 或 4.5.1 [英] Cannot change Target Framework on Several Projects From v4.0 to V4.5 or 4.5.1

查看:19
本文介绍了无法将多个项目的目标框架从 v4.0 更改为 V4.5 或 4.5.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个大型解决方案中有几个项目,它们不会转换为 V4.5.1(甚至 V4.5).大多数人都这样做了,但显然我需要让所有人都转换.Visual Studio 中的 GUI 说它执行了并重新加载了项目,但是如果您返回属性,它仍然显示 V4,并且由于正确转换且为 V4.5.1 的依赖项而无法编译

I have several projects in a large solution that won't convert to V4.5.1 (or even V4.5). Most did, but obviously I need to get all of them converted. The GUI in Visual Studio says that it did it and reloads the project, but if you go back into the properties it still says V4 and it won't compile because of dependencies that converted properly and are V4.5.1

我尝试手动更新 .csproj 文件,它说 4.5.1 作为目标框架,我什至更新了 app.config/web.config 以指向正确的版本,但是 Visual Studio 的属性页仍然说 .NET4 并抛出编译错误,因为它无法访问成功更新到 4.5.1 的那些

I tried manually updating the .csproj files and it says 4.5.1 as the target framework, and I even updated the app.config/web.config to point to the right version, however Visual Studio's property page still says .NET 4 and is throwing compile errors because it can't access the ones that successfully updated to 4.5.1

我在更新这些的过程中缺少什么?我已经尝试过 VS.net 2012 和 2013,两者都做同样的事情.

What am I missing in the process to get these updated? I've tried VS.net 2012 and 2013 and both do the same thing.

推荐答案

希望对他人有所帮助:

在我们的案例中,问题在于我们引用了为整个解决方案创建的自定义目标文件.即使项目正在更新,自定义目标文件也会覆盖它,从而阻止项目更新.

In our case, the issue was that we were referencing a custom targets file that was created for the entire solution. even though the project was getting updated, the custom targets file was overriding it thus preventing the project from getting updated.

将目标文件更新为指向 .net 4.5,一切正常.

Updated the targets file to point to .net 4.5 and everything was fine.

这篇关于无法将多个项目的目标框架从 v4.0 更改为 V4.5 或 4.5.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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