简体   繁体   English

将项目从紧凑框架.NET转换为完整框架.Net

[英]Convert projects from compact framework .NET to the full framework .Net

So I have a big c# solution containing 120 projects. 所以我有一个包含120个项目的大型c#解决方案。 The solution doesn't contain a user interface and is compiled to support both compact framework and the full framework. 该解决方案不包含用户界面,并且经过编译以支持紧凑框架和完整框架。 The solution is in Visual Studio 2005 format. 解决方案是Visual Studio 2005格式。

I would like to remove the support for Windows CE and convert it all to target the full framework and open it in Visual Studio 2010. 我想删除对Windows CE的支持并将其全部转换为目标完整框架并在Visual Studio 2010中打开它。

What I want to do is remove the support for compact framework from the whole solution. 我想要做的是从整个解决方案中删除对紧凑框架的支持。

How should I proceed? 我该怎么办? Is it possible to just convert the projects to the full framework? 是否可以将项目转换为完整框架?

Thank you. 谢谢。

I created a dummy solution containing a WinForms project and a Device WinForms project. 我创建了一个包含WinForms项目和Device WinForms项目的虚拟解决方案。 Then I compared to two. 然后我比较两个。 Useful for me as I'm hoping to port to Windows 10 at some point now they've got it running on ARM devices :D 对我有用,因为我希望在某些时候移植到Windows 10,现在它们已经在ARM设备上运行了:D

1) Remove the "ProjectTypeGuids", "PlatformFamilyName", "PlatformID", "OSVersion", "DeployDirSuffix", "NativePlatformName", "NoStdLib", "NoConfig" elements. 1)删除“ProjectTypeGuids”,“PlatformFamilyName”,“PlatformID”,“OSVersion”,“DeployDirSuffix”,“NativePlatformName”,“NoStdLib”,“NoConfig”元素。

2) Remove references to "$(PlatformFamilyName)". 2)删除对“$(PlatformFamilyName)”的引用。

3) Remove any "RequiredTargetFramework" elements. 3)删除任何“RequiredTargetFramework”元素。

4) If it exists, the line containing:- 4)如果存在,该行包含: -

..Import Project="$(MSBuildBinPath)\\Microsoft.CompactFramework.CSharp.targets".. ..Import Project =“$(MSBuildBinPath)\\ Microsoft.CompactFramework.CSharp.targets”..

needs to become... 需要成为......

..Import Project="$(MSBuildToolsPath)\\Microsoft.CSharp.targets".. ..Import Project =“$(MSBuildToolsPath)\\ Microsoft.CSharp.targets”..

If it doesn't exist, you need to add it in. 如果它不存在,则需要将其添加。

5) Remove the entire "ProjectExtensions" element. 5)删除整个“ProjectExtensions”元素。

et viola.. it converts... Now if only it would build :/ et viola ..它转换......现在只要它会建立:/

Edit: 编辑:

A little bit of tweaking and it built and ran OK. 一点点调整,它构建并运行正常。 After a little over an hours work my CF WinForms warehousing app is running on Windows 10. 经过一个多小时的工作后,我的CF WinForms仓储应用程序正在Windows 10上运行。

Open the solution with WS2010, click on each project file -> Properties -> Application tab, then you can select the target framework. 使用WS2010打开解决方案,单击每个项目文件 - >属性 - >应用程序选项卡,然后您可以选择目标框架。 Should work. 应该管用。

So in the end I had to edit manually every csproj file in the solution. 所以最后我必须手动编辑解决方案中的每个csproj文件。 I removed the information's related to targeting the compact framework et replaced it with the needed info to target the full framework. 我删除了与针对紧凑框架相关的信息,并将其替换为所需信息以定位完整框架。

It wasn't very fun but now it works. 这不是很有趣,但现在它的工作原理。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM