I created a test library
public class Test { public int Add(int val1, int val2) { return val1 + val2; } }
And the project for calling it:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; using System.IO; namespace Loader { class Program { static void Main(string[] args) { String path = @"...Lib.dll";
Please help find what I did wrong? Why is my build blocked?
EDIT: with the name of the hard line:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; using System.IO; namespace Loader { class Program { static void Main(string[] args) { AppDomainSetup ads = new AppDomainSetup(); String fullPath = @"c:\users\myuser\documents\visual studio 2010\Projects\ShadowCopy\Loader\bin\Debug\Lib.dll"; ads.ShadowCopyFiles = "true"; ads.ApplicationName = "AppName"; ads.ShadowCopyDirectories = Path.GetDirectoryName(fullPath);
Interestingly, the cached assebly is also blocked.
EDIT 2:
Here is a line of code to lock the assembly
Console.WriteLine(obj.Add(1, 7));
So, as soon as the method in Lib.Test is available, assenbly will be blocked.
What could be the solution?
source share