当我创建一个类库(Package)并尝试在我的控制台应用程序(包)中使用它时,intellisense无法在控制台应用程序中找到类或命名空间(来自类库)。
来自类库的project.json:
{
"version": "1.0.0-*",
"description": "ClassLibrary2 Class Library",
"authors": [ "AlexBondo" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"dependencies": {
"System.Collections": "4.0.10-beta-23019",
"System.Linq": "4.0.0-beta-23019",
"System.Threading": "4.0.10-beta-23019",
"System.Runtime": "4.0.10-beta-23019",
"Microsoft.CSharp": "4.0.0-beta-23019"
},
"frameworks": {
"dotnet": { }
}
}
控制台应用程序的project.json:
{
"version": "1.0.0-*",
"description": "ConsoleApp1 Console Application",
"authors": [ "AlexBondo" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"dependencies": {
"ClassLibrary2": "1.0.0-*"
},
"commands": {
"ConsoleApp1": "ConsoleApp1"
},
"frameworks": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"System.Collections": "4.0.10-beta-23019",
"System.Console": "4.0.0-beta-23019",
"System.Linq": "4.0.0-beta-23019",
"System.Threading": "4.0.10-beta-23019",
"Microsoft.CSharp": "4.0.0-beta-23019"
}
}
}
}
我都尝试通过右键单击添加引用 - >添加 - >参考 - > ...并随机编辑控制台应用程序的project.json文件。
请注意,我可以使用类库中的类来构建和运行控制台应用程序 - 它只是有问题的intellisense。
答案 0 :(得分:0)
原来,Resharper搞砸了。关掉它为我修好了。