8

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"]
        }
    ]
}

1 Answer 1

12

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.

3
  • 1
    That's mighty annoying. I live in the command line so I never start ST2 (or anything else) except from the CLI. Thanks for sharing this!
    – sehe
    Dec 9, 2012 at 15:26
  • Thank you veeeeery much! This solved a problem I had with using SublimeREPL: github.com/wuub/SublimeREPL/issues/271
    – L42
    Aug 3, 2015 at 9:42
  • Unfortunately this doesn't seem to work with ST3's subl.exe. I could only get it to work with sublime_text.exe. :( Jan 27, 2016 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.