c# - MSBuild assembly lock -
i have custom msbuild task(resides in assembly a) build custom project type(let's call 'testappcontent'). 'a' references assembly 'b' under development.
to test 'b', use test program, testapp. testapp depends on testappcontent getting build using our custom task.
the problem after task loaded, 'b' assembly locked msbuild or visualstudio process assembly contains task('a') has reference it.
as can't 'unload' assembly , using separated appdomain doesn't work, how can stop lock?
i know microsoft xna can can supply custom assemblies build process , released after can rebuilt custom assemblies.
the way use appdomain , activate shadow copy on it. don't think can activate shadow copy on current appdomain, can try (see question here)
or can manually copy dll elsewhere , load (programmatically) original dll not loaded , remain unlocked. can't load same dll twice... you'll need separate appdomain if want unload , load new version (or restart program)
edit: can use appdomain.currentdomain.assemblyresolve intercept when program try load dll. there can copy elsewhere , load copy.
Comments
Post a Comment