简体   繁体   中英

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.

I used a VM in Azure where Vs 2014 is installed. 在此输入图像描述

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 . 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.

Try adding a NuGet.config file to your solution with the following content:

<?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.

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

add ' http://www.myget.org/F/aspnetvnext/api/v2 ' to tools -> options -> nuget package manager -> package sources

在此输入图像描述

I just ran: 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. 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. 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. It also used Miccrosoft.AspNet.Mvc.Common version "", which is a source code reference. You could try to adjust your project.json to match the numbers.

HTH, Bart

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

Mixing different versions (yes, ASP.NET 5 / MVC 6 is still a moving target!) may lead to very annoying results. Read and see.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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