我正在Visual Studio 2015 Update 3中開發一個.net核心/ asp.net核心應用程序,該應用程序在Azure的net46框架上運行。我在我的解決方案中有幾個項目文件,其中一些是用dotnet核心編寫的,其中一些是從另一個解決方案(dotnet 4.6)導入的。引用非dotnet核心項目時Intellisense不起作用
我的解決方案構建並運行良好,但Intellisense(也運行ReSharper)將紅色波浪線放在引用非核心庫的代碼下面。
我project.json看起來是這樣的:
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-final",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-final",
"Autofac": "4.0.0-rc2-240",
"Autofac.Extensions.DependencyInjection": "4.0.0-rc2-240",
"AutoMapper": "4.2.1.0",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.0-rc2-final",
"Microsoft.ApplicationInsights.TraceListener": "2.0.0",
"XXX.SystemCore": "1.0.0-*",
"XXX.Services": "1.0.0-*"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview2-final"
}
},
"frameworks": {
"net46": {
"dependencies": {
"XXX.SystemCore": {
"target": "project"
}
}
}
},
"publishOptions": {
"include": [
"wwwroot",
"appsettings.json",
"web.config"
]
},
"runtimeOptions": {
"gcServer": true
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
以下項目的非核心的:
"XXX.SystemCore": "1.0.0-*",
"XXX.Services": "1.0.0-*"
它們也包括在其他的解決方案,所以我不能只是轉換他們要核心。
的包裝,project.json看起來是這樣的:
{
"version": "1.0.0-*",
"frameworks": {
"net46": {
"bin": {
"assembly": "../../../XXX.SystemCore/obj/{configuration}/XXX.SystemCore.dll",
"pdb": "../../../XXX.SystemCore/obj/{configuration}/XXX.SystemCore.pdb"
}
}
}
}
請,我怎麼可以刪除所有從引用的項目紅色波浪線? :-)
是否有有紅線的任何錯誤信息?你有沒有嘗試引用它們只有一次(全球對守衛)? – Thomas
我在github上發現了一個目前尚未解決的問題,它討論了這個問題:https://github.com/aspnet/Tooling/issues/565 ...所以我想這是一個錯誤。 –