所以我一直在Visual Studio Code中開發一個項目C#項目,並且需要使用調試功能。然而,當我運行調試,我得到以下信息:無法讓調試器在Visual Studio代碼中工作?
--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
The specified framework 'Microsoft.NETCore.App', version '1.0.1' was not found.
- Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet\shared\Microsoft.NETCore.App
- The following versions are installed:
1.1.0
- Alternatively, install the framework version '1.0.1'.
The program 'c:\Projects\App1\bin\Debug\netcoreapp1.0\App1.dll' has exited with code -2147450749 (0x80008083).
我原來消息的理解是,我需要改變project.json依賴文件,以便線顯示Microsoft.NETCore版本.App從1.0.1更新爲1.1.0。但是,這似乎沒有任何區別。我試着用Google搜索這個消息,但並沒有真正理解這個討論。任何人都可以爲我指出正確的方向嗎?
如果有任何更多的信息可以提供幫助,請告訴我。
目前,我project.json看起來是這樣的:
{
"version": "1.1.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"testRunner": "xunit",
"dependencies": {
"xunit": "2.2.0-beta2-build3300",
"dotnet-test-xunit": "2.2.0-preview2-build1029"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
//"type": "platform", //remove this line if trying to build a native app via runtime section
"version": "1.1.0"
}
},
"imports": "dnxcore50"
}
},
"runtimes": { //this section allows you to specify runtime for native build output, note these will not generate unless type:"platform" is commented out in dependancies
"win10-x64": {},
"osx.10.11-x64": {}
}
}
這將是可能的,是別人建立了項目模板,我相信他們使用Visual Studio。對不起,密集,但什麼位的依賴應該改變?我嘗試更改框架>依賴關係> Microsoft.NETCore.App下的版本號,然後恢復該項目,我仍然收到相同的消息。 – jamessct
@jamessct檢查project.json文件。應該有幾個對.NET Core版本的引用。 – TanguyB
@jamessct也有可能有一個global.json文件,其中有一個「sdk」版本,也可以更改。 – TanguyB