64 位 Web 应用程序中 Sage 100c 的 32 位库

问题描述 投票:0回答:1

我的 VS2022 中有一个现有的 Web 应用程序项目。 我为 Sage 100c(object métier)上的所有连接创建了一个名为“Sage”的库。但这个必须是32位的。我把目标CPU = x86 当我将“Sage”包含在我的旧项目中时 我有这个错误

应用程序“/”发生服务器错误。 不可能对文件或组件“Sage”或依赖项进行充电。暂定的程序格式不正确。 描述:在执行 Web 请求时,非例外。控制堆栈的跟踪以及错误信息及其起源于代码。

异常详细信息:System.BadImageFormatException:不可能从文件或程序集“Sage”或依赖项中删除充电器。暂定收费程序格式不正确。

错误来源: 这不是 Web 请求执行的例外情况。 Les informations related to l'origine et l'emplacement of l'exception peuvent être identifiées en utilisant la trace de la stack d'Exception ci-dessous.

Suivi du chargement de l' assembly:Les informations suivantes peuvent permettre de terminer la raison pour laquelle l' assembly 'Sage' n'a pas pu être charge.

=== Informations d'état de liaison préalable ===
JRN : DisplayName = Sage
(Partial)
AVT : des informations de liaison partielle ont été fournies pour un assembly :
AVT : Nom d'assembly : Sage | ID de domaine : 2
AVT : une liaison partielle se produit lorsqu'une partie seulement du nom complet de l'assembly est fournie.
AVT : cela peut entraîner le chargement d'un assembly erroné par le classeur.
AVT : il est recommandé de fournir une identité textuelle complètement spécifiée pour l'assembly,
AVT : qui comprend le nom simple, la version, la culture et le jeton de clé publique.
AVT : pour plus d'informations et pour obtenir des solutions à ce problème, consultez le livre blanc à l'adresse suivante http://go.microsoft.com/fwlink/?LinkId=109270.
JRN : Appbase = file:///C:/XXX/
JRN : PrivatePath initial = C:\XXXX\bin
Assembly appelant : (Unknown).
===
JRN : cette liaison démarre dans le contexte de chargement de default.
JRN : utilisation du fichier de configuration de l'application : C:\XXXX\web.config
JRN : utilisation du fichier de configuration d'hôte : 
C:\Users\MOI\Documents\IISExpress\config\aspnet.config
JRN : utilisation du fichier de configuration de l'ordinateur à partir de 
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
JRN : stratégie non appliquée à la référence à ce stade (liaison d'assembly privée, personnalisée, partielle ou basée sur l'emplacement).
JRN : tentative de téléchargement de la nouvelle URL 
file:///C:/Users/MOI/AppData/Local/Temp/2/Temporary ASP.NET Files/vs/0a9a1f54/bf4483de/Sage.DLL.
JRN : tentative de téléchargement de la nouvelle URL file:///C:/Users/MOI/AppData/Local/Temp/2/Temporary ASP.NET Files/vs/0a9a1f54/bf4483de/Sage/Sage.DLL.
JRN : tentative de téléchargement de la nouvelle URL file:///C:/XXX/Sage.DLL.
ERR : impossible de terminer l'installation de l'assembly (hr = 0x8007000b). Détection terminée.

堆迹:

[BadImageFormatException:无法对文件或程序集“Sage”或依赖项进行充电。暂定收费程序格式不正确。] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, 布尔值 throwOnFileNotFound, 布尔值用于自省, 布尔值抑制SecurityChecks) +0 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,证据 assemblySecurity,RuntimeAssembly reqAssembly,StackCrawlMark&stackMark,IntPtr pPrivHostBinder,布尔 throwOnFileNotFound,布尔 forIntrospection,布尔抑制SecurityChecks)+232 System.Reflection.RuntimeAssembly.InternalLoad(字符串 assemblyString,证据 assemblySecurity,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,布尔值 forIntrospection)+113 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +23 System.Reflection.Assembly.Load(String assemblyString) +35 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串程序集名称,布尔星指令)+48

[ConfigurationErrorsException:不可能对文件或程序集“Sage”或依赖项进行充电。暂定收费程序格式不正确。] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(字符串程序集名称,布尔星指令)+767 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +256 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)+58 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)+287 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +69 System.Web.Compilation.BuildManager.CallPreStartInitMethods(字符串 preStartInitListPath,布尔值& isRefAssemblyLoaded)+137 System.Web.Compilation.BuildManager.ExecutePreAppStart() +172 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters 托管参数,PolicyLevel 策略级别,异常 appDomainCreationException)+854

[HttpException (0x80004005): 无法对文件或程序集“Sage”或依赖项进行充电。暂定收费程序格式不正确。] System.Web.HttpRuntime.FirstRequestInit(HttpContext上下文)+532 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext上下文)+111 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext上下文)+724

在这种情况下我如何使用我的 Sage 库? 谢谢你的帮助

visual-studio x86 x86-64
1个回答
0
投票

最后我把我的申请分成了两个申请。 相同的数据库,但首先保持 64 位,第二个保持 32 位

© www.soinside.com 2019 - 2024. All rights reserved.