Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executing MSBuild task from inside of Visual Studio locks a DLL #4

Open
rvukovic opened this issue Apr 11, 2011 · 0 comments
Open

Executing MSBuild task from inside of Visual Studio locks a DLL #4

rvukovic opened this issue Apr 11, 2011 · 0 comments

Comments

@rvukovic
Copy link

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 :(

eliog pushed a commit to eliog/Migrator.NET that referenced this issue Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant