0
votes

I have this error when i try to debug my asp.net project setting : DEBUG and ANY CPU

error: The file or assembly 'System.Fabric' or one of its dependencies could not be loaded. Attempt to load a program with an incorrect format.

STACK TRACE:

[BadImageFormatException: Non è stato possibile caricare il file o l'assembly 'BSS.Vortex.AkiteManage.Contracts' o una delle relative dipendenze. Tentativo di caricare un programma con un formato non corretto.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +37
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +159
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +80
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22
   System.Reflection.Assembly.Load(String assemblyString) +29
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +39

[ConfigurationErrorsException: Non è stato possibile caricare il file o l'assembly 'BSS.Vortex.AkiteManage.Contracts' o una delle relative dipendenze. Tentativo di caricare un programma con un formato non corretto.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +777
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +229
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +140
1
Is it possible that your app is 64-bit and that library is only available in 32-bit format? Try target x86 instead of Any CPU or else check Prefer 32-bit and see whether the issue goes away.jmcilhinney
using x86 it shows the same error but this time with "System.Fabric"Youssef El Basraoui
Are you creating a .NET Core application and trying to reference a .NET Framework DLL? Is it maybe for an older version of .NET? I'm not sure what error message you'd get in those cases.jmcilhinney
yes,I'm trying to debug a website project written in asp.net that have a lot of references to other DLL'sYoussef El Basraoui

1 Answers

0
votes

'System.Fabric' packages are x64 bit, if your system target 32bit it will fail.

So fix the error...

Bulid the platform into x64 bit.

You have install Nodejs Azure Functions Core Tools from NODC.

For Download Refer this link.. https://nodejs.org/en/

After installion, in Command Prompt input npm i -g azure-functions-core-tools --unsafe-perm true So, You azure-functions is permission is enable..

After this, follow the below step....

  • Then set project debug properties(right click on your project>Properties>Debug blade).

  • Set Launch type to Executable

  • Set Executable path to %appdata%\npm\node_modules\azure-functions-core-tools\bin\func.exe.

  • Add Application arguments start.

    For More Info:-

https://social.msdn.microsoft.com/Forums/en-US/4b52ec67-13b4-4e6c-8aa6-15e082c001d7/cloud-not-load-systemfabric?forum=AzureServiceFabric