Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error6 while trying to use sublime text to msbuild

I'm trying to use msbuild with my sublime project. I created the build file suggested here and the following is my project file

{
    "folders":
    [
        {
            "path": "/W/MyOrg/MyApp",
                        "folder_exclude_patterns": ["_ReSharper.*", "bin", "obj"]
        }
    ]
}

I select the msbuild40 build system and hit Build and get the output:

[Error 6] The handle is invalid
[Finished]

I'm not even sure if this is a python or an msbuild error. Which is it, how can I fix it, and whats a good way to troubleshoot this sort of stuff in the future?

Update

I tried updating my project to the following and using that build and still no dice

{
    "folders":
    [
        {
            "path": "/W/MyOrg/MyApp",
            "folder_exclude_patterns": ["_ReSharper.*", "bin", "obj"]
        }
    ],
    "build_systems":
    [
        {
            "name": "msbuild",
            "cmd": ["c:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe", "w:\\MyOrg\\MyApp\\MyApp.sln"]
        }
    ]
}
like image 357
George Mauer Avatar asked May 03 '12 20:05

George Mauer


1 Answers

Turns out that this happens whenever you start sublime from command line ( I was starting it via a powershell alias).

You can fix this by using a batch file and the START command. I created sublime_text.bat:

START "Sublime Text 2"  "C:\Program Files\Sublime Text 2\sublime_text.exe" %*

and set my powershell alias to that bat file. Now everything works.

like image 105
George Mauer Avatar answered Oct 16 '22 08:10

George Mauer