How to use useLegacyV2RuntimeActivationPolicy with multiple projects?

3.1k views Asked by At

i'm trying to include handwriting recognition capabilities as a library into a WPF .NET 4 Solution containing multiple projects. Therefore i wanted to use the IAWinFX.dll (tablet PC SDK 1.7) on Win7 x64 - but when running BackgroundAnalyze i get the following error:

"Mixed mode assembly is built against version 'v1.0.3705' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information."

I already tried modifying the corresponding .config file (set useLegacyV2RuntimeActivationPolicy="true") as recommended here: http://social.msdn.microsoft.com/Forums/fi-FI/wpf/thread/6acf2aab-29c4-4754-95eb-cb2d717c5a2e .

I've also set the build target to x86 and changed this on the main application as well. The main application's config also has the useLegacyV2RuntimeActivationPolicy="true" set.

Since i'm stuck with this problem a few days already i've been looking for a solution and thus also tried disabling the "Generate serialization assembly" option as suggested here: https://support.softwarekey.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=140

but none of those attempts gave me a working InkAnalysis... What else can i do? Is there a solutionwide .config file where i might set the useLegacyV2RuntimeActivationPolicy option? Or do i need to add this option to every project in the solution?

Thanks in advance!

1

There are 1 answers

0
adrianm On BEST ANSWER

Don't know what the SO practice is for this case. I'll repeat my comment as an answer and expand it a bit so the question can be closed.

-

The only config file used is the one for the .exe you use to start the application (which I assume is what you call "main application's config").

(Settings are also read from machine.config and user.config but values in there are normally overridden by the app config)

If you are running inside VS, ensure that the file is called app.config.
VS will automatically copy it to the output folder and rename it to myapp.exe.config and myapp.vshost.exe.config.