0

My development machine has Windows 7 Ultimate x64. We use VS2010. I debug with asp.net development server. We use C#.

Our remote server has Windows Web Server 2008 R2 x64 and IIS 7.5

I essentially create an "ASP.Net Empty Web Application" and add new webform Default.aspx so that I can see something. I build and run in my laptop and I see Default.aspx. Then I publish to local folder, and copy to remote server. I can also visit Default.aspx remotely. Everything works like it's supposed to.

Then I add references to 3 DLLs and build. When I run locally, I can see Default.aspx. I then publish to local folder and copy to server. When trying to view Default.aspx remotely, I get the error: Could not load file or assembly 'Name of DLL (without dll extension)' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I have searched everywhere and tried most of the suggestions:

  • I changed Platform Target from "Any CPU" to "x64".
  • I changed the app pool to both integrated and classic (v4.0).
  • In App Pool, I enabled 32-bit applications to both true and false.
  • I added Network Service, IIS_IUSRS to Bin folder in remote server.
  • I Published in Debug and Release.

The only thing that works is to delete the DLLs from Bin in the remote folder. Then I can see Default.aspx remotely. It seems the error is when I add them as reference.

Regarding the DLLs: I created them several years ago in VS2005 or VS2008 (not sure) and I don't know if they were rebuilt in a more recent version of VS2008. But I also did try creating an "ASP.Net Web Application" with VS2008 (with framework 3.5) and VS22010 (also with 3.5); when I try to add the references it gives me warning: "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded."

Joe_Hendricks
  • 746
  • 4
  • 16

1 Answers1

0

This seems a lot like the issue I was having, which I detailed in this post:

C++ CLI DLL not being loaded by IIS7 but only if built with anything newer than VS2008

Basically, the C++ redistributable packages were missing from the Windows Web Server; at least that was the case for me.

Install both the x86 and the x64 VS2010 C++ redistributable packages on the remote Windows server where you are deploying your application to, and see if that helps.

If that still doesn't work, then use a program called "DependencyWalker" to check what else your DLLs may require. DependencyWalker does show up false negatives, but it should point you in the right direction.

Community
  • 1
  • 1
rh101
  • 148
  • 2
  • 8