Today, I went to build (compile) and run a C# .NET/MQ sample that I have which worked perfectly before and I got the following error when I ran it:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'amqmdnet, Version=9.1.3.0, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97' or one of its dependencies. The system cannot find the file specified. File name: 'amqmdnet, Version=9.1.3.0, Culture=neutral, PublicKeyToken=dd3cb1c9aae9ec97' at MQTest71.MQTest71.Main(String[] args)
I compiled it again. No errors and it successfully generated the executable. Weird. When I ran it, I got the above error message.
I searched the internet and didn’t find a specific hit but found several pages that talked about creating a .NET Framework 4.0 application that references a .NET Standard 2.0 library.
This got me thinking about the C# compiler I was using versus the .NET runtime that was being used. The batch file to do the build was using the “csc.exe” (compiler) from .NET v2.0.
I did a quick of my C: drive and found that I had 3 .NET frameworks installed: v2.0, v3.5. and v4.6.1.
Note: Under “Programs and Features“, it shows I have “Microsoft .NET Framework 4.6.1 SDK” installed. The path to the compiler is C:\Windows\Microsoft.NET\Framework\v4.0.30319\. If you want to read about Microsoft’s .NET odd naming standards, you can read the article here. I do not have any entries for .NET v2.0 or .NET v3.5 (more odd behavior by Microsoft).
So, I updated my build batch file to use the compiler from .NET framework v4.6.1 and compiled my simple C# .NET/MQ program. It compiled fine and of course, it ran perfectly fine.
I know I used the .NET framework v2.0 with MQ v8.0 and it worked fine, so I decided to check out IBM MQ’s system requirements for software compilers. Here’s what I found for IBM MQ and the officially supported releases of .NET:
- IBM MQ 8.0 supports .NET 3.5, 4.0 & 4.5
- IBM MQ 9.0 supports .NET 3.5, 4.0, 4.5 & 4.6
- IBM MQ 9.1 supports .NET 4.5.1, 4.6 & 4.7
Regards,
Roger Lacroix
Capitalware Inc.