red-gate / XmlDoc2CmdletDoc

Create cmdlet XML help files from XML doc comments
Other
63 stars 24 forks source link

Exception 'Could not load file or assembly...' when trying to load dll reference. #56

Open padillah opened 4 years ago

padillah commented 4 years ago

This was via command line because the .targets file command got a different error.

When I pass my dll into the exe I get the following exception: AssemblyPath: C:\repos\WK.Devops.Scripts\PSModules\WkLocalTools\WkLocalTools\bin\x64\Debug\WkLocalTools.dll, OutputHelpFilePath: C:\repos\WK.Devops.Scripts\PSModules \WkLocalTools\WkLocalTools\bin\x64\Debug\WkLocalTools.dll-Help.xml, TreatWarningsAsErrors False
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at XmlDoc2CmdletDoc.Core.Engine.GetCommands(Assembly assembly)
at XmlDoc2CmdletDoc.Core.Engine.GenerateHelp(Options options)
Loader exception: System.IO.FileLoadException: Could not load file or assembly 'WK.OCP.Tax.DCS.Shared, Version=1.5.2.39, Culture=neutral, PublicKeyToken=f70b15a39674 a997' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'WK.OCP.Tax.DCS.Shared, Version=1.5.2.39, Culture=neutral, PublicKeyToken=f70b15a39674a997' ---> System.IO.FileLoadException: Could not load file or assem bly 'file:///C:\repos\WK.Devops.Scripts\PSModules\WkLocalTools\WkLocalTools\bin\x64\Debug\WK.OCP.Tax.DCS.Shared.dll' or one of its dependencies. Operation is not sup ported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\repos\WK.Devops.Scripts\PSModules\WkLocalTools\WkLocalTools\bin\x64\Debug\WK.OCP.Tax.DCS.Shared.dll' ---> System.NotSupportedException: An att empt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This relea se of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable th e loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stack Mark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& st ackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boole an forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at XmlDoc2CmdletDoc.Core.Engine.<>c__DisplayClass7_0.b__0(Object sender, ResolveEventArgs args)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)

GenerateHelp completed with exit code 'UnhandledException'