SharpDevelop RT Edition (beta) – Code Windows Forms Directly On Windows RT

Playing with my Microsoft Surface RT I was itching to do some coding on it. So I have started porting SharpDevelop so that it will run on Windows RT.

A few notes:

  • This is unsupported by Microsoft method, your device must be “unlocked” to allow running 3rd party Desktop apps
  • I had to go back to SharpDevelop 3.2 as it was last version without WPF based GUI (Windows RT doesn’t support WPF)
  • So far I only tested C# Windows Forms GUI design & compile + C# Console. C# ASP.NET compiles but you’ll need to deploy manually to a web server. VB.NET currently doesn’t work.
  • Debugging does not work, you must run compiled EXE outside debugger currently
  • Ensure target framework is .NET 4.0 and platform is Any CPU (not x86/x64)
  • I removed SVN support, WPF templates
  • I migrated projects to .NET 4.5 framework and changed the build platform from x86 to Any CPU
  • You need to copy from full Windows machine with .NET 4 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.Targets onto Windows RT. Possibly other files in this folder too. I copied the entire C:\Windows\Microsoft.NET\Framework\v4.0.30319 from my Win8 machine with VS2012 & Windows SDK installed but did not overwrite any existing files in the directory on Windows RT device, if you do you’ll trash your .NET. I chose “skip” for duplicate files. Recommend make backup of dir on Windows RT before modification.
  • You will need to copy from existing Windows development machine with Visual Studio 2012 installed – C:\Program Files\Reference Assemblies on 32-bit machine or C:\Program Files (x86)\Reference Assemblies to your Windows RT devices. You should have structure like this:

  • I also had to take these two DLLs from an existing Windows 8 machine and copy to these locations

xcopy system.xml.linq.dll C:\windows\assembly\GAC_MSIL\System.Xml.Linq\\

xcopy C:\windows\assembly\GAC_MSIL\System.Data.DataSetExtensions\\

  • It is possible you may need to copy other DLLs from a Windows 8 machine, the name of missing DLL should be displayed when running EXE

Once above is accomplished you can do the following:

  1. Download and Extract
  2. Run bin\SharpDevelop.exe
  3. Click File | New Solution
  4. Select Windows Application
  5. Give it name Hello World, click Create
  6. Select MainForm.cs tab, then select Design
  7. Click View | Tools
  8. Expand Windows Forms, drag label onto Form
  9. Right click label properties, change text to Hello, Worl

  10. Click Build | Edit Configuration/Platform
  11. In Platform click x86 and Edit

  1. Add anycpu then select it click OK
  2. Select platform Any CPU again. Should look like this:

  1. Hit the red exclamation mark to run program (next to green play button) or hit Ctrl+FN+Search Button

Vs201 project Source code and binary here:!270&authkey=!AI0vFrK_EVY53hI

original project here:

About chentiangemalc

specializes in end-user computing technologies. disclaimer 1) use at your own risk. test any solution in your environment. if you do not understand the impact/consequences of what you're doing please stop, and ask advice from somebody who does. 2) views are my own at the time of posting and do not necessarily represent my current view or the view of my employer and family members/relatives. 3) over the years Microsoft/Citrix/VMWare have given me a few free shirts, pens, paper notebooks/etc. despite these gifts i will try to remain unbiased.
This entry was posted in Uncategorized. Bookmark the permalink.

