.NET 4.0 problem - solved

This forum is for programmers who have questions about the source code.
Post Reply
alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

.NET 4.0 problem - solved

Post by alkhaef » Fri Jul 09, 2010 2:21 pm

Hello all,

I just finally got my toolchain setup. But while going through it, I ran into some bumps that I hadn't seen documented anywhere.

Here are some specifics of my setup:

Windows XP Professional
Microsoft Visual C# 2010 Express - 10.0.30319.1 RTMRel
Microsoft .NET Framework 4.0.30319 RTMRel
Newest release of the DirectX SDK as of the time of post
Uninstalled OpenDental and installed the trial version before setup, as the docs say
OpenDental 7.0 and 7.1 (both had same issue)

I'm posting this:
a) to see if there was a simpler solution to this than the ones I found
b) so nobody else has to burn any time in case there isn't a simpler solution

The primary problem was that after I opened the solution, I tried to build and run, and all I saw was the splash screen. No errors reported.

After stepping through code, I found out that it bombs at line 477 in ContrChart.cs -

Code: Select all

			this.toothChart = new SparksToothChart.ToothChartWrapper();
The message (which only shows up after trying to step into that particular LOC) is as follows:
Mixed mode assembly is built against version 'xxxxxx' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
If you google this message, you find some solutions suggesting to add this to a .config file:

Code: Select all

<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0"/>
</startup>
However, I didn't think this would be too clean - It would mean keeping an additional file not under svn control (that I'd most likely forget about) in the tree. Instead, I tried hitting the project properties for each project and changing the target framework to .NET 3.5 (it's hard to forget about a project file ;)). This appears to have solved the problem.

Other (minor) things I ran into that I can mention were:
1. I tried using cygwin's svn first, instead of Tortoise... That led me to some annoying CR/LF-related messages, so I ditched it.
2. Opening the solution file forced me to convert it, and gave some conversion "errors" that I ignored. Not sure if that's related to Express, or my particular VS release date. Different sln's for different environments, anyone? Sounds like a maintenance headache though...

Best regards,
Al
Al
Help! I've OD'ed on OD! :)

User avatar
jordansparks
Site Admin
Posts: 5770
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: .NET 4.0 problem - solved

Post by jordansparks » Tue Jul 13, 2010 2:36 pm

All of this would have been avoided by using VS 2008. When we switch to 2010, we force everyone to switch. I just made that more clear on the source code page.
Jordan Sparks, DMD
http://www.opendental.com

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: .NET 4.0 problem - solved

Post by alkhaef » Tue Jul 13, 2010 5:16 pm

Thanks for the updates :)

Best Regards,
Al
Help! I've OD'ed on OD! :)

Post Reply