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"]
        }
    ]
}
Community
  • 1
  • 1
George Mauer
  • 117,483
  • 131
  • 382
  • 612

1 Answers1

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.

George Mauer
  • 117,483
  • 131
  • 382
  • 612
  • 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 09 '12 at 15:26
  • Thank you veeeeery much! This solved a problem I had with using SublimeREPL: https://github.com/wuub/SublimeREPL/issues/271 – L42 Aug 03 '15 at 09:42
  • Unfortunately this doesn't seem to work with ST3's subl.exe. I could only get it to work with sublime_text.exe. :( – Andreas Haferburg Jan 27 '16 at 09:36