随着Vista 发布日期的临近,Windows Mobile开发者已经开始尝试在Vista上用Visual Studio编写移动应用。
虽然微软已经在Vista中集成了.NET CF 2.0, 但许多开发者仍需要维护基于原来.NET CF 1.0版本的应用程序。如何解决.NET CF 1.0 在Vista上的兼容性问题,微软MED部门项目经理MelSam给出了解决的方法。
- In Visual Studio, click File > New Project.
- Under Visual C# or Visual Basic, select Smart Device and then the appropriate platform (e.g. Windows Mobile 5.0 Pocket PC, Windows Mobile 5.0 Smartphone etc).
- Under Templates, select Device Application (1.0).
- Press OK to create the new project.
- Try building the solution. You will receive an error message explaining that .NET Framework 1.1 is required to build .NET CF 1.0 applications. This may seem odd because most of us don't see a direct relationship between the desktop framework and compact framework.
- Click here to download .NET Framework 1.1. Note that .NET Framework 2.0 is already built into Windows Vista.
- When you try to install it, a warning tells you that this product is incompatible with Vista. The warning also mentions installing SP1. We'll do that next. Proceed with the install.
- After .NET Framework 1.1 is successfully installed, click here to download SP1. When installing this, you'll again see a similar compatibility warning. Ignore the warning and proceed to finish installing the Service Pack.
- Now that you have .NET Framework 1.1 and SP1 installed, you meet the requirements for targeting .NET CF 1.0. Switch back to your project in Visual Studio and build. It should compile, build and deploy without any further errors.