![](/img/trans.png)
[英]C# error in Visual Studio 2017 for a Console Project and cannot find debugging options
[英]Visual Studio 2017 error: Cannot find project info for “” This can indicate a missing project reference - with Console App .NET Core 2.1
這里的問題是,無論出於何種原因,如果以下情況屬實,.NET Core Console應用程序將因我收到的錯誤而失敗 :
然后,在路徑中添加一個新的標准類庫項目Standard.Project.cproj:
a) D:\Rubbish\slnStandard\Standard.Project <== Will Compile in slnStandard
b) D:\Rubbish\slnStandard\SubFolder\Standard.Project <== Will Compile in slnStandard
創建第二個解決方案slnSecond並添加一個名為MySolutionFolder的解決方案文件夾。 從上面的1(兩個版本)添加Standard.Project.cproj。 slnSecond將編譯
將一個MSTest .NET Core Console應用程序添加到slnSecond。 然后使用2中添加的內容“添加引用”>項目。
如果參考是1b)它將不會編譯。 所以基本上你需要保持文件夾結構平坦。 希望這將在前進中得到修復。
只需嘗試使用Dotnet CLI 2.1版本運行“build”或“restore”命令。 從命令窗口
c:\\ path> dotnet restore [.net core 2.1 console] .csproj
如果您使用visual studio切換TargetFramework,則可能需要一次。 從.net core 2.0到2.1,反之亦然
如果您可以從dotnet CLI命令“build”構建控制台項目。 並且您只在visual studio中收到此錯誤。
請嘗試使用dotnet“sln”和“add”命令創建解決方案以引用項目。
當從具有空格“%20”的git克隆路徑時,這發生在我身上。 刪除空格后,它在Visual Studio 2017中沒有出現問題。有趣的是,我在JetBrains Ryder中遇到了同樣的問題,但沒有命令行( dotnet build )。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.