MSBUILD can give the following error message when compiling using a UNC path:
Error: Could not load file or assembly 'YOURASSEMBLYHERE' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)
- Required permissions cannot be acquired.
C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1892,9): error MSB6006: "sgen.exe" exited with code 1.
This occurs when MSBUILD executes sgen.exe to build the optional XmlSerializers.dll assembly.
There are at least 3 ways to work around this error:
- Don't use a UNC path when compiling.
- In the project properties Build tab, Set 'Generate serialization assembly' to Off.
- Use caspol.exe to grant full trust to the UNC path. See Running a .Net application from a network share.