2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

.NET Standardプロジェクトを.NET FrameworkのテストプロジェクトでUTを作成した場合に認識されないときの対応方法

Posted at

はじめに

情報がなく、かなり困ったので備忘録として残す。

現象

「.NET Standard 2.0」を対象のフレームワークとして指定したプロジェクトを「.NET Framework 4.6.2」を対象のフレームワークとしたテストプロジェクトでUTを実装していた。途中までは問題なく動作していたが、実現したい機能の都合上、.NET Standard 2.0でMicrosoft.Win32.Registryのnugetパッケージをインストールしたところ、テストプロジェクトで実装したUTがひとつも認識されなくなってしまった。(白抜きのひし形に水色の"!"が入った記号が表示される)

解決策

このStackOverFlowの回答をヒントに、以下の通り対応したら動作した。

  • MSTest.TestFramework, MSTest.TestAdapterを最新にする
  • Microsoft.Net.Test.SDKをnugetでインストールする

おわりに

裏は取れていないが、おそらくWin32APIを利用するようなAPIを持つnugetパッケージをインストールした時に起きると思われる。
Windows OS専用の仕組みを利用するnugetパッケージを利用する場合は注意が必要。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?