MonoDevelop 2.6 Beta 1 (2.5.90) 在 Csproj 文件中针对 .NET 1.0 Framework?
谁能告诉我为什么当我在最新版本的 MonoDevelop 中创建 Monotouch 项目时,它的目标是 1.0 框架而不是像我早期版本中的项目那样?这导致它无法在 VS2010 中加载,而我在 MonoDevelop 中构建/测试时倾向于使用 VS2010 进行编码。这是版本信息:
Release ID: 20509002
Git revision: 35a0397615c02f7830d46dfcd31a6c0cb86e9f85
Build date: 2011-04-06 03:37:58+0000
这是版本之间 csproj 文件的差异:
旧:
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
新:
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
Can anyone tell me why when I create Monotouch projects in the latest drop of MonoDevelop it is targeting the 1.0 framework instead of 3.5, as my projects in earlier versions do? This causes it to not be loadable in VS2010, which I tend to use for coding, while building/testing in MonoDevelop. Here is the version info:
Release ID: 20509002
Git revision: 35a0397615c02f7830d46dfcd31a6c0cb86e9f85
Build date: 2011-04-06 03:37:58+0000
And here is the difference in the csproj files between versions:
Old:
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
New:
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
v3.5 是一个错误; MonoTouch 项目从未针对 .NET v3.5 框架。他们的目标是 MonoTouch 框架,该框架任意版本为 v1.0。
MD 2.6 中的改进使我们能够以与 VS 2010 类似的方式处理自定义 .NET 框架。这意味着我们不是存储“最接近”的 .NET 框架,然后在项目加载后在内部将其切换到正确的框架,而是可以使用特定的自定义框架直接处理特定的项目类型。
如果您想在 VS 中加载 MT 项目,则必须对项目进行更改 - 暂时删除项目风格 GUID(尽管一个简单的 VS 插件可能会不必要)。此框架版本修复意味着您还必须将目标框架更改为 VS 具有的框架。对于 MonoTouch 4,我建议使用 Silverlight 4 或 .NET 4,而不是使用 .NET 3.5。
最好的解决方案是将 VS 设置为实际使用 MonoTouch 框架,这样您就可以获得准确的代码完成和编译。在 VS 2010 中这现在成为可能。只需将项目的 TargetFrameworkIdentifier 设置为“MonoTouch”,然后通过将所有 MonoTouch 框架程序集复制到
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0< 来安装自定义框架/code> 并在 RedistList 子目录中添加 FrameworkList.xml 清单。
The v3.5 was a bug; MonoTouch projects never targeted the .NET v3.5 framework. They target the MonoTouch framework, which is arbitrarily versioned as v1.0.
Improvements in MD 2.6 have allowed us to deal with custom .NET frameworks in a similar way to VS 2010. This means that instead of storing the "closest" .NET framework then internally switching it to the correct framework after the project is loaded, we can directly handle particular project types using a particular custom framework.
If you want to load MT project in VS, you already have to make changes to the project - temporarily remove the project flavor GUID (though a trivial VS addin could make that unnecessary). This framework version fix means that you also have to change the target framework to one that VS has. For MonoTouch 4, rather than using .NET 3.5, I would recommend using either Silverlight 4 or .NET 4.
The best solution would be to set VS to actually use the MonoTouch framework, so you'd get accurate code completion and compilation. In VS 2010 that's now possible. Simply set the TargetFrameworkIdentifier of the project to "MonoTouch", then install the custom framework by copying all the MonoTouch framework assemblies to
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoTouch\v1.0
and adding a FrameworkList.xml manifest in the RedistList subdirectory.我创建了一个小型开源项目,使您能够在 Visual Studio 2010 中构建 MonoTouch 项目。该项目的自述文件还解释了如何解决目标框架版本的“v1.0”问题。
该项目位于 https://github.com/follesoe/VMonoTouch。
I've created a small open source project that enables you to build MonoTouch projects inside Visual Studio 2010. The readme for the project also explains how to get round the "v1.0" problem for the target framework version.
The project is available at https://github.com/follesoe/VSMonoTouch.
由于这是一个 Monotouch 项目,因此没有人期望它适用于 Visual Studio 或 Windows。
Since that's a Monotouch project, nobody expects it to work for Visual Studio or Windows.