「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。 -[[戻る>NuGet]] * 目次 [#y8ecadda] #contents *概要 [#h3fd7148] [[Package Reference>NuGet を使用したパッケージ管理#s3c3fcd3]]に切り替え後、プロジェクトを[[MSBuild]]でビルドしようとしたら -CS0246 型または名前空間名 'xxxx' が見つかりませんでした。using ディレクティブまたはアセンブリ参照が不足しています。 -CS0246 The type or namespace name 'xxxx' could not be found (are you missing a using directive or an assembly reference?) が出た。 *詳細 [#d16217af] **対策1 [#mfd61247] 下記のような対策があったが、何れも効果は無かった。 -以下をインストールする。 Install-Package Microsoft.VisualStudio.Setup.Configuration.Interop -以下の設定を追加する。 <PropertyGroup> <RestoreProjectStyle>PackageReference</RestoreProjectStyle> </PropertyGroup> [[.NET Standard]]、[[.NET Core]]だとバッチリ動いているが、~ .NET Framework の方の実装は問題があるようなので、~ .NET Framework 版は(、現時点では、)[[Package Reference>NuGet を使用したパッケージ管理#s3c3fcd3]] にしない方がイイ。 **対策2 [#raad396e] nuget.exe restoreを削除して、~ MSBuildのオプションに以下を追加したら上手く動作した。 /t:Restore ※ [[NuGetリストア]]をnuget.exe ではなく、MSBuildで行うように変更されていたというオチ。 ※ [[NuGetリストア>ビルドスクリプト#b6fac5f7]]をnuget.exe ではなく、MSBuildで行うように変更されていたというオチ。 *参考 [#g4b1c744] **NuGet/Home [#z162c736] -Command line builds fail when UWP project.json project references PackageReference project · Issue #4804~ https://github.com/NuGet/Home/issues/4804 -Automatically use PackageReference mode if referencing a project that uses PackageReference · Issue #4581~ https://github.com/NuGet/Home/issues/4581 **dotnet/standard [#nc410dee] -Issues with .NET Standard 2.0 with .NET Framework & NuGet · Issue #481~ https://github.com/dotnet/standard/issues/481 ---- Tags: [[:テスト]], [[:デバッグ]], [[:デプロイ]], [[:.NET開発]]