2017-02-27 61 views
0

所以我一直在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": {} 
    } 
} 

回答

1

您的應用期待1.0.1版本的.NET核心的,而你在版本1.1.0實際運行。我猜你在Visual Studio 2015中創建了一個項目,然後嘗試在Visual Studio Code中進行調試?

如果是這樣,請將project.json中的版本更改爲1.1.0,dotnet恢復,構建並重新運行。

的Visual Studio 2015年使用與1.0.1版本工具包,而.NET核心CLI是1.1.0,所以更新您的項目依賴於1.1.0 &恢復

+0

這將是可能的,是別人建立了項目模板,我相信他們使用Visual Studio。對不起,密集,但什麼位的依賴應該改變?我嘗試更改框架>依賴關係> Microsoft.NETCore.App下的版本號,然後恢復該項目,我仍然收到相同的消息。 – jamessct

+0

@jamessct檢查project.json文件。應該有幾個對.NET Core版本的引用。 – TanguyB

+0

@jamessct也有可能有一個global.json文件,其中有一個「sdk」版本,也可以更改。 – TanguyB

相關問題