C# Sample Loads an Exception

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
eryaf
Posts: 6
Joined: Fri Jun 04, 2010 11:43 am

C# Sample Loads an Exception

Post by eryaf »

Dear XDIMAX,

When I tried to build and run the C# example, it shows an error FileLoadException unhandled. I am still beginner in C#, may you tell me what s wrong and how s the solution/workaround? I am suing VC#2010 express.

Thanks.




E

Image

serg
Posts: 143
Joined: Mon Aug 31, 2009 9:17 pm

Re: C# Sample Loads an Exception

Post by serg »

Hi eryaf,
This is because the MVS2010 default MS .NET version is 4, but the SUB-20 component is based on MS .NET v2.
We plan to include a SUB-20 .NET component v4 into our next release. In the meantime you can add the following
<startup useLegacyV2RuntimeActivationPolicy="true"></startup>
into the application configuration file - WindowsApplication1.exe.xml.
Attached is the resulting file(archived)

Regards
Attachments
WindowsApplication1.exe.zip
(489 Bytes) Downloaded 1210 times

eryaf
Posts: 6
Joined: Fri Jun 04, 2010 11:43 am

Re: C# Sample Loads an Exception

Post by eryaf »

where can I find the file from my project folder?

eryaf
Posts: 6
Joined: Fri Jun 04, 2010 11:43 am

Re: C# Sample Loads an Exception

Post by eryaf »

Dear serg,

I did right click at the windowapplication1 and click properties. There, I change target framework into .NET Framework 2.0. Is it the same as what you do?

Thanks :) E

serg
Posts: 143
Joined: Mon Aug 31, 2009 9:17 pm

Re: C# Sample Loads an Exception

Post by serg »

Probably :)

Post Reply