22 Responses to SharpDevelop RT Edition (beta) – Code Windows Forms Directly On Windows RT

  1. for this specific error you just need to copy the Microsoft.CSharp.Targets file though (I think installed by visual studio)

  2. Austin says:

    Took another look at it tonight and it worked with your appended instructions, thanks! I figured that was the issue but I had no idea where to get the mentioned files.

    Also, for anyone that cares, I grabbed the files from a Win 7 edition of VS2012 and so far it works fine!

  3. mspbkhn says:

    when I compiled, I got this error:
    Parameter “SearchPaths” has invalid value “{CandidateAssemblyFiles}%3b
    bin\Debug\System.winmd”. Illegal characters in path. (MSB3248)

    • There is invalid characters in SearchPaths. MSBuild obtains this path from the following locations:

      (1) Files from current project – indicated by {CandidateAssemblyFiles}
      (2) $(ReferencePath) – the reference path property, which comes from the .USER file.
      (3) The hintpath from the referenced item itself, indicated by {HintPathFromItem}.
      (4) The directory of MSBuild’s “target” runtime from GetFrameworkPath.
      The “target” runtime folder is the folder of the runtime that MSBuild is a part of.
      (5) Registered assembly folders, indicated by {Registry:*,*,*}
      (6) Legacy registered assembly folders, indicated by {AssemblyFolders}
      (7) Resolve to the GAC.
      (8) Treat the reference’s Include as if it were a real file name.
      (9) Look in the application’s output folder (like bin\debug)

      Option (2) would be most likely cause. I haven’t see this issue myself, but this problem with msbuild.exe is also known to occur on full Windows with Visual Studio, so you might look for other solutions people have found for this problem out on the internet, they may have more details.

    • Grancapi says:

      The problem is SharpDevelop and the target files in v4.0.30319 are not fully compatible.
      The simplest fix is to just add:

      v4.0 C:\Windows\Microsoft.NET\Framework\v4.0.30319

      to your project, in the PropertyGroup section.

      • Grancapi says:

        Correction (copy paste missed some tags)


  4. Nhan Phan says:

    I got this error:

    SharpDevelop Version :
    .NET Version : 4.0.30319.18033
    OS Version : Microsoft Windows NT 6.2.9200.0
    Current culture : Vietnamese (Vietnam) (vi-VN)
    Current UI language : en-US
    Working Set Memory : 34356kb
    GC Heap Memory : 2316kb

    Unhandled exception terminated SharpDevelop
    Exception thrown:
    System.NullReferenceException: Object reference not set to an instance of an object.
    at ICSharpCode.Core.WinForms.ToolBarComboBox..ctor(Codon codon, Object caller) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.Core.WinForms\ToolBar\ToolBarComboBox.cs:line 52
    at ICSharpCode.Core.WinForms.ToolbarService.CreateToolbarItemFromDescriptor(ToolbarItemDescriptor descriptor) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.Core.WinForms\ToolBar\ToolBarService.cs:line 55
    at ICSharpCode.Core.WinForms.ToolbarService.CreateToolStripItems(Object owner, AddInTreeNode treeNode) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.Core.WinForms\ToolBar\ToolBarService.cs:line 27
    at ICSharpCode.Core.WinForms.ToolbarService.CreateToolStrip(Object owner, AddInTreeNode treeNode) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.Core.WinForms\ToolBar\ToolBarService.cs:line 74
    at ICSharpCode.Core.WinForms.ToolbarService.CreateToolbars(Object owner, String addInTreePath) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.Core.WinForms\ToolBar\ToolBarService.cs:line 111
    at ICSharpCode.SharpDevelop.Gui.DefaultWorkbench.CreateToolBars() in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\Base\Project\Src\Gui\Workbench\DefaultWorkbench.cs:line 681
    at ICSharpCode.SharpDevelop.Gui.DefaultWorkbench.Initialize() in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\Base\Project\Src\Gui\Workbench\DefaultWorkbench.cs:line 288
    at ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.InitializeWorkbench(IWorkbench workbench, IWorkbenchLayout layout) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\Base\Project\Src\Gui\WorkbenchSingleton.cs:line 107
    at ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.InitializeWorkbench() in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\Base\Project\Src\Gui\WorkbenchSingleton.cs:line 90
    at ICSharpCode.SharpDevelop.Sda.CallHelper.RunWorkbenchInternal(Object settings) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.SharpDevelop.Sda\Src\CallHelper.cs:line 122
    at ICSharpCode.SharpDevelop.Sda.CallHelper.RunWorkbench(WorkbenchSettings settings) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.SharpDevelop.Sda\Src\CallHelper.cs:line 112
    at ICSharpCode.SharpDevelop.Sda.SharpDevelopHost.RunWorkbench(WorkbenchSettings settings) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.SharpDevelop.Sda\Src\SharpDevelopHost.cs:line 117
    at ICSharpCode.SharpDevelop.SharpDevelopMain.RunApplication() in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\StartUp\Project\SharpDevelopMain.cs:line 182
    at ICSharpCode.SharpDevelop.SharpDevelopMain.Run(String[] args) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\StartUp\Project\SharpDevelopMain.cs:line 97
    at ICSharpCode.SharpDevelop.SharpDevelopMain.Main(String[] args) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\StartUp\Project\SharpDevelopMain.cs:line 49

    —- Recent log messages:
    Failed to append recent log messages.
    System.InvalidOperationException: Sequence contains no elements
    at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
    at ICSharpCode.SharpDevelop.Sda.LogMessageRecorder.AppendRecentLogMessages(StringBuilder sb, ILog log) in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.SharpDevelop.Sda\Src\LogMessageRecorder.cs:line 109
    at ICSharpCode.SharpDevelop.Sda.ExceptionBox.getClipboardString() in c:\Users\mccafferym\Downloads\SharpDevelop_3.2.1.6466_Source\src\Main\ICSharpCode.SharpDevelop.Sda\Src\ExceptionBox.cs:line 138

    —- Post-error application state information:
    Installed 3rd party AddIns:

  5. Hans Martin says:

    I followed the instruction, but when I try to run Sharp Develop it says, that SearchAndReplace.dll or a dependency of it was not found.

  6. Zhang Tianyi says:

    I’m very exiting for I can develop on my surface rt.So,how di you port the #Develop to the arm?VS2012 is inpossible I think.#develop of course can not.So what tool did you use to port the PC app to the WIndows RT?So,Can you port the vbc.exe to windows RT?With this exe you can use # Develop to write program.I would like to ask, whether the arm version of the vbc.exe or whether to write?I need it! Because I usually need to use VB.NET programming.So,what tool did you use to port PC app to the Windows RT?And do you have a vbc.exe in arm edition?

  7. Zhang Tianyi says:

    I’ve got 2 questions:
    1.Why the doesn’t work?Because the vbc.exe doesn’t work?So can you port vbc.exe to windows rt?I really need to write!
    2.How did you port the #develop from pc to arm?How to?What tool did you use?

    • 1. Can’t port vbc.exe no source code and not included in RT. If it was pure .NET this wouldn’t be issue
      2. To port it I used Visual Studio 2012 and switched all projects to compile,under “any CPU” and .net 4.5. I didn’t change any code. I removed any native (non .net) plugins

      The easiest option is to switch to C# or use auto convert tools to convert your to c#. Or remote connect to full windows machine with visual studio, set your .net project to 4.5 and any CPU, then your project will run on Windows RT (jail break devices)

  8. DealExtreme2 says:

    Hi there! I just wanted to say: fantastic! It works really, really well! This is like makeing the RT worth 10 times more! Whoohoooo :)

  9. G S Pandian says:

    files has invalid value… show that error in my projects… i need help

  10. I’m late getting to the show here, but I wanted to thank you so much for this encouraging URL. I hope to learn enough to have some fun with my Surface RTs. Previously had only found the csc.exe on my Surface and failed “Hello world” type test for missing DLLs, and at Git someone suggested commenting out missing DLLs to get it to work. This is great!! It would be nice if Microsoft would increase product life cycle for RT.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s