I have a large amount of code that has been running scientific instruments for the last 10+ years. Now a critical component is no longer available so I must mod the code. This was written in NETMF 4.3.1, and contained modules in both C# and VB.
I have been struggling trying to use my programming environment that has seen several VS versions upto 2022 installed since editing this older code. Currently, when I try to build any of the older code on VS2013, for example, I get this error:
Error 1 compiler initialization failed unexpectedly: Project already has a reference to assembly mscorlib. A second reference to ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\mscorlib.dll’ cannot be added. D:\Projects\Software Development\NET.MF\Current\NET Library\CommonMicro\vbc CommonMicro.
This happens on all the VB modules in the solution, but not the C#.
After spending many hours chasing broken links regarding NETMF, and checking the fixes that I did find, I figured that it would be better to start fresh on a new virtual PC.
I followed the GHI documentation to install VS2013, and all the additional NETMF and Gadgeteer modules in a Win10 Hyper-V instance. To see if this had been correct, I built a Gadgeteer app with a Raptor, display, and USB. It has no code other than the startup “Program started” print.
If you look at the error list, it says Error 1 0x80131700 c:\users\rocky\onedrive - inc\documents\visual studio 2013\Projects\GadgeteerApp5\GadgeteerApp5\MMP GadgeteerApp5
If I create the same program in C#, same result. I have also updated the virtual HyperV image to see if that would fix the error as one site suggested. No luck.
Any help would be greatly appreciated. strong text
I am also developing with TinyClr 2.0, and running VS2022. Will this compromise running your VSIX for earlier VS versions addressed by this patch? Or should I have separate machines for each?
Does this solve the Visual Basic errors regarding mscorlib.dll and NETMF?
Again, thanks
Rocky
Hi: Answer is yes and no. Yes I can run the simple example you show above.
My problem is when I get to much more complex problems, particularly ones that have separate modules of VB and C# (usually for hardware specific targets), I get “could not find library 'Microsoft.visualbasic.dll” giving the location, where the file really is located.
I am attaching the screengrab:
Funny thing is, I can build a simple module in VB.
Also, Gadgeteer projects do not have a template.
Additionally it the project was with netmf 4.4 I do not get this error, just 4.3
I have looked at VS2019 and cannot find an option to change langversion. When I go to Advanced build Settings, it says Language version automatically selected based on framework version. The link on why says to edit .cspro file for the app. I cannot find a langversion reference there, so do not know how to proceed.