"The specified module could not be found" asp.net mvc app on IIS 7, windows server 2008 - asp.net-mvc-3

We have an ASP.NET MVC application working on a 32bit Windows Server 2003 with IIS 6.
After deploying it on a 64bit Windows Server 2008 R2 with IIS 7.5 it stopped working. We get the following error:
"Could not load file or assembly '###.dll' or one of its dependencies. The specified module could not be found"
The dll is a 3rd party dll, and we can not re-compile it.
We tried putting it in every possible directory but nothing helped. It appears in the Fusion log and the last line of this files log contains "IL assembly loaded from C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary .....".
The application pool runs in Integrated mode and "Enable 32-bit applications" is set to True.
Any help would be appreciated.
Thank you,
Katie D.

Do you have MVC3 installed? It is a separate install.
Maybe check your 3rd party dll with a tool like reflector to see what it relies on.

Related

An attempt was made to load a program with an incorrect format for Microsoft.SharePoint.Search.dll on 64-bit system

I'm trying to use Visual Studio to develop and debug a web application that uses the SharePoint 2007 API. I have been doing this fine on a 32-bit server up until now. Today I've moved over to a 64-bit development server and when I try to run the project out of VS, I get:
Could not load file or assembly 'Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I have referenced Microsoft.SharePoint.dll and Microsoft.SharePoint.intl.dll from the GAC on this machine. That automatically copies in Microsoft.SharePoint.Search.dll from somewhere when I run it (even though copy local is false on the references). My project Platform Target is "Any CPU". I get the same error with x86. If I change to x64, I instead get Could not load file or assembly 'MyProjects.dll'...incorrect format.. I've also tried deleting Microsoft.SharePoint.Search.dll from the bin after it starts up but then I get a SharePoint error saying that the site at my URL can't be found, which I believe is also a bitness issue. I'm not quite sure what the issue is but want to be able to run this application out of Visual Studio. How can I get it working?
You need the x64 (or anyCPU) version of the Sharepoint dlls to make it work
Both Microsoft.SharePoint.dll and Microsoft.SharePoint.intl.dll in the server's GAC are built for Any CPU. When I build my web app in Visual Studio, it automatically copies Microsoft.SharePoint.Search.dll into my bin, presumably because it's referenced by Microsoft.SharePoint.dll. SharePoint.Search.dll is not in the GAC. It is copied from the 64-bit 12\ISAPI directory and is built with an "Amd64" target architecture (despite my server having an Intel Xeon CPU). So I believe the problem is VS runs the web app in a 32-bit process which causes the error when it tries to load the 64-bit SharePoint.Search.dll.
My first idea was to explicitly reference the 32-bit SharePoint.Search.dll in my project. That makes the error go away but it is replaced with an error saying the website at [my SharePoint site URL] cannot be found. I believe this is because now I'm trying to access the SharePoint site, which runs in a 64-bit app pool, from a 32-bit process. So what I really need is for Visual Studio to run my web app using a 64-bit hosting process. This looks like an option available for VS 2012, but not 2010. The alternatives I've found for VS 2010 are:
On the project properties Web tab, configure it to run using the Local IIS instance. This will add a virtual directory to the default site, which is running in 64-bit mode by default. This isn't a good solution for me because I want to allow multiple developers to work on the same project on the same server simultaneously. Using the same site would cause conflicts. If there were a way to configure the site name conditionally on the user, this would be ok. I opted to try #2 first.
Replace the VS Development Server with an x64 build of the CassiniDev project. This project has the capability of plugging in to VS in place of the default WebDev.WebServer.EXE. So you just need to download the source code, and build with an x64 target platform. Then you can replace the VS default development server exe, as is documented w/ the CassiniDev project, and it will run an x64 development web server which solves my problem!

Issue installing SQL Server 2008 Express as a dependency via ClickOnce

I'm currently working on a project which has a Winforms component that is installed via ClickOnce. The original target OS was Vista and above and it continues to work fine for those platforms.
However, the customer has now requested that the application be tested against Windows XP (yes - I know it's about to have support dropped but what can I say).
When I run the installer against a fresh XP virtual machine ClickOnce duly installs the prequisites (Windows Installer 4.5 and SQL Server 2008 [with configured instance]) before installing the application itself.
Running the application appears to work as expected but when attempting to sync the local database with the remote one an exception is thrown.
"Could not load file or assembly 'Microsoft.SqlServer.Replication,
Version 10.0.0.0' or one of its dependencies"
Now, if I start again from a clean XP VM and Manually install Windows Installer and SQL Server Express 2008 before starting the ClickOnce package to install the main application the resulting installation works fine and without error!
I have tried numerous things including creating a ConfigurationFile.ini and using that for both manual and ClickOnce installations but the result is the same - the one with the manually installation of SQL Server will run without error but the ClickOnce installation will not.
I've pretty much run out of ideas now so hoping that someone can point me in the right direction.
Thanks in advance

Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'

I'm using vs2010 and crystal report version 13.0.2000.0 ,system 64bit crystal report runtime 64bit.
my application is running fine on development machine but when i'm deploying on server
getting this error
Could not load file or assembly 'log4net, Version=1.2.10.0,
Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its
dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load
file or assembly 'log4net, Version=1.2.10.0, Culture=neutral,
PublicKeyToken=692fbea5521e1304' or one of its dependencies. The
system cannot find the file specified.
Source of error:
CR:CrystalReportViewer ID="CrystalRportViewrRegistration" runat="server" AutoDataBind="true"
and I have checked GAC assembly I didn't find log4net.dll and even in my system I have search all and tried various things like changing runtime version and uploading lo4net dll from apache but no luck.
To configure IIS to run 32-bit applications you must follow these steps:
Open IIS
Go to current server – > Application Pools
Select the application pool your 32-bit application will run under
Click Advanced setting or Application Pool Default
Set Enable 32-bit Applications to True
If this option is not available to you, follow these next steps:
Go to %windir%\system32\inetsrv\
Execute the appcmd.exe tool:
If you don't see log4net.dll in %systemdrive%\windows\assembly\ on the machine you are attempting to deploy it on, it is likely you haven't successfully installed the redistributable for Crystal Reports for .Net Framework 4.0
Install (or reinstall) the latest service pack from http://scn.sap.com/docs/DOC-7824 (SAP Crystal Reports, developer version for Microsoft Visual Studio Updates & Runtime Downloads)
That runtime distribution should add log4net to the GAC along with a bunch of CrystalDecisions dll's
Ensure version for correct platform (32-bit or 64-bit) is installed. I faced same issue when installed 32-bit run-time on 64-bit machine. Installing correct one, i.e. 64-bit, resolved the issue.
I faced same issue (VS 2015), but my application is running under 32-bit application pool. So even though machine is 64-bit. I installed 32-bit installation and it works.
So in general dll has to be placed in two places:
GAC ( can have 32 and 64 versions of dll's)
your project bin
folder
Thus, you just need add reference to log4net.dll.
(In your case 32-bit with PublicKeyToken=692fbea5521e1304)
You can achive that by
downloading log4net.dll separately and add reference to it
dowloading SAP crystal report SDK (32 bit)
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
For this specific error, I installed version 20 of Crystal Report and it solved my problem:
https://www.tektutorialshub.com/crystal-reports/crystal-reports-download-for-visual-studio/#Service-Pack-16
You can also download the file alone using the following link
https://www.nuget.org/api/v2/package/log4net/1.2.10
rename the file to .zip and extract it.
I tried all of that things and it doesn't worked for me.
I Just installed SAPCrystalReport in my computer and it's working now.
To configure IIS to run 32-bit applications you must follow these steps:
Open IIS
Go to current server – > Application Pools
Select the application pool your 32-bit application will run under
Click Advanced setting or Application Pool Default
Set Enable 32-bit Applications to True
This solution worked for me, thanks.
If you are building a windows app try to build as x64 instead of Any CPU. It should work fine.
I was able to resolve this issue using below steps:
Uninstall Crystal reports using 'Add or Remove Programs' on Windows.
Closed all running apps and used this link (https://www.tektutorialshub.com/crystal-reports/how-to-download-and-install-crystal-report-runtime/#hownbspto-download) to download SP 29 DEVELOPER EDITION DOWNLOAD (I was using .net framework 4.7.2, see below Crystal report version recommendation for other versions).
❗ Please note: To integrate “SAP Crystal Reports, developer version for Microsoft Visual Studio” you must run the Install Executable by right clicking and selecting "Run as Administrator". Installing the MSI will not fully integrate Crystal Reports into VS. MSI files by definition are for runtime distribution only. Do not run the MSI's on your Development PC, where VS is installed, not required.
References - https://blogs.sap.com/2020/10/30/upgrading-a-visual-studio-2008-2019-.net-project-with-the-latest-cr-.net-sdk-packages/
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads
I would say, if you are using 64-bit version of Crystal Reports, just install 32 bit.
That solved my problem.
In my case I migrated crystal report in development computer to last version then migrated the cloud server to same version of crystal report
but after published the site I received this error :
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
the solution I commented the line in web.config
<!--<add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />-->
then publish the site again this solved my issue
Error (While using Visual Studio 2015 in win 10 64 bit machine):
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
Solution:
Open IIS
Go to current server – > Application Pools
Select the application pool your 32-bit application will run under
Click Advanced setting or Application Pool Default
Set Enable 32-bit Applications to True
The above solution is solved my problem.
Thanks.

Crystaldecisions.CrystalReports.Engine.dll not found on client computer

I wrote a .NET DLL that uses a ReportViewer in VS2010. On the development computer, it works well. However, when I install the program on a client, I get the error message that Crystaldecisions.CrystalReports.Engine.dll is not found.
I installed both the .NET 4 framework and the 32-bit runtime MSI that SAP provides as a free download.
What else do I need to do to get this to work?
Did you download the runtime from the website below?
http://scn.sap.com/docs/DOC-7824
Maybe on the project setting -> reference, you can try to set to copy the dll to local and see if it works...

WIA interop deployment through VS ClickOnce

I have an application that allows me to scan images on my development PC which works successfully. It uses the Microsoft Windows Image Acquisition COM ActiveX dll. I am running VS2008 on Windows 7 64 bit.
I am having problems trying to deploy the Interop dll using ClickOnce. This component is referenced through the VS project in the normal way (and copy local = true). When I install the application on a Windows XP machine, I get an error saying that the library is missing (i.e. it wasn't installed / registered correctly). Having looked in the System32 directory, the dll is not there, so it has to be deployed via my app.
After looking on the web and trying various solutions, I then tried Microsoft's 'Registration-Free COM' method here: http://msdn.microsoft.com/en-us/library/ms165432%28VS.80%29.aspx
However, changing the Isolated property to True then caused 2 compilation errors due to duplicate entries in the registry. Having sorted out these entries out manually, I then deployed my app again with the supposedly isolated COM component, but when I try to scan a document I now get this message:
'The procedure entry point_except_handler4_common could not be located in the dynamic link library msvcrt.dll'
I feel like I'm going round in circles with this one. Can someone please enlighten me on how to deploy the WIA interop via ClickOnce for all versions of Windows from XP onwards?
Your help will be greatly appreciated.
Thanks
Don't copy system DLLs from your Win7 machine to the XP machine, that can't work. It would have been easier if you named the file, I would guess at wiaaut.dll, the WIA Automation provider. It probably just isn't installed on the XP machine.
Ask the client to install this download on the machine. You don't need reg-free COM, these are system components.

Resources