Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
padillah opened this issue Jun 19, 2020 · 0 comments

Comments

@padillah
Copy link

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant