使用 VS2010 构建 Compact Framework 应用程序(无需 VS2005)
我想使用 VS2010 执行 .NET CF 2.0 构建。我知道“正常”不支持它,但我看到了这个答案:( .NET Compact Framework 与 Visual Studio 2010?)...我想使用这种方法。
那里引用的 博客文章 说我需要修改 .csproj 文件对于 .NET CF 项目,指向特定的 Microsoft.CompactFramework.Common.targets 。但我没有那个文件。
我想我需要安装 Windows Mobile 6 标准 SDK 获取它。
我尝试安装它并得到这个:
我看到了这个问题:
Windows Mobile 6 标准 SDK 刷新Visual Studio 2010 Professional Beta 2 上的安装问题
我认为那里提出的解决方案对我来说不可行。我没有VS2008。我没有VS2005。我只有 VS2010,并且没有其他产品的可安装介质。
我还尝试了管理安装(msiexec /a
),但生成的目录结构不包含任何类似 Microsoft.CompactFramework.Common.targets 的文件。?
第一季度: 有没有办法安装 WM6 标准 SDK?
问题2:有人知道它要查找的注册表项以确定我是否有适当的先决条件吗? 如果我只是摆弄我的注册表,这会起作用吗?
Q3:我的假设是错误的吗?我真的想要 Microsoft.CompactFramework.Common.targets 文件及其朋友。我在哪里可以得到这个? (我没有现有的 VS2008 机器可供使用)
Q4:我能想到的另一种方法是获取 VS2008 的评估版本,将其安装到虚拟机中,然后在那里安装 WM6 Std SDK,然后抓取Microsoft.CompactFramework.Common.targets 文件。绕了很远的路。这会起作用吗?值得这么麻烦吗?
答案
这是答案。
可以使用 VS2010 构建 CF 应用程序,如Joel Fjorden 的博客文章<中所述< /a>.为了实现这一点,您需要先决条件。
我相信获取所需文件的唯一官方方法,包括 Microsoft.CompactFramework.Common.targets 、 Microsoft.CompactFramework.CSharp.targets 、 Microsoft.CompactFramework.VisualBasic.targets 和 Microsoft.CompactFramework.Build。 Tasks.dll ,用于安装Visual Studio的相关版本。这些文件都是特定于版本的,因此要获取用于构建 .NET CF 2.0 的文件,您需要安装 VS2005,而对于 .NET CF 3.5,您需要安装 VS2008。安装 VS2010 不会给你带来任何好处。它可以使用该工具的评估版本。无论如何,它对我有用。
如果您愿意自定义,您可以简单地将这些文件从 VS2005 或 VS2008(或两者)的工作安装复制到相应的 .NET 目录中,通常类似于 C:\Windows\Microsoft.NET\Framework \v2.0.50727(根据需要更改版本)。 Chris Tacke 发布了一个链接,指向您需要的文件 。我不知道复制这些文件是否违反了VS20的许可? ,我不是授权专家。
据我所知,您无法从 Windows Mobile SDK 获取这些文件。即便如此,您可能仍然需要特定于版本的移动 SDK 来获取模拟器和皮肤等。
这是基本的“构建”能力。它可以工作,但不能为您提供设计人员支持、调试功能、内置项目模板等。我对任何想要在 .NET CF 上进行前向开发的人的建议是使用适合这些任务的工具 - VS2005 或 VS2008。
感谢 Chris Tacke 发布这些文件的链接。
I want to perform a .NET CF 2.0 build using VS2010. I know it's not supported "normnally," but I've seen this answer: ( .NET Compact Framework with Visual Studio 2010? ) ...and I want to use that approach.
The blog post cited there says I need to modify the .csproj files for the .NET CF projects, to point to a particular Microsoft.CompactFramework.Common.targets . But I don't have that file.
I figured I needed to install the Windows Mobile 6 Standard SDK to get it.
I tried installing it and get this:
I have seen this question:
Windows Mobile 6 Standard SDK Refresh install issue on Visual Studio 2010 Professional Beta 2
I don't think the solution proposed there is workable for me. I do not have VS2008. I do not have VS2005. I have only VS2010, and I have no installable media for those other products.
I have also tried the administrative install (msiexec /a
), but the resulting directory structure doesn't contain any files like Microsoft.CompactFramework.Common.targets .??
Q1:
Is there a way for me to install WM6 Standard SDK?
Q2: Anyone know the reg key that it looks for to determine if I have the appropriate pre-reqs?
Is this going to work if I just fiddle with my registry?
Q3: Is my assumption wrong? Really I want the Microsoft.CompactFramework.Common.targets file and its friends. Where can I get this? (I have no existing VS2008 machine to suck from)
Q4: Another approach I can think of is getting an eval version of VS2008, installing that into a VM, then installing the WM6 Std SDK there, then grabbing the Microsoft.CompactFramework.Common.targets file from that. Long way round. Is this gonna work and is it worth the trouble?
ANSWER
Here's the answer.
It is possible to build CF apps with VS2010, as outlined in Joel Fjorden's blog post. There are pre-requisites you need, in order to make this happen.
I believe the only official way to get the required files, including Microsoft.CompactFramework.Common.targets , Microsoft.CompactFramework.CSharp.targets , Microsoft.CompactFramework.VisualBasic.targets and Microsoft.CompactFramework.Build.Tasks.dll , is to install the related version of Visual Studio. These files are all version-specific, so to get the files for building for .NET CF 2.0, you need to install VS2005, and for .NET CF 3.5 you need to install VS2008. Installing VS2010 gives you neither. It works to use eval versions of the tools. It worked for me anyway.
If you are willing to go custom, you can simply copy these files from a working installation of VS2005 or VS2008 (or both), into the appropriate .NET directory, usually something like C:\Windows\Microsoft.NET\Framework\v2.0.50727
(change the version as appropriate). Chris Tacke has helpfully posted a link to the files you need. I don't know if copying these files violates the license for VS20?? , I am not a licensing expert.
You cannot get these files from the Windows Mobile SDK, as far as I can tell. Even so, you might still want a version-specific mobile SDK to get the emulators and skins and so on.
This is a basic "build" capability. It works but it doesn't give you designer support, debugging capability, built-in project templates, and so on. My advice to anyone who wants to do forward development on .NET CF is to use the tools that are geared toward those tasks - VS2005 or VS2008.
Thanks to Chris Tacke for posting a link for the files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不确定这是否有任何帮助,但是 可以在此处找到 VS2008 中的 CF 目标文件 。如果您取得任何进展,请告诉我们。
Not sure if it's any help, but the CF targets files from VS2008 can be found here. Let us know if you make any progress.
“Power Toys for .NET Compact Framework”包(当前位于 http://www.microsoft.com/en-us/download/details.aspx?id=13442)也包含所需的文件。
我想我会把它留在这里,因为它是微软官方下载的。
The "Power Toys for .NET Compact Framework" package (currently found at http://www.microsoft.com/en-us/download/details.aspx?id=13442) also contains the required files.
Thought I'd leave that here since it's an official Microsoft download.