Hi,
I've create a webservice using BusinessConnector to communicate with Microsoft Dynamics AX2009.
I've developped it by adding reference to Microsoft.Dynamics.BusinessConnectorNet.dll into webservice.
The Path for dll is correct but when I try to test webservice, I receive an error loading file or assembly !!!
Here is the error :
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Could not load file or assembly
'Microsoft.Dynamics.BusinessConnectorNet' or one of its dependencies.
An attempt was made to load a program with an incorrect format.
Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.
Exception Details:
System.BadImageFormatException: Could not load file or assembly
'Microsoft.Dynamics.BusinessConnectorNet' or one of its dependencies.
An attempt was made to load a program with an incorrect format.
Source Error:
An
unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Assembly
Load Trace: The following information can be helpful to determine why
the assembly 'Microsoft.Dynamics.BusinessConnectorNet' could not be
loaded.
=== Pre-bind state information ===
LOG: User = XXX\xxxxxxx
LOG: DisplayName = Microsoft.Dynamics.BusinessConnectorNet
(Partial)
LOG: Appbase = file:///C:/AXWebserviceISA/AXWebserviceISA/AXWebserviceISA/
LOG: Initial PrivatePath = C:\AXWebserviceISA\AXWebserviceISA\AXWebserviceISA\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\AXWebserviceISA\AXWebserviceISA\AXWebserviceISA\web.config
LOG: Using host configuration file: \\?\C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727/Temporary
ASP.NET
Files/axwebserviceisa/724bc418/67e696a0/Microsoft.Dynamics.BusinessConnectorNet.DLL.
LOG:
Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727/Temporary
ASP.NET
Files/axwebserviceisa/724bc418/67e696a0/Microsoft.Dynamics.BusinessConnectorNet/Microsoft.Dynamics.BusinessConnectorNet.DLL.
LOG:
Attempting download of new URL
file:///C:/AXWebserviceISA/AXWebserviceISA/AXWebserviceISA/bin/Microsoft.Dynamics.BusinessConnectorNet.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Stack Trace:
[BadImageFormatException:
Could not load file or assembly
'Microsoft.Dynamics.BusinessConnectorNet' or one of its dependencies.
An attempt was made to load a program with an incorrect format.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, Assembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +416
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +166
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190
[ConfigurationErrorsException:
Could not load file or assembly
'Microsoft.Dynamics.BusinessConnectorNet' or one of its dependencies.
An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11200744
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +388
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +232
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +210
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName) +76
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +502
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile) +476
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean
allowCrossApp, Boolean allowBuildInPrecompile) +116
System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context) +77
System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext
context, String verb, String url, String filePath) +231
System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext
context, String requestType, String url, String pathTranslated) +89
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean
useAppConfig) +564
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +263
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Have someone any ideas ? I try to solve this point since 3 days and any solution. And I didn't find anything on the net.
Thanks for your help !