2017-02-27 64 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

相关问题