私は約 2 年前にデータベース アクセス用に .NET 2.0 でクラス ライブラリを作成し、それを .NET 2.0、3.0、および 3.5 でずっと使用してきました。
私が取り組んでいる現在のプロジェクト (.NET 4.0 アプリケーション) では、古い忠実なクラス ライブラリを使用しようとしましたが、次の例外が発生しました。
System.InvalidOperationException が処理されませんでした Message=フォームの作成中にエラーが発生しました。詳細については、Exception.InnerException を参照してください。 エラー: 混合モード アセンブリは、ランタイムのバージョン 'v2.0.50727' に対してビルドされています 追加の構成情報がないと、4.0 ランタイムにロードできません。 ソース=スクールマネージャー スタックトレース: SchoolManager.My.MyProject.MyForms.Create__Instance__[T](T インスタンス) で 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190 SchoolManager.My.MyProject.MyForms.get_frmGeneric() で D:\Alex\Documents\Visual Studio 2008\Projects\School Manager\SchoolManager\My Project\Application.Designer.vb:line 35 の SchoolManager.My.MyApplication.OnCreateMainForm() で Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() で Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() で Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (文字列 [] commandLine) で 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 の SchoolManager.My.MyApplication.Main (String [] Args) で System.AppDomain._nExecuteAssembly (RuntimeAssembly アセンブリ、文字列 [] 引数) で System.AppDomain.ExecuteAssembly (文字列 assemblyFile、証拠 assemblySecurity、文字列 [] 引数) で Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() で System.Threading.ThreadHelper.ThreadStart_Context (オブジェクトの状態) で System.Threading.ExecutionContext.Run (ExecutionContext executionContext、ContextCallback コールバック、オブジェクトの状態、ブール値の ignoreSyncCtx) で System.Threading.ExecutionContext.Run (ExecutionContext executionContext、ContextCallback コールバック、オブジェクトの状態) で System.Threading.ThreadHelper.ThreadStart() で 内部例外: System.IO.FileLoadException Message=混合モード アセンブリは、バージョン 'v2.0.50727' に対してビルドされています ランタイムであり、追加なしで 4.0 ランタイムにロードすることはできません 構成情報。 ソース=Dinofage.Data.XpressData スタックトレース: Dinofage.Data.XpressData.ExecuteSelectInternal (文字列 selectCommand) で Dinofage.Data.XpressData.ExecuteSelect (文字列 selectCommand) で D:\Alex\Documents\Visual Studio 2008\Projects\School Manager\SchoolManager\Modules\Academics.vb:line 89 の SchoolManager.Academics.GetNewAdmissionCode (StringcademicYear) で D:\Alex\Documents\Visual Studio 2008\Projects\School Manager\SchoolManager\UserControls\StudentDetail.vb:line 20 の SchoolManager.StudentDetail..ctor() で D:\Alex\Documents\Visual Studio 2008\Projects\SchoolManager\SchoolManager\frmGeneric.Designer.vb:line 25 の SchoolManager.frmGeneric.InitializeComponent() で SchoolManager.frmGeneric..ctor() で 内部例外:
何が間違っている可能性があり、どうすれば修正できますか?