System.Exception: 'Error loading msvcr120.dll (ErrorCode: 193)' - c#

my system is windows 64 bit.
my projects runs on visual studio 2022. C#, .NET Framework 4.8 MVC.
when I try to run the program, I get this error:
System.Exception: 'Error loading msvcr120.dll (ErrorCode: 193)'
I read all kinds of documents I found about this error, talking about a 32 bit system/program that is not compatible with running on 64-bit operating system.
This is strange, because I have another computer where this error is not received, also 64-bit, and I copied the dll file from it.
(the project is exact same project).
I set the file as shown:
Does anyone have any idea what could be causing this error?

For now the problem is solved, in a very strange way!
I tried to update the Microsodt.SqlServer.Types package on the Nuget to the last version - and I get an error from the code.
so I downgrade the version, and now the error no longer appear.
if it help anyone in the future - the update version I currently have is:
Microsoft.SqlServer.Types: 14.0.1016.290

Related

Can no longer build an old project in Xamarin

I have an old project that used to build
However I have recently tried rebuilding since a xamarin update it and I get an error message
The name 'Build' does not exist within the current context.
I've tried building it with different versions of the .net framework
but none of these have worked.
I have also noticed the warning message
Warning MSB3276: Found conflicts between different versions of the
same dependent assembly. Please set the "AutoGenerateBindingRedirects"
property to true in the project file.
It looks like I might be building it with the wrong assembly version.
EDIT
I've checked the GTK version and there is only one option in my case.
Version 2.12
EDIT
I've just tried restoring my code from version control.
My project will build! ... But I have not really fixed the problem since I get the following runtime error.
System.DllNotFoundException: Unable to load DLL 'libgtk-win32-2.0-0.dll': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
Which tells me that I haven't built it with libgtk-win32-2.0-0.dll.
EDIT
I've just created a simple test program after reinstalling Xamarin
When I built it the first time I get the same message about "AutoGenerateBindingRedirects"
When I built it again I get a different error message.
System.DllNotFoundException
I'm back to not being able to find libgtk
I have finally got it working. Here's what I did
I uninstalled all xamarin, mono and GTK programs from windows using the windows control panel.
Removed all registry entries I could find.
Manually deleted the remaining program files from my hard drive.
Went and downloaded the latest versions of GTK and mono and .net. Reinstalled and rebooted.
Copied the gtk files into my program directory and everything worked.
I'm not sure which of these steps may have helped.

Issue running 4.0 c# application on XP .NET 4.0

I am trying to run a c# application using WPF that runs in version 4.0, on an XP machine that has .NET 4.0 framework installed on it. It starts up, but then errors out afterwards during the InitliaizeComponent() method in the form load. Windows then displays the "Would you like to send an error report?".
How can I see or figure out what is exactly happening, so I can fix the issue? I tried looking at the error report, but it is mainly just win bin code, and means nothing in terms of the error to me.
EDIT:
Thanks for the advice to log it. I did so, and this is the error I am getting on the XP machine when running the deployed version.
'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '5' and line position '57'.
The issue was that I was using a .ico for the in the WPF title field. When I changed it to use a .png image, it then did not crash. Maybe it is an issue regarding video, or a bug. The answer from another question I posted in a prior comment resolved my issue. Now, I would like to test more, and see why it corrected the problem.

Can't start Gtk# Mono App without IDE (Unable to load DLL "intl")

Some Background information:
Cross-Platform-Desktop-App written in C# with gtk# and mono.
Target Framework: Mono / .Net 4.5
Runtime Environment: Microsoft .NET
Problem
I can build / debug / run the project in Xamarin Studio or Visual Studio 2012 perfectly fine.
But whenever I try to start a debug/release build without it (open .exe), my app doesn't start at all.
I tried HomeStream.exe 2> error.log as stated here.
And error.log contained the following information:
Unhandled Exception: System.DllNotFoundException: Unable to load DLL "intl": The specified module could not be found. (Exception from HRESULT: 0x8007007E).
at Mono.Unix.Catalog.gettext(IntPtr instring)
at Mono.Unix.Catalog.GetString(String s)
at MainWindow.Build() in g:\Users\Eric\Dropbox\Projekte\HomeStream\HomeStream\gtk-gui\MainWindow.cs:Line 35.
at MainWindow..ctor() in g:\Users\Eric\Dropbox\Projekte\HomeStream\HomeStream\MainWindow.cs:Line 22.
at HomeStream.HomeStreamApp..ctor() in g:\Users\Eric\Dropbox\Projekte\HomeStream\HomeStream\HomeStreamApp.cs:Line 67.
at HomeStream.HomeStreamApp.Main(String[] args) in g:\Users\Eric\Dropbox\Projekte\HomeStream\HomeStream\HomeStreamApp.cs:Line 47.
Question
So my question is: what kind of DLL is "intl"?
And why is my app able start in an IDE without it if it's so important?
Using Gettext internationalization means your software has a dependency on Mono.Unix, which depends on some native Unix libraries. Some of those libraries have been made available by some developers for the Windows platform. For example you have the MinGW or Cygwin projects to obtain them, or the GnuWin32 project which is the first hit on Google. Try to obtain a libintl.dll that works on Windows, and if that fails to load, then post a new stackoverflow question.

Not enough storage is available to process this command (VS compile, runtime)

I am getting the following error in Visual Studio during the build:
...\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2868,9): error MSB3021: Unable to copy file "obj\Debug\someproject.dll" to "Bin\Debug\someproject.dll". Not enough storage is available to process this command.
And sometimes (if I could compile the solution) the following one in run-time when starting the web application:
Could not load file or assembly 'SomeWebSite' or one of its dependencies. Not enough storage is available to process this command. (Exception from HRESULT: 0x80070008)
I have already tried increasing IRPStackSize to it's maximum value, but it did not help.
The problem seems to disappear temporarily after rebooting, but then it happens again.
Windows 7 32-bit SP1
Visual Studio 2010 SP1
Silverlight 5
The work-around is to remove the obj folder from all of your projects inside the solution.
This folder can be created again upon building the project hence no harm to the project.

Application Runs when Debugging but not when Published

When publishing my web application and then running it will return the error
"Could not load file or assembly 'BaseApplicationName' or one of its dependencies. An attempt was made to load a program with an incorrect format."
However if I run the application through debugging (f5) it runs correctly.
I guess what it comes down to is
what differences are there when running an application through debugging vs publishing it that would cause a problem like this?
When publising I have it set to delete all existing.
History of how it started... I added the 32 bit Oracle.DataAccess dll to my 64 bit system. It would not work and crash giving the same error as above but with the Oracle.DataAccess name instead of the baseApplicationName. I have since removed all references to it and removed the dll to try and get it to run without it once again.
Any advice?
You have a mismatch in your solution where you are mixing x86 with x64, the incorrect format message refers to trying to load a 64 bit dll from a 32 bit executable or vice versa.
Have you tried to "Clean" your solution and then rebuild it?
I am not sure which version of VS you are using - but I have noticed in 2005 and 2008 problems with it hanging on to dependencies that are not longer used. It might still be referencing the Oracle DLL during the publication step, and a bitness problem (32 vs 64) would give the error you see.
If you can't see any reference to the Oracle file in VS I would open the *proj file in notepad and see if there is a hidden reference to it that might be pushed to the server when you publish.
HTH

Categories

Resources