在Visual Studio 2017 RC中调试ASP.Net Core 1.1 MVC源代码

潘卡·卡帕雷

使用global.json文件可以很容易地在Visual Studio 2015中调试ASP.Net Core MVC源代码。有没有人尝试在Visual Studio 2017 RC中调试ASP.Net Core MVC源代码?VS 2017 RC完全有可能吗?可以在VS 2017 RC中成功调试MVC源代码的人列出以下步骤吗?

更新:我尝试设置符号源,如曾在评论中提到的。但是,它仍然无法加载符号。它甚至没有搜索符号源https://nuget.smbsrc.net/以下是符号服务器设置。在此处输入图片说明

以下是提琴手的屏幕截图。 在此处输入图片说明

麦克劳德

It is possible to debug the asp.net core 2.0 source code in Visual Studio 2017. We have to follow the next steps:

  1. If we have already downloaded Visual Studio 2017, we check that our version is at least 15.3 (help -> about Microsoft visual studio). If it is not, then we update by clicking the yellow flag in the right upper corner. We might also have to download the SDK version 2.0 separately.

    After updating visual studio 2017, we open command prompt and we execute the command dotnet --version to identify the current SDK version. If it is prior than 2.0.0 version, then we have to also download the latest SDK version release. We can also check any older installed versions of SDK in C:\Program Files\dotnet\sdk.

  2. The required packages for master branch in asp.net core open source code in github must be downloaded from myget.org repository. The default nuget.org repository is not the appropriate one. Thus we go to tools -> nugget package manager -> package manager settings -> nugget package manager -> package sources and we click the plus (+) button to add the two new repositories. The required package repository for SDK is https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json, while the package repository for master branch is https://dotnet.myget.org/F/aspnetcore-master/api/v3/index.json. We click update for each of the new repository and then we OK.

  3. We go to github.com/aspnet and supposing that we want to debug the MVC source code, we click on MVC link and then we click on releases link. We download the release 2.0.0 with tag rel/2.0.0.

  4. We unzip the file and we go to src folder. In all the project folders inside src folder, we have to change the inner text of the <TargetFramework> xml node in each of the *.csproj files, from netstandard2.0 to netcoreapp2.0. The change should be the following one:

    <TargetFramework>netcoreapp2.0</TargetFramework>

  5. We create a new asp.net core 2.0 project in Visual Studio 2017. We have to pay attention to select asp.net core 2.0 in the next Window because the default selection is asp.net core 1.1.

    asp.net core 2.0 selection

  6. In our new created asp.net core 2.0 project, we have to add a project reference in {project_name}.csproj file. We right click the project in solution explorer and select edit {project_name}.csproj. We add the following xml text inside it:

<ItemGroup> <ProjectReference Include="{mvc_solution_directory_path}\src\Microsoft.AspNetCore.Mvc\Microsoft.AspNetCore.Mvc.csproj" /> </ItemGroup>

{mvc_solution_directory_path} is the directory path where we unzipped the source code from github and where the mvc.sln file is located.

  1. 现在,我们必须添加位于开源代码src文件夹中的每个项目MVC我们在解决方案资源管理器中右键单击我们的解决方案,然后选择add -> existing project

  2. 我们准备建立我们的解决方案。

尝试asp.net core 1.1通过从github下载相应的开源版本进行调试是很成问题的。我已经将一个小型实用程序上传到github,该实用程序可以自动执行第4步至第7步。我希望本指南对您有所帮助。我在Windows 7和Windows 10中都对其进行了测试,并且能够调试开源代码。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Visual Studio 2017(.NET Core)中的自动版本控制

添加在Visual Studio 2017 RC中构建.NET Core项目后运行的msbuild任务

使用Visual Studio 2017 MVC ASP.NET Core发布“它们必须具有相同数量的项目”

如何在Visual Studio 2017 RC中创建F#.Net Core ConsoleApp

在Visual Studio 2017 RC中无法识别ASP.NET MVC 4项目

Visual Studio 2017中的ASP.NET Core标记帮助器Intellisense

如何在Visual Studio 2017中调试.NET 4.6框架源代码?

在Visual Studio 2017中设置.NET Core MVC应用程序以使用完整的IIS(不是IIS Express)

如何在Visual Studio 2017中包含.Net Core 2.0

Visual Studio 2017中.NET Core 2.0项目的代码覆盖率

如何在Visual Studio 2017 Mac中调试.NET Core /标准单元测试?

无法在Visual Studio 2017中建立「Asp.Net Core Web应用程式」

如何将.NET Framework 3.5 SP1安装到Visual Studio 2017中

Visual Studio Enterprise 2017预览版15.7中的ASP.NET Core 2.1

Visual Studio 2017目标框架中未列出的ASP Net Core 2.1

Visual Studio 2017无法创建目录,mkdir退出代码:1

无论如何,是否可以通过Visual Studio Code调试.NET Core源代码?

如何增加在Visual Studio 2017中运行.NET Core 1.x / 2.x测试的堆大小?

Visual Studio 2015中的ASP.NET Core MVC 2.0

Visual Studio 2017中的空白ASP .NET Core Web应用程序项目

如何在Visual Studio 2017专业版中启用ASP.Net Core 2.2

在Visual Studio 2017中调试.Net Core Console App

Webpack Visual Studio 2017 .NET Core 2.2捆绑的Chrome中的调试打字稿

.NET Core 3 rc1到最终升级:Visual Studio 2019中缺少

Visual Studio Code .Net Core调试错误'源代码与原始代码不同'

为什么在从Visual Studio调试ASP.NET Core源代码时无法在堆栈中间看到局部变量

Visual Studio 2015 .Net Core RC2工具预览1

更改“applicationUrl”后,ASP .Net Core MVC 路由在 Visual Studio 2017 中不起作用

Visual Studio 2017“ASP.NET Core Web 应用程序(.NET Core)”模板丢失