You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the .csproj is modified so that it calls Migrate task in the AfterBuild target the project DLL will stay locked after the first compile. The problem is that Assembly.LoadFrom locks the DLL and it can not be unloaded.
Solution for the problem is adding the attributes [LoadInSeparateAppDomain] and [Serializable] to the Migrator.MSBuild.Migrate class and inheriting from AppDomainIsolatedTask instead of the Task. TaskLogger has to be change accordingly.
[LoadInSeparateAppDomain]
[Serializable]
public class Migrate : AppDomainIsolatedTask
{
public class TaskLogger : ILogger
{
private readonly AppDomainIsolatedTask _task;
public TaskLogger(AppDomainIsolatedTask task)
{
_task = task;
}
Sorry for not using the GIT :(
The text was updated successfully, but these errors were encountered:
eliog
pushed a commit
to eliog/Migrator.NET
that referenced
this issue
Sep 16, 2019
If the .csproj is modified so that it calls Migrate task in the AfterBuild target the project DLL will stay locked after the first compile. The problem is that Assembly.LoadFrom locks the DLL and it can not be unloaded.
Solution for the problem is adding the attributes [LoadInSeparateAppDomain] and [Serializable] to the Migrator.MSBuild.Migrate class and inheriting from AppDomainIsolatedTask instead of the Task. TaskLogger has to be change accordingly.
Sorry for not using the GIT :(
The text was updated successfully, but these errors were encountered: