简体   繁体   English

如何解决.net核心与.net框架版本的兼容性错误?

[英]How to solve the .Net framework version compatibility error with .net core?

This question may be asked before but I did not got the issue solved visiting many questions on Stackoverflow. 之前可能会问过这个问题,但是我在访问Stackoverflow上的许多问题时并没有解决问题。

I am creating a test project for my for my console app project.When I add referance of console app to the test project it shows me following error: 我正在为我的控制台应用程序项目创建一个测试项目。当我将控制台应用程序的引用添加到测试项目中时,显示以下错误:

`Project '..\MyConsoleApp.csproj' targets 'netcoreapp2.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.6.2`'

I tried by lowering the version of .NETFramework for my test project but then it showed to reinstall the Nuget pakages. 我尝试通过为测试项目降低.NETFramework的版本进行尝试,但随后显示它重新安装了Nuget包装。 When I tried to reinstall them it shows that the pakage has a bug, contact the owner . 当我尝试重新安装它们时,表明包装有错误,请与所有者联系

Open for suggestions from u guys...Thanks 欢迎大家提出建议...谢谢

目标网络标准,而不是核心或框架。

Lex Li's comment was very helpful in my case I was wrong in adding general test project instead I added .Net Core test project which solved the problem like this: 在我的情况下,Lex Li的评论非常有用,我在添加常规测试项目时错了,而是添加了.Net Core测试项目,它解决了以下问题: 就我而言,这是一个XUnit测试项目(.NET Core)

Hope my answer will be helpful for beginners like me.... 希望我的回答对像我这样的初学者有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM