ReSharper "Cannot resolve symbol" 全新 dnx 解决方案中的项目之间
ReSharper "Cannot resolve symbol" between projects in brand-new dnx solution
我的设置:
- VisualStudio 2015 更新1
- ReSharper 终极版 9.2
- dnvm 版本 1.0.0-rc1-update2 clr x86
到目前为止我做了什么:
我用 2 个项目创建了一个全新的解决方案:
- Visual C#/Web -> “Class 库(包)
- Visual C#/Web -> “控制台应用程序(包)
并向控制台应用程序添加了 class 库的引用。
class 库的 project.json 如下所示:
{
"version": "1.0.0-*",
"description": "DnxExampleClassLibrary Class Library",
"authors": [ "John Doe" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"net451": { },
"dotnet5.4": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Runtime": "4.0.21-beta-23516",
"System.Threading": "4.0.11-beta-23516"
}
}
}
}
控制台应用程序的 project.json 如下所示:
{
"version": "1.0.0-*",
"description": "DnxExampleConsoleApp Console Application",
"authors": [ "John Doe" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"DnxExampleClassLibrary": "1.0.0-*"
},
"commands": {
"DnxExampleConsoleApp": "DnxExampleConsoleApp"
},
"frameworks": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Console": "4.0.0-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Threading": "4.0.11-beta-23516"
}
}
}
}
现在,当我尝试在我的 Main
函数中创建 Class1 的实例(即在 class 库项目中)时,ReSharper 告诉我,它不能解析符号。
项目编译,当我暂停 ReSharper 时,一切看起来都很好。
我也试过 "ReSharper/Options -> Environment/General -> Clear Caches" 但这也没有解决问题。
我做错了什么?请帮忙。
尝试安装 ReSharper 10.1 EAP build, the following issues have been fixed there: one, two, three。所以它应该支持最新的 dnx 版本(ReSharper 9.2 不支持“1.0.0-rc1-update2”,因为 R# 9.2 版本大约在 9 个月前发布)。
我的设置:
- VisualStudio 2015 更新1
- ReSharper 终极版 9.2
- dnvm 版本 1.0.0-rc1-update2 clr x86
到目前为止我做了什么:
我用 2 个项目创建了一个全新的解决方案:
- Visual C#/Web -> “Class 库(包)
- Visual C#/Web -> “控制台应用程序(包)
并向控制台应用程序添加了 class 库的引用。
class 库的 project.json 如下所示:
{
"version": "1.0.0-*",
"description": "DnxExampleClassLibrary Class Library",
"authors": [ "John Doe" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"net451": { },
"dotnet5.4": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Runtime": "4.0.21-beta-23516",
"System.Threading": "4.0.11-beta-23516"
}
}
}
}
控制台应用程序的 project.json 如下所示:
{
"version": "1.0.0-*",
"description": "DnxExampleConsoleApp Console Application",
"authors": [ "John Doe" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"DnxExampleClassLibrary": "1.0.0-*"
},
"commands": {
"DnxExampleConsoleApp": "DnxExampleConsoleApp"
},
"frameworks": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Console": "4.0.0-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Threading": "4.0.11-beta-23516"
}
}
}
}
现在,当我尝试在我的 Main
函数中创建 Class1 的实例(即在 class 库项目中)时,ReSharper 告诉我,它不能解析符号。
项目编译,当我暂停 ReSharper 时,一切看起来都很好。
我也试过 "ReSharper/Options -> Environment/General -> Clear Caches" 但这也没有解决问题。
我做错了什么?请帮忙。
尝试安装 ReSharper 10.1 EAP build, the following issues have been fixed there: one, two, three。所以它应该支持最新的 dnx 版本(ReSharper 9.2 不支持“1.0.0-rc1-update2”,因为 R# 9.2 版本大约在 9 个月前发布)。