0

I noticed that an application that I've been working on is crashing on startup when run on a virtual machine. The error is an unhandled exception which when caught claims "Could not load File or Assembly 'xyz.dll' or one of its dependencies".

Said DLL is in the same folder as the .exe as it normally is on other machines. The DLL is a C++ project which uses CLR to interface with the rest of the C# program. The entire program is built with .Net4.5 in visual studio 2013.

The virtual machine setup is:

Using Virtual Box Windows 7 32 bit:

  • 512mb Ram
  • 25GB VDI Hardrive with Dynamic Size
  • Windows 7 Professional x86 with SP1
  • .Net4.0 via Offline Installer
  • .Net4.5 via Offline Installer

The program works fine on multiple other systems such as Windows 7 Embedded. The only place it won't run so far is the virtual machine. I'm just wondering if running it on a virtual machine would have any issues that aren't immediately obvious?

Or whether I'm missing something with the .Net installations?

I've tried all the other answers that I could find on this issue such as cleaning and rebuilding everything or restarting visual studio. The only thing I can think of is that I am missing a dependency which hasn't been installed by .Net4 or 4.5.

user3161729
  • 303
  • 2
  • 15
  • That dll might need other dlls which are missing. Google for `Dependency Walker` and investigate what you are missing. – Sinatr Dec 03 '15 at 15:30
  • I was under the impression that dependency walker doesn't work that well anymore? Also while I somewhat assume this is the issue, it's weird that the program works on a fresh Windows 7 Embedded with .Net4.5 but not a virtual machine with .Net4.5 – user3161729 Dec 03 '15 at 15:38
  • Have you been [here](http://stackoverflow.com/q/4469929/1997232)? – Sinatr Dec 03 '15 at 15:43
  • Yeah that was the first place that I started. However using dependency walker I've found that I was missing the Visual Studio c++ runtime which is needed for CLR. Thanks for the help! – user3161729 Dec 03 '15 at 16:02

1 Answers1

0

The use of CLR in my program required the Visual Studio 2013 C++ runtime found here:

https://www.microsoft.com/en-GB/download/details.aspx?id=40784

I figured that anything made for .Net4.5 would be covered by the .Net4.5 download but I guess not. Thanks to Sinatr for suggesting the use of dependency walker!

user3161729
  • 303
  • 2
  • 15