Hello,
I've been working on an ASP.NET MVC 4 project for some months now, and it's been growing in size. Everything I know today about ASP.NET MVC comes from developing this project and because of that the project really needs a big refactoring.
To start, I've been cleaning my web.config file, that was clustered with stuff I didn't know what was the purpose. But, I still have some doubts about some of the things that are there:
1. What's the purpose of this? I know I use Telerik, but I don't know why may I need that reference in the Web.Config. I remove it and everythins seems to work just fine.
<httpHandlers><add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" /></httpHandlers>
2. On my <system.webServer> I have this, and I also don't know what's the purpose if whether I can just remove it or not.
<urlCompression doStaticCompression="true" doDynamicCompression="true" /><validation validateIntegratedModeConfiguration="false" /><handlers><remove name="asset" /><add name="asset" preCondition="integratedMode" verb="GET,HEAD" path="asset.axd" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" /><remove name="ExtensionlessUrlHandler-Integrated-4.0" /><remove name="OPTIONSVerbHandler" /><remove name="TRACEVerbHandler" /><add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /></handlers>
3. Is there a way to put all runtime assembly bindings in an external config file? When I do it like:
<runtime configSource="Config\runtime.config" />
I get the following error:
Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxx' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I understand that some things may seem basic but I want to understand everything I have on my project and do things right this time. Thanks!