سؤال

I'm having an extremely strange problem with VS2010's multi-targeting. In a nutshell, only targeting .NET 3.5 Client Profile seems to be working correctly. I really need to be able to target .NET 2.0. Anyone have a thought or two?

Creating a brand new Windows Forms project:

Creating a brand new Win Forms project

Has the incorrect versions targeted:

Has the incorrect versions targeted

Targeting .NET 3.5 Client Profile - NOT plain old .NET 3.5 - does use the correct version: v2.0.50727. That is the only way I get 2.0 references, but I need to target 2.0.

هل كانت مفيدة؟

المحلول

Mystery solved. Had been using some registry settings to force PowerShell to consume .NET 4 assemblies. Maybe not the best approach in retrospect. Said registry settings follow:

hklm\software\microsoft.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1 hklm\software\wow6432node\microsoft.netframework /v OnlyUseLatestCLR /t REG_DWORD /d 1

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top