Reference dotnet core 2.0项目参考错误

Reference dotnet core 2.0项目参考错误,reference,.net-core,visual-studio-2017,Reference,.net Core,Visual Studio 2017,在vs2017中使用dotnet core 2.0-preview1时。我在项目参考方面出错了 我有两个项目的解决方案 这是Common.Bll项目 Common.Web引用了项目Common.Bll。但是ide告诉我找不到公共。Bll错误使用指令不是代码所要求的,可以安全地删除。无法解析符号“Bll” 这是Common.Web项目 但它可以成功构建并正常运行。 你有办法解决这个问题吗 更新: 按照@Svek将Common.Bll从netstandard2.0更改为netcor

在vs2017中使用dotnet core 2.0-preview1时。我在项目参考方面出错了

我有两个项目的解决方案



这是
Common.Bll
项目

Common.Web
引用了项目
Common.Bll
。但是ide告诉我找不到
公共。Bll
错误
使用指令不是代码所要求的,可以安全地删除。无法解析符号“Bll”

这是
Common.Web
项目


但它可以成功构建并正常运行。 你有办法解决这个问题吗

更新: 按照@Svek将
Common.Bll
netstandard2.0
更改为
netcoreapp2.0

您的csproj文件 当
TargetFramework
不完全匹配时,VisualStudio不喜欢表现得非常正确

Common.Bll.csproj

<PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
可以找到更多详细信息以重新安装软件包


对未使用库的引用 -更新:您可以忽略此项。您更新的问题使此部分不再适用-

在实际使用库之前,VisualStudio将通知您不需要引用的库

您可以执行以下两种操作之一:

1.)使用您正在引用的库

就你而言:

var obj = new Common.Bll.<Your Class>;
var obj=new Common.Bll。;
2.)删除您正在引用的库

这可以通过右键单击并选择
删除未使用的Usings
快速完成


另一种方法是使用键盘快捷键
Ctrl+R,Ctrl+G

是否可以在尝试引用的
Common.Bll
命名空间下显示
类的代码?在package manager中运行:
更新包-重新安装
。。。运行
更新软件包-重新安装后仍不工作
。csproj文件已添加。在
Common.Bll
中,将
netstandard2.0
更改为
netcoreapp2.0
它正在工作。非常感谢!使用
new Common.Bll.UserBiz()
时,它不起作用。在依赖项中,我们可以找到
Common.Bll
的引用。我已经更新了问题并添加了依赖项。谢谢你先恢复你的包吗?
Update-Package -reinstall
using directive is not required by the code and can be safely removed.
var obj = new Common.Bll.<Your Class>;