24 Eylül 2013 Salı

asp.net mvc bundle 403 hatası

Merhaba,
Asp.Net MVC uygulamalarımızda bundle kullandığımız zaman, bundle ismi fiziksel bir path ile aynı olursa css veya js isteklerine 403 forbidden cevabı dönüyor.
Bunun sebebi ilk olarak IIS handler’ların çalışması ve fiziksel dizine isteğin yönlendirilmesi.
Çözüm basit;
bundle ismini değiştirin (önerilen) veya aşağıdaki alıntıda yer alan B maddesini uygulayın. İstekleri .Net karşılasın.
This issue is by default .NET does not "process" requests that have a .js or .css extension.
There are two fixes for this (you only need to do ONE)
A) Remove the extensions from the bundle names. (recommended) This will cause .NET to process the request and run it through the BundleModule.
B) Add this to your web.config in the 
system.webServer section which will cause .NET to run .js and .css requests through the BundleModule.
<modules runAllManagedModulesForAllRequests=
"true">
 <remove name="BundleModule" />
 <add name="BundleModule" type="System.Web.Optimization.BundleModule" />
</
modules>
Big shout out to Ray Moro who figured out the actual cause and shared it with me on my blog:http://blog.cdeutsch.com/2012/11/fixing-404-errors-for-aspnet-mvc-apps.html
 

18 Eylül 2013 Çarşamba

Asp.Net 4.5 Kurulumu Ardından Ajax Isteklerinde Yaşanan Bir Hata

Merhaba,

 

Web sunucularimiza .Net Framework 4.5 kurduktan sonra ilginc bir problem yasamaya basladik.

Bazi IE9 ve alti kullanan userlarin browserlarinda kitlenmeler olustu. Ayni senaryoyu farkli bowserlar ile denedikleri zaman sıkıntı yasamadilar (chrome, IE10 gibi).

Konuyu arastırdigimizda sorunumuza en uygun asagidaki linke ulastık.

 

http://stackoverflow.com/questions/15437524/managedpipelinehandler-for-an-ajax-post-crashes-if-an-ie9-user-navigates-away-fr

 

Yine bu linkte yer alan asagidaki cozumu uyguladik ve hata tekrar yasanmadi.

<system.webServer>
<serverRuntime uploadReadAheadSize="0" />
</system.webServer>


How to set the uploadReadAheadSize in IIS 7.5

  1. Launch "Internet Information Services (IIS) Manager"
  2. Expand the Server field
  3. Expand Sites
  4. Select the site you want to make the modification for.
  5. In the Features section, double click "Configuration Editor"
  6. Under "Section" select: system.webServer>serverRuntime
  7. Modify the "uploadReadAheadSize" section
  8. Click Apply

 

4.5 icin bu tip sorunlari cozen bir fix/patch var mi diye arastirdigimizda;

 

Download yapilamayan bir hotfix rollup;

http://support.microsoft.com/kb/2828841/en-us

 

Bir update paketi;

http://www.microsoft.com/en-us/download/details.aspx?id=36359

 

ve asagidaki bilgilerle (4.5.1 preview);

 

ile karsilastik.

Isterseniz fix’i kurabilir, isterseniz uploadReadAheadSize değerini değiştirip devam edebilirsiniz.

 

Serkan