① ASPNET MVC 应用程序池被回收的时候会执行Dispose方法吗
ASPNET MVC 应用程序池被回收的时候会执行Dispose方法
w3wp.exe就是你的ASP.NET应用宿主,如果你使用了大量的Session、Cache等资源,并且Session超市时间很长,那么内存占用量就比较大。应用池是为增加性能而设的一个特性,但是也消耗很大的内存。另外关掉Windows Server 2003里的大多数Service(那个不用都可以关掉),也可以节省一部分内存
1.怀疑在程序中应用的CACHE,
2.CACHE中有大量的数据
3.频繁刷新CACHE
4.没有设计好CACHE的方式
你的问题我以前也遇见过,我以前是用的Session,后我全部改成cook之后就好多了,应该是你的Session或是你的CACHE有问题(CACHE不太懂,但多多少应该是有的)
② aspnetmvc网站性能怎么样
利用mvc做网站性能都可以满足用户需求。
MVC (Model、View、Controller)将一个Web应用分解为:Model、View和Controller。ASP.NET MVC框架提供了一个可以代替ASP.NETWebForm的基于MVC设计模式的应用。
ASP.NET MVC概述·MVC的优点:
1.通过把项目分成Model、View和Controller,使得复杂项目更加容易维护,减少项目之间的耦合。
2.使用ViewState和服务器表单控件,可以更方便的控制应用程序的行为
3.应用程序通过Controller来控制程序请求,并提供了原生的UrlRouting功能来重写Url。
4.使Web程序对单元测试的支持更加出色
5.在团队开发模式下表现更出众
ASP.NET MVC概述·WebForm的优点:
1.采用事件驱动模式来控制应用程序请求,由大量服务器控件支持
2.采用页面控制机制,可以为单个页面添加事件处理函数。
3.使用ViewState和服务器端页面,使管理页面状态信息更加轻松。
4.对人数较少的想使用服务器端控件的开发团队,使用起来更加方便
5.开发起来比MVC模式要轻松简单一些
ASP.NET MVC概述MVC框架特色:
1.分离任务(输入逻辑,业务逻辑和显示逻辑),易于测试和默认支持测试驱动开发(TDD)。所有MVC用到的组件都是基于接口并且可以在进行测试时进行Mock,你在不运行ASP.NET进程的情况下进行测试,使得测试更加快速和简捷。
2.可扩展的简便的框架。MVC框架被设计用来更轻松的移植和定制功能。你可以自定义视图引擎、UrlRouting规则及重载Action方法等。MVC也支持Dependency Injection (DI,依赖注入) and Inversion of Control (IoC,控制反转)的良好支持。
3.强大的UrlRouting机制让你更方便的建立容易理解和可搜索的Url,为SEO提供更好的支持。Url可以不包含任何文件扩展名,并且可以重写Url使其对搜索引擎更加友好。
4.可以使用ASP.NET现有的页面标记、用户控件、模板页。你可以使用嵌套模板页,嵌入表达式<%=%>,声明服务器控件、模板,数据绑定、定位等等。
5.对现有的asp.net程序的支持,mvc让你可以使用如窗体认证和Windows认证、url认证、组管理和规则、输出、数据缓存、session、profile 、health monitoring、配置管理系统、provider architecture特性。
③ asp.net MVC4.0中几种控制器的区别
http://www.cnblogs.com/xdotnet/archive/2012/03/05/aspnet_mvc40_preview.html
④ asp.net mvc Areas @Url.Content引入文件问题
Url.Content这个方法是获取文件绝对路径的,只对带~的路径有效果;
不使用~没有区别,你可以看MVC中Url.Content的源代码。没有~直接返回传入的路径;
在MVC3中必须写
<script src="@Url.Content("~/Scripts/Controls.js")"></script>
MVC4中只要
<script src="~/Scripts/Controls.js"></script>
还有更多变化,参考:
http://beletsky.net/2012/04/new-in-aspnet-mvc4-razor-changes.html
⑤ 精通Struts2:基于MVC的JavaWeb应用开发实战 pdf
李刚的那本好.我就买了一本.
可以说李刚的那一套一系列的都不错.李刚有本轻量级J2EE企业应用实战.
非常棒,强烈推荐.
我以前买过一本孙卫琴的讲基本MVC的开发,不过是STRUTS1.2的
至于PDF版本的,可以去网络文库搜索下或者去电驴搜索
STRUTS2有本叫权威指南来着,现在应该有STRUTS2.1权威指南,那本可以作为开发人员必备的手册,不适合入门.
这个嘛,得支持正版,有些书保护得比较好,没有流传出PDF的版本.得花钱买网上买了.
⑥ 如何调试MVC4的代码
下载了 http //aspnetwebstack codeplex com/SourceControl/list/changesets 这上面
.NET 4.0 RTM的源码,
装了一个git,然后下载就可以了
git clone https //git01 codeplex com/aspnetwebstack.git
时间稍微长了点儿,半个小时吧;
然后里面src全是MVC4的源码(其实很大一部分都在里面了)
解决反感是runtime.sln的,打开之后,在里面新建一个MVC4的项目,
这里有个问题,我下载的MVC4,在
system.web.mvc项目里Properties\CommonAssembley.cs里,全是5.0.0.0的版本号,
我把他改成了5.0.0.1
#if
ASPNETMVC [assembly: AssemblyVersion("5.0.0.1")] [assembly:
AssemblyFileVersion("5.0.0.1")] [assembly: AssemblyProct("Microsoft ASP.NET
MVC")] #elif ASPNETWEBPAGES
然后修改根目录下的 web.config
<appSettings>
<add
key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
这里之所以改成3.0.0.0的原因,是因为在我下载的源码里,他的版本号就是3.0,
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers"
publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0"
newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc"
publicKeyToken="31bf3856ad364e35" />
<bindingRedirect
oldVersion="1.0.0.0-4.0.0.0" newVersion="5.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages"
publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0"
newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="EntityFramework"
publicKeyToken="b77a5c561934e089" />
<bindingRedirect oldVersion="1.0.0.0-5.0.0.0"
newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease"
publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.3.0.0"
newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime> 这里的改成了我自己的版本号
然后修改view下面的web.config
<configSections>
<sectionGroup name="system.web.webPages.razor"
type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup,
System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35">
<section name="host"
type="System.Web.WebPages.Razor.Configuration.HostSection,
System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages"
type="System.Web.WebPages.Razor.Configuration.RazorPagesSection,
System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
这里修改成了3.0,当然具体是什么,看你自己下载的,但是我觉得大部分应该跟我的是一样的(环境VS2012,源码4.0 RTM)
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory,
System.Web.Mvc, Version=5.0.0.1,
Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter,
System.Web.Mvc, Version=5.0.0.1,
Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc,
Version=5.0.0.1, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc,
Version=5.0.0.1,
Culture=neutral,
PublicKeyToken=31BF3856AD364E35">
同样,修改之(具体是不是不修改也成,我就不知道了,我是按照网上的方法改的,最后的地方,会给出连接大家注意学习吧)
这样,配置文件和MVC代码中的版本号,就修改完了,
然后打开VS2012的命令行,执行
Run
"sn.exe -Vr *,31BF3856AD364E35" in the Visual Command line (哈哈,你看,我真的是COPY的,原创的东西几乎没有)
然后把项目中的system.web.mvc的引用,改到你的MVC4的源码里的项目,当然,不止这一个,不然会有很多地方报错的,大致的DLL有 :
system.web.razot; system.web.webpages;system.web.webpages.deployment;
system.web.webpages.razor; 这里不全没关系,网页上会明确提示少哪个的.
如果出现了一个类型转换的错误:
用户代码未处理
System.InvalidCastException
HResult=-2147467262
Message=[A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为
[B]System.Web.WebPages.Razor.Configuration.HostSection。类型 A
源自“System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35”(在上下文“Default”中的“C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll”位置处)。类型
B 源自“System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35”(在上下文“Default”中的“C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary
ASP.NET
Files\root\49f25bf0\9ce908d5\assembly\dl3\70f2ab4b\b0630cdc_834fce01\System.Web.WebPages.Razor.dll”位置处)。
Source=System.Web.WebPages.Razor
这个错误,就是我为什么要该system.web.webpages的版本好的原因了; 如果出现其他DLL,大家也可以随着改一下;
之后,就可以在页面中随便加空间,就能看到断点的执行了,好运;
⑦ 《ASP.NETMVCinAction》pdf下载在线阅读全文,求百度网盘云资源
《ASP.NET MVC in Action》(Jeffrey Palermo)电子书网盘下载免费在线阅读
链接: https://pan..com/s/1b_TundAEtrBhZNjLf9baMw
书名:ASP.NET MVC in Action
作者:Jeffrey Palermo
出版社:Manning Publications
出版年份:2009-09-10
页数:350
内容简介:
HIGHLIGHT An insider's perspective on the ASP.NET MVC framework, a highly-anticipated proct that forms the basis for the next version of ASP.NET. DESCRIPTION The MVC pattern is widely accepted as the best practice for web development and is at the core of Rails, Zend Framework, and other modern web dev tools. Microsoft's new ASP.NET MVC Framework offers a fully-supported way for developers to implement MVC in ASP.NET. ASP.NET MVC in Action is a comprehensive guide to MVC-based development for Microsoft ASP.NET developers. It offers a clearly-written introction both to the ASP.NET MVC Framework and to the MVC approach. The focus is on creating real, maintainable web applications, guiding readers from first-use through real-life scenarios. ASP.NET MVC in Action shows readers how to test each piece of an ASP.NET application using the principles of test-driven development. This book assumes that readers know how to build a standard ASP.NET application and presents most examples in C#. KEY POINTS Expert insider authors have been working with ASP.NET MVC since well before it was publicly announced Written for the working ASP.N ET developer Introces test driven development and Agile processes - which may be unfamiliar to Microsoft developers MARKET INFORMATION Microsoft's ASP.NET is one of the most popular web development tools available, but it is no longer on the leading edge of innovation. Rails, Django, Seaside, and other frameworks have challenged Microsoft to improve ASP.NET. ASP.NET MVC represents the first major step in ASP.NET in many years, and will be embraced rapidly by ASP.NET developers.
作者简介:
Jeffrey Palermo is a software management consultant and the CTO of Headspring Systems in Austin, TX. Jeffrey specializes in Agile coaching and helps companies double the proctivity of software teams. Jeffrey is an MCSD.Net, Microsoft MVP, Certified ScrumMaster, Austin .Net User Group leader, AgileAustin board member, and an INETA speaker and Membership Mentor. He is an ASP.NET expert and has been working with Microsoft on the MVC framework since the initial prototype in March, 2007.
Ben Scheirman is a Principal Consultant with Sogeti in Houston, Texas. He studied computer science at the University of Houston and is a Certified ScrumMaster and Microsoft Certified Solution Developer. He enjoys speaking and blogging about agile development topics in .NET. Read his blog online at http://www.flux88.com.
Jimmy Bogard is a senior consultant with Headspring Systems in Austin, TX. His focus is using .NET technologies together with Agile methodologies. Back in 2005, he drank the Agile punch and hasn't looked at a waterfall the same since.
⑧ aspnetmvc4下载了为什么打不开
没有安装mvc模板。
模型(Model),模型对象是实现应用程序数据域逻辑的应用程序部件。 通常,模型对象会检索模型状态并将其存储在数据库中。
视图(View),视图是显示应用程序用户界面 (UI) 的组件。 通常,此UI是用模型数据创建的。Procts表的编辑视图便是一个视图示例,该视图基于Proct对象的当前状态显示文本框、下拉列表和复选框。
控制器(Controller),控制器是处理用户交互、使用模型并最终选择要呈现的视图来显示UI的组件。在MVC应用程序中,视图仅显示信息;控制器则用于处理和响应用户输入和交互
⑨ asp.net(mvc) 如何知道mvc版本
找到这个页面 packages.config,点开之后,这里可以看到版本
<packageid="Microsoft.AspNet.Mvc"version="5.2.3"targetFramework="net461"/>