简体   繁体   English

ASP.NET VNext调试MVC源

[英]ASP.NET VNext Debugging MVC Source

I followed the blog post of Imran Baloch where he shows how you can debug into ASP.Net MVC VNext. 我关注了Imran Baloch博客文章,在那里他展示了如何调试ASP.Net MVC VNext。

I used a VM in Azure where Vs 2014 is installed. 我在安装了Vs 2014的Azure中使用了一个VM。 在此输入图像描述

I created the global solution folder and placed a global.json file in it where I specified the folder containing the current MVC source cloned from https://github.com/aspnet/Mvc/tree/dev/src . 我创建了全局解决方案文件夹并在其中放置了一个global.json文件,我在其中指定了包含从https://github.com/aspnet/Mvc/tree/dev/src克隆的当前MVC源的文件夹。 When I try to compile the solution I get a lot of errors because of missing references. 当我尝试编译解决方案时,由于缺少引用,我得到了很多错误。

在此输入图像描述

Did anybody try out the method proposed in the blog post? 有人试过博客文章中提出的方法吗? What am I doing wrong? 我究竟做错了什么?

I'm shooting blind here because adding the sources to global.json works fine for me. 我在这里盲目,因为将源添加到global.json对我来说很好。

Try adding a NuGet.config file to your solution with the following content: 尝试使用以下内容将NuGet.config文件添加到您的解决方案:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
   <packageSources>
     <add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/" />
     <add key="NuGet.org" value="https://nuget.org/api/v2/" />
   </packageSources>
</configuration>

Also, try doing running kpm restore at the root of your solution folder. 另外,尝试在解决方案文件夹的根目录下运行kpm restore

If this doesn't help, please add a little more information like KRE version, what is in your <user profile>\\.kre or <user profile>\\.kpm folders 如果这没有帮助,请添加更多信息,例如KRE版本, <user profile>\\.kre<user profile>\\.kpm文件夹中的内容

add ' http://www.myget.org/F/aspnetvnext/api/v2 ' to tools -> options -> nuget package manager -> package sources 将' http://www.myget.org/F/aspnetvnext/api/v2 '添加到工具 - >选项 - > nuget包管理器 - >包源

在此输入图像描述

I just ran: git clone https://github.com/aspnet/Mvc.git kvm upgrade kpm restore 我刚刚运行:git clone https://github.com/aspnet/Mvc.git kvm upgrade kpm restore

Then I opened the mvc solution in vs2014 ctp2 and it opened and compiled correctly. 然后我在vs2014 ctp2中打开了mvc解决方案,它打开并正确编译。 I think that your project.json has version numbers in there which do not match the version numbers used in your cloned version of mvc. 我认为你的project.json中的版本号与你克隆的mvc版本中使用的版本号不匹配。 Microsoft changed the version numbers some time ago. 微软前一段时间更改了版本号。

The cloned version of mvc on my box uses Microsoft.AspNet.FileSystems version 1.0.0-*, which is not included in the mvc source and is a package reference. 我的盒子上克隆的mvc版本使用的是Microsoft.AspNet.FileSystems版本1.0.0- *,它不包含在mvc源代码中,是一个包引用。 It also used Miccrosoft.AspNet.Mvc.Common version "", which is a source code reference. 它还使用了Miccrosoft.AspNet.Mvc.Common版本“”,这是一个源代码参考。 You could try to adjust your project.json to match the numbers. 您可以尝试调整project.json以匹配数字。

HTH, Bart HTH,巴特

And perhaps to answer yourself to your question you may need to read this article: 也许为了回答你自己的问题,你可能需要阅读这篇文章:

http://blogs.msdn.com/b/webdev/archive/2015/02/06/debugging-asp-net-5-framework-code-using-visual-studio-2015.aspx http://blogs.msdn.com/b/webdev/archive/2015/02/06/debugging-asp-net-5-framework-code-using-visual-studio-2015.aspx

Mixing different versions (yes, ASP.NET 5 / MVC 6 is still a moving target!) may lead to very annoying results. 混合不同版本(是的,ASP.NET 5 / MVC 6仍然是一个移动目标!)可能会导致非常烦人的结果。 Read and see. 阅读并看到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM