Visual Studio: Regex to fix “aspnet_compiler.exe exited with code 1″ error

Some time ago I’ve got stuck with an error message in Visual Studio when tryed to compile web deployment project.

error MSB6006: “aspnet_compiler.exe” exited with code 1.

Not too informative, isn’t it?

I’ve googled on net and found that you could find more detailed error if run aspnet_compiler.exe with -errorstack directive.

In my case the root cause was missing </form> tag - as I understand it is common issue.

Here is a regular expression to find in Visual Studio solution all opened <form runat=”server” > elements that does have corresponding closing tag </form>.

<form~((n|.)+</form)

Here is settings for ‘find’ dialog in Visual Studio

A ‘Find’ dialog in Visual Studio with settings to search a missing </form> tag for “aspnet_compiler.exe exited with code 1″ error message using regular expressions.

Hope that will save you some time as people sometimes just manualy trying to find it what is realy hard with big VS solutions.

P.S. NB: that will work just if you have just 1 form per page. What is usual case for ASP.NET projects.

Leave a Reply

You must be logged in to post a comment.