How to debug asp.net mvc 4 source code?如何调试asp.net mvc4 源代码?

6 篇文章 0 订阅
2 篇文章 0 订阅

I download the latest source code from here:http://aspnetwebstack.codeplex.com/SourceControl/list/changesets

1) add the system.web.mvc project to my Solution including other projects that system.web.mvc project depends on.

https://public.blu.livefilestore.com/y1pWkk8-pYVhCxrqVp3WTurqXOI290cw7uGMfrKYoVDARFINGaaYgENPsoj_U1ukH3plg9O29-YiDkxBuSxMv8JWg/1%201.jpg?psid=1

2) change the reference of system.web.mvc assembly in the "CollaborativeDesign.WebUI","CollaborativeDesign.Domain","CollaborativeDesign.UnitTest" project from the GAC one to the system.web.mvc project.

https://public.blu.livefilestore.com/y1phd1RsSEDGBZU_w6ke0NNw19sa51cXXsYTPB05yhKiNYPq_Hr1kdllejvrxMdDjGBHR0H94GOglRvt-1MUAA7ng/2.jpg?psid=1

3) change the root Web.config file as following show:

https://public.blu.livefilestore.com/y1pKu-Q0K765sayJazkM8OLmC-r-Kj2lkkq5fs6M0Kl6YwN5CtVvKYFzrmdkyj8oMIboOWPpBnDnt5mabIoAZuhTw/3.jpg?psid=1

https://public.blu.livefilestore.com/y1pi3d9IWgFkCpnornqTMs4OQTBdC2IDL3YL2A51DFdjYE4wFcn_-NYKMjLYtl2PjCYedngHZ5sSblOlFj-zIrnUg/4.jpg?psid=1

4) change the Web.config file in the "View" directory as following show:

<!--<pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
  <controls>
    <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
  </controls>
</pages>-->
<pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null">
    <controls>
        <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" namespace="System.Web.Mvc" tagPrefix="mvc" />
    </controls>
</pages>

5) when I run the project, it looks like still using the GAC system.web.mvc.dll, because when I set the breakpoint in the "Controller.cs" file which is in the "system.web.mvc" project, it shows that it doesn't load any symbol for the document, and I also can't step into the method of mvc source code.

https://public.blu.livefilestore.com/y1pgt_xkjJLw3bPFj6R6z2EAyqxCYC4Yk0cfYUe4RCUEkYT9EQPb56CZ1qKVI8_zGBoRe5VcFcRjmNjnc24hFmyDw/5.jpg?psid=1

How can I debug the source code ? How can I know that the loaded system.web.mvc.dll is the GAC one or my local one ?

Accroding to the @Rick.Anderson-at-Microsoft.com's comment, I have been resolve this problem by doing the following additional steps:

1> Run "sn.exe -Vr *,31BF3856AD364E35" in the Visual Command line

2> Change the "AssemblyVersion" and "AssemblyFileVersion" in the CommonAssemblyInfo.cs which is in the System.Web.Mvc project from "4.0.0.0" to "4.0.0.1". Rebuild the project.

3> Change the Web.config file in the root directory

4> Change the Web.config file in the View directory


5> Restart the Asp.net Development Server. Ok, enjoy the source code! Thank @Rick.Anderson-at-Microsoft.com for the comment.


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值