문제

I have TeamCity running MSBuild task for an ASP.NET MVC 3 application. Now every now and then (seemingly randomly) it throws "ASPNETCOMPILER : error ASPRUNTIME: The application domain in which the thread was running has been unloaded.". It happens when MSBuild executes "MvcBuildViews" and runs aspnet_compiler.exe.

Now I know there is an "-errorstack" switch for aspnet_compiler.exe (http://msdn.microsoft.com/en-us/library/ms229863(vs.80).aspx) that can give me stack trace information about this error, but it seems that AspNetCompiler Task does not expose possibility to set this attribute (http://msdn.microsoft.com/en-us/library/ms164291.aspx).

So my question is - is there a way to pass any custom attribute to existing MSBuild Task or I have to run aspnet_compiler.exe manually outside MSBuild to enable -errorstack feature ?

도움이 되었습니까?

해결책

We had found a reason for this error (but not really how to add a custom attributes to MSBuild Tasks). It seems that this exception is happening when build servers are running low on memory.

다른 팁

You can achieve this by using the Exec MSBuild task in your csproj file. For example the original task:

<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />

becomes:

<Exec Command="$(MSBuildFrameworkToolsPath)\aspnet_compiler.exe -v temp -errorstack -p $(WebProjectOutputDir)" />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top