3 Replies Latest reply on Feb 17, 2012 7:11 PM by InDenver

    .NET Dependency - "Could not load file or assembly"

    InDenver

      I have written a 32-bit VB.NET DLL that is called from ColdFusion. This DLL also connects to a third-party DLL to do most of the processing of the request.

       

      This setup works successfully in our test environment, which is a Windows 2003 server (ColdFusion 9 32-bit, IIS6).

       

      However, we cannot get things to run correctly on our production server, which is running Windows 2008 64-bit, IIS7.

       

      I have been able to verify the .NET DLL is being created successfully via ColdFusion, but crashes with the below dump at the point in the code where the .NET DLL attempts to connect to the third-party dll.

       

      I have written a test windows application that makes the exact same calls to the .NET DLL, and it completes successfully. I have also set up the ColdFusion 9 .NET service to run under the Administrator account, to make sure we don’t have an access rights issue (a temporary change, to be sure).

       

      So, at this point I am confident everything is installed on the live server correctly. My guess now is there are additional configurations necessary in IIS7, Windows server 2008 64-bit that were  not required in the test environment.

       

      I am pretty much at the end of my rope troubleshooting this issue. Any ideas on where else to look would be appreciated.

       

      Here is the error dump:

      1. System.IO.FileNotFoundException: Could not load file or assembly 'XXXXX' or one of its dependencies. The system cannot find the file specified.

      File name: 'XXXXX'

         at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

         at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)

         at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)

         at System.AppDomain.Load(String assemblyString)

       

      === Pre-bind state information ===

      LOG: User = DDM08\Administrator

      LOG: DisplayName = XXXXX

      (Partial)

      WRN: Partial binding information was supplied for an assembly:

      WRN: Assembly Name: XXXXX | Domain ID: 1

      WRN: A partial bind occurs when only part of the assembly display name is provided.

      WRN: This might result in the binder loading an incorrect assembly.

      WRN: It is recommended to provide a fully specified textual identity for the assembly,

      WRN: that consists of the simple name, version, culture, and public key token.

      WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.

      LOG: Appbase = file:///C:/ColdFusion9DotNetService/

      LOG: Initial PrivatePath = NULL

      Calling assembly : Connector_VB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

      ===

      LOG: This bind starts in LoadFrom load context.

      WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().

      LOG: Using application configuration file: C:\ColdFusion9DotNetService\JNBDotNetSide.exe.Config

      LOG: Using host configuration file:

      LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.

      LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).

      LOG: The same bind was seen before, and was failed with hr = 0x80070002.

       

                     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java: 39)

                     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm pl.java:27)

                     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

                     at com.jnbridge.jnbcore.DotNetObjectBase.a(Unknown Source)

                     at com.jnbridge.jnbcore.ExceptionFactory.throwException(Unknown Source)

                     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                     at java.lang.reflect.Method.invoke(Method.java:597)

                     at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:97)

                     at coldfusion.runtime.dotnet.DotNetProxy.invoke(DotNetProxy.java:38)

                     at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)

                     at cfTestConnector2ecfm434991857.runPage(D:\OnePointV2\ReportingWebsite\onepointV2\test\Test Connector.cfm:32)

                     at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)

                     at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)

                     at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)

                     at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381)

                     at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)

                     at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)

                     at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)

                     at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)

                     at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)

                     at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)

                     at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)

                     at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)

                     at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)

                     at coldfusion.CfmServlet.service(CfmServlet.java:200)

                     at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)

                     at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)

                     at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 )

                     at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)

                     at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)

                     at jrun.servlet.FilterChain.service(FilterChain.java:101)

                     at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)

                     at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)

                     at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)

                     at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)

                     at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)

                     at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)

                     at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)

                     at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)

                     at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

        • 1. Re: .NET Dependency - "Could not load file or assembly"
          InDenver Level 1

          Forgot to add that ColdFusion on the Windows 2008 server is Version 9, 64-bit.

          • 2. Re: .NET Dependency - "Could not load file or assembly"
            BKBK Adobe Community Professional & MVP

            InDenver wrote:

             

            I have written a 32-bit VB.NET DLL that is called from ColdFusion. This DLL also connects to a third-party DLL to do most of the processing of the request.

             

            This setup works successfully in our test environment, which is a Windows 2003 server (ColdFusion 9 32-bit, IIS6).

             

            However, we cannot get things to run correctly on our production server, which is running Windows 2008 64-bit, IIS7.

             

            Forgot to add that ColdFusion on the Windows 2008 server is Version 9, 64-bit.

             

            One thing that jumps out is that you moved from 32-bit to 64-bit. Your 32-bit DLL might be incompatible with 64-bit.

            • 3. Re: .NET Dependency - "Could not load file or assembly"
              InDenver Level 1

              From my original post:

               

              "I have written a test windows application that makes the exact same calls to the .NET DLL, and it completes successfully."

               

              This was done on the 64-bit server,meaning the DLLs are clearly capable of running on the 64-bit server. Somehow, the way Cold Fusion calls my DLLs causes a crash when that DLL attempts to call the third-party DLL.