启用导航到反编译源 支持vs 2017以上版本
一、开启“启用导航到反编译源”
“工具”>“选项”>“文本编辑器”>“C#”>“高级”>“启用导航到反编译源(试验)”
启用完成后,就可以使用快捷键F12查看源代码
二、举例说明:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Study.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View("/login.cshtml");
}
}
}
1.“启用导航到反编译源”状态未开启
通过点击View右键,转到定义,或者使用快捷键F12,不能查看View源码的实现过程
2.“启用导航到反编译源”状态已开启
通过点击View右键,转到定义,或者使用快捷键F12,可以查看View源码的实现过程