Department of InformatiX
Microsoft .NET Micro Framework Tools & Resources

Update Februrary 2014: The following instructions are valid for RTM version of Visual Studio and QFE1 version of .NET Micro Framework as well.

Some people won't install anything that was just released, or even wait for a service pack release before considering using the product. Others on the other hand literally live on betas or even earlier previews of products, often they are ready to reinstall anytime and paradoxically prefer very clean environment, which is kind of opposite to side-by-side versioning. Luckily I belong to the latter group, and we are again entering the magic season where Windows, Visual Studio, hopefully soon followed by SQL Server and Office, are all available as previews and for free. So I eventually ended up with Visual Studio 2013 Preview and no .NET Micro Framework support...

Since .NET Micro Framework releases support one version of Visual Studio only, there is no way for Microsoft to switch to the new Visual Studio until it is finished. This time, however, is the .NET Micro Framework available as an open source project on CodePlex, so adding support for Visual Studio 2013 might be doable by anyone.

Switching the codebase to Visual Studio vNext

Upgrading from 2012 to 2013 is actually much easier than upgrading from 2010 to 2012. The planned editions are the same ones, and no code changes are necessary. Also the SDK changes between 4.2 and 4.3 were sparse, so doing a diff on these two codebases points us to the steps we need to take — and anything unrelated can be ignored (e.g. managed assemblies, porting kit, tests etc.). These are the files that need to be changed:

Framework
CorDebug
WixVSVersionSpecific.wxs1,2
IDE\Targets
v3.0
WixTargetsRegInclude.wxs2,5
v3.0
WixTargetsRegInclude.wxs2,5
v4.0
WixTargetsRegInclude.wxs2,5
v4.1
WixTargetsRegInclude.wxs2,5
v4.2
WixTargetsRegInclude.wxs2,5
v4.3
WixTargetsRegInclude.wxs2,5
Product\AllSDK
ItemTemplates
CSharp
AssemblyInfo
AssemblyInfo.wxs1
Class
Class.wxs1
VisualBasic\Class
Class.wxs1
ProjectTemplates
CSharp
EmulatorTemplate
Template.wxs1
ExeTemplate
Template.wxs1
LibTemplate
Template.wxs1
WinTemplate
Template.wxs1
VB
EmulatorTemplate
Template.wxs1
ExeTemplate
Template.wxs1
LibTemplate
Template.wxs1
WinTemplate
Template.wxs1
setup
Features
Debugger.wxs1,3,5
Include
vs_skus
VisualStudio12.wxs [add]4
WDExpress12.wxs [add]4
common.wxs1
devenv_setup.wxs4
prereq.wxs5
ProductSDK
Product.wxs1,5,6
1 Replace VS110 with VS120 and WDE110 with WDE120.
2 Replace VisualStudio11.wxs with VisualStudio12.wxs and WDExpress11.wxs with WDExpress12.wxs.
3 Replace CorDebugVS110 with CorDebugVS120 and CorDebugWDExpress110 with CorDebugWDExpress120.
4 Replace 11.0 in paths with 12.0.
5 (optional) Update comments and strings with the new Visual Studio version.
6 Replace the ProdCode and ProgUpgradeCode GUIDs at the beginning of the file with new ones, eg. A97A55C6-88AA-4903-B755-B44B4B4B012A and 9FC41E56-8AAD-41A0-99D1-CFF0B6E534E6.

If Visual Studio 2013 is the only Visual Studio you have installed, you may want to modify the setenv_base.cmd so that it supports it. Find the two places where VS110COMNTOOLS variable is used and add similar code for VS120COMNTOOLS. Alternatively, just extract this archive (ZIP, 26 kB) over %SPOCLIENT%, i.e. E:\src\client_v4_3 or wherever you downloaded the code to.

Compiling the SDK

The codebase does not allow for compiling the SDK straight out of the box, as documented on CodePlex. Prerequisities are Visual Studio and its SDK, any contemporary version should do. The WiX toolset and other tools are not needed, the required binaries are part of the codebase. Native compiler (other than C++ in Visual Studio) is not needed. Please note the steps below are for compiling the SDK only, you will not be able to compile PK this way, or run the tests.

  1. Download the .NET Micro Framework codebase from CodePlex. If you are using source control, make sure you not only get the branch you want to compile (likely client_v4_3), but also the bin and tools folders from the root. I will refer to the client_v4_3 folder as %SPOCLIENT%.
  2. Download and install the Porting Kit 4.3 (RTM) -- Legacy Crypto Pack from CodePlex downloads (this is not in the codebase). You do not need the porting kit itself. This will create bunch of folders with lib files, by default at C:\MicroFramework_v4_3\crypto\lib. Take these folders and move them to %SPOCLIENT%\crypto\lib.
  3. Open the %SPOCLIENT%\setenv_base.cmd in your favorite text editor and delete (or comment) the set PORT_BUILD= line at the very beginning. If you used the archive above, this is already done.
  4. Open the command prompt and navigate to the %SPOCLIENT% directory. Developer command prompt is not needed. Administrator privileges are not needed.
  5. Execute setenv_vs.cmd 12 to prepare the environment variables for the build. If you are using older Visual Studio, use appropriate version number (eg. 11 for 2012).
  6. Execute msbuild /p:flavor=release sdk.dirproj to build and take some rest. My clean build took almost half an hour. I got 310 warnings, no errors.
  7. You will find your installer in %SPOCLIENT%\BuildOutput\public\Release\Server\msm\MicroFrameworkSDK.MSI. Congratulations!

The installer should enable .NET Micro Framework 4.3 (and older versions) in Visual Studio 2013 only. Although you will see the project templates in the express version as well, it will not work in the express, because only packages signed by Microsoft are allowed to be loaded there. Existing Visual Studio and .NET Micro Framework installations should not be affected. Make sure you uninstall your home made SDK before installing the official Microsoft release for Visual Studio 2013.

Comments
Sign in using Live ID to be able to post comments.