ASPRUNTIME: The application domain in which the thread was running has been unloaded.
Asked Answered
N

4

6

We're running Jekins which kicks off a gulp build process. As part of the gulp build process we trigger an msbuild task.

Every second build fails with the message:

ASPNETCOMPILER : error ASPRUNTIME: The application domain in which the thread was running has been unloaded.

This happens exactly every other build no matter the time span between builds. (i.e. Builds, Fails, Builds, Fails).

Any ideas on what might be causing this and why it happens only every other build?

Nernst answered 22/4, 2015 at 11:1 Comment(0)
N
5

We solved this problem by allocating more memory to the build machine.

Nernst answered 14/5, 2015 at 17:35 Comment(1)
Thanks to this answer i tried to close unnecessary applications and it fixed the problem.Alterant
D
11

I also had this problem on a machine with enough memory. Turns out the problem was due to the target folder being Compressed using NTFS compression.

Once compression was disabled it started working without problems.

I saw that this could be a problem here.

Dipterocarpaceous answered 8/8, 2016 at 14:46 Comment(1)
Had the same problem. (Jenkins and via cmd.exe.) Interestingly it worked if I called aspnet_compiler.exe (via cmd.exe) directly the same way as MSBuild does. But if run via MSBuild it failed. Otherwise not. Go figure! Somehow related: Never ever compress stuff where MS SQL Server stores it's database files.Pansie
N
5

We solved this problem by allocating more memory to the build machine.

Nernst answered 14/5, 2015 at 17:35 Comment(1)
Thanks to this answer i tried to close unnecessary applications and it fixed the problem.Alterant
Z
1

A little late to the party but for googlers: I had a similar problem when doing a build in visual studio. Turns out Dropbox was locking the compiled dlls. Once I'd excluded the bin directories (did obj directories too for good measure) the problem went away. This may also be the case for antivirus/antimalware programs too.

Zootomy answered 30/8, 2017 at 11:29 Comment(1)
This is still a problem; literally just ran into this same thing via VS2019 (on 2020.11.22).Albinaalbinism
I
0

The same error in my case was fixed by disabling memory compression.

I ran in elevated power shell

Disable-MMAgent -mc 

and reboot

(Can be re enabled by Enable-MMAgent -mc)

Indefinite answered 5/8, 2021 at 3:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.