惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
Martin Fowler
Martin Fowler
爱范儿
爱范儿
IT之家
IT之家
Last Week in AI
Last Week in AI
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
aimingoo的专栏
aimingoo的专栏
G
Google Developers Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
The Cloudflare Blog
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog

博客园 - 一叶浮萍

Microsoft.AspNetCore.Http.Abstractions 2.20 is deprecated 使用office365 world2016发布编辑备份你的博客 使用office365 world2016发布编辑备份你的博客 You are not late! You are not early! 在同一个服务器(同一个IP)为不同域名绑定的免费SSL证书 Vue.js Is Good, but Is It Better Than Angular or React? It was not possible to find any compatible framework version VS增加插件 Supercharger破解教程 Git使用ssh key Disconnected: No supported authentication methods available (server sent: publickey) VS 2013打开.edmx文件时报类型转换异常 Echarts ecomfe 触摸屏 touch 在IE10下无法显示悬浮框 64位系统里注册32位软件 System.Data.Dbtype转换为System.Data.SqlDbType Bonobo Git Server (Simple git server for Windows.) 测试备忘 TortoiseGit bonobo gitserver记住帐号密码 TortoiseGit bonobo gitserver记住帐号密码 TITLE: BizTalk Server 2013 Administration Console 应用程序-特定 权限设置并未向在应用程序容器 不可用 SID (不可用)中运行的地址 LocalHost (使用 LRPC) 中的用户
Visual Studio 2022 Net6.0 无法发现testcase, 也无法执行te...
一叶浮萍 · 2023-07-19 · via 博客园 - 一叶浮萍

错误1:

编译正确,运行时 Tests 输出报错,

Failed to load extensions from file 'C:\Users\tangj15\.nuget\packages\xunit.runner.visualstudio\2.5.0\build\net6.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll'. Please use /diag for more information.

错误2:

编译正确,但编译完成时查看Tests输出,提示自动发现test case时错误

Failed to load extensions from file 'C:\Users\tangj15\.nuget\packages\xunit.runner.visualstudio\2.5.0\build\net6.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll'. Please use /diag for more information.

解决办法:

针对错误1,添加如下属性,且设置为true。

    <PropertyGroup>
							
        <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
											
        <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
											
        <GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
											
        <GenerateDocumentationFile>false</GenerateDocumentationFile>
											
        <GenerateDependencyFile>false</GenerateDependencyFile>
											
    </PropertyGroup>
							

针对错误2,添加如下引用。不可缺少(针对xunit)

    <ItemGroup>
							
      <PackageReference Include="coverlet.collector" Version="6.0.0">
																			
        <PrivateAssets>all</PrivateAssets>
											
        <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
											
      </PackageReference>
							
      <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
																			
      <PackageReference Include="Microsoft.TestPlatform" Version="17.6.3" />
																			
      <PackageReference Include="xunit" Version="2.5.0" />
																			
      <PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
																			
        <PrivateAssets>all</PrivateAssets>
											
        <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
											
      </PackageReference>
							
    </ItemGroup>