I'm trying to load the build, which is in the project debug folder
var asm = Assembly.Load(File.ReadAllBytes(path)); gives out
System.UnauthorizedAccessException
How can I download the assembly from this folder?
I'm trying to load the build, which is in the project debug folder
var asm = Assembly.Load(File.ReadAllBytes(path)); gives out
System.UnauthorizedAccessException
How can I download the assembly from this folder?
var path = Path.Combine(relPath, partialName); FileSecurity fSecurity = File.GetAccessControl(path); var account = Environment.UserDomainName + "\\" + Environment.UserName; fSecurity.AddAccessRule(new FileSystemAccessRule(account, FileSystemRights.ReadAndExecute, AccessControlType.Allow)); var asm = Assembly.Load(File.ReadAllBytes(path)); Sorry, overlooked the path to the file as the path to the directory, and to unlock the file, this code is suitable
Source: https://ru.stackoverflow.com/questions/597121/
All Articles