BlogEngine.NET HTTP 404.3 cshtml Handler not registered in Shared Hosting

by Sven 26. July 2011 09:51

I am running BlogEngine.NET in a shared hosting environment and had the following problem after upgrading to Version 2.5:

BlogEngine25_Error

HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

The solution is, to add the following handlers to web.config:

<system.webServer>
  <handlers>
    <add name="cshtml-ISAPI-4.0_32bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" 
         modules="IsapiModule" 
scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="cshtml-ISAPI-4.0_64bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule"
scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> <add name="cshtml-Integrated-4.0" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler"
preCondition="integratedMode,runtimeVersionv4.0" /> </handlers> </system.webServer>

That’s it!

Async WCF calls with impersonation

by Sven 24. March 2010 10:58

I was playing around with impersonated asynchronous WCF calls and discovered a strange behaviour on the WCF server side: most of the time the identity was the correct impersonated identity but sometimes it was only the client process identity (like 'hostname$'). I was looking at all different configuartion hells of WCF but did not find any solution to fix the problem.

After searching the web I found two interesting posts from Micorosft:

http://msdn.microsoft.com/en-us/library/aa738624.aspx

and

http://support.microsoft.com/?scid=kb%3Ben-us%3B976123&x=10&y=14

The first document stated that I am trying to use an unsupported scenario. The second document says that there is a hotfix available for Vista and Windows Server 2008 (SP2 and higher).

Unfortunately my customer is running Windows 2003 SP2. So there seems to be no way to use async WCF calls with impersonation. Very sad.

Tags:

.NET | ASP.NET | Coding

Reportviewer: The report definition is not valid. Details: Data at the root level is invalid. Line 1, position 1.

by Sven 20. January 2010 14:11

Nach dem Deployen (Web Deployment Project) von lokalen rdlc Reports aus Visual Studio 2008 heraus, gab es auf dem IIS folgenden Fehler:

[ReportProcessingException: The report definition is not valid.  
Details: Data at the root level is invalid. Line 1, position 1.]

[DefinitionInvalidException: The definition of the report
'Main Report' is invalid.]

 

Das Problem ist, dass die Reports vorkompliliert werden, was leider kontraproduktiv ist. Durch ergänzen der csproj Datei für das Deploy kann der Fehler umgangen werden:

<Target Name="AfterBuild">
  <Delete Files="$(OutputPath)\Reports\Report.rdlc" />
  <Copy SourceFiles="$(SolutionDir)WebSites\MyWebApp\Reports\Report.rdlc" 
        DestinationFolder="$(OutputPath)\Reports" />
< /Target>

 

Tags:

.NET | ASP.NET

ASP.NET Performance von Visual Studio steigern

by Sven 16. April 2009 14:23

Visual Studio verlangt nach schnellen Festplatten. Je schneller, desto besser. Nichts ist allerdings so schnell wie eine RamDisk. Wer glaubt, dass die RamDisk eine Sache aus der alten DOS-Zeit ist, der irrt. Speicher ist billig und 64 Bit Betriebssysteme sind auch schon fast Mainstream (na ja, noch nicht so ganz).

Was liegt also näher, die brach liegenden Megabytes des RAMs als RamDisk zu nutzen. Unter Vista x64 nutze ich die RAMdrive von QSoft, welche sich recht komfortabel über den Gerätemanager einstellen lässt. Zur Zeit nutze ich 1GB als Laufwerksgröße.

Damit nun ASP.NET Projekte diese RamDisk nutzen können, muß in der machine.config das tempDirectory angepasst werden:

<compilation tempDirectory="R:\Temp\aspnet"/>


Details zu diesem Eintrag findet sich bei MSDN.

Weiterhin lassen sich auch das Cache-Verzeichnis vom FireFox oder IE auf die RamDisk legen, um die Performance zu steigern.

Page Events feuern nicht

by Sven 24. September 2007 14:05

Wieder mal ein Fehler der Kategorie: Aua!

Auf einer ASP.NET Seite sitzt ein Button und nach der Umstellung der Anwendung von .NET 1.1 auf .NET 2.0 feuern die Events der Seite nicht mehr... nach ziemlich langem herumprobieren stellte sich die folgende Zeile im Header als Übeltäter heraus:<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
    font-size: small;
    color: black;
    font-family: Consolas, "Courier New", Courier, Monospace;
    background-color: #ffffff;
    /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt
{
    background-color: #f4f4f4;
    width: 100%;
    margin: 0em;
}

.csharpcode .lnum { color: #606060; }
</style>
<pre class="csharpcode">
<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">language</span><span class="kwrd">="javascript"</span> <span class="attr">src</span><span class="kwrd">="JavaScript/General.js"</span>
<span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">/&gt;</span></pre>Nach Umstellen auf <!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
    font-size: small;
    color: black;
    font-family: Consolas, "Courier New", Courier, Monospace;
    background-color: #ffffff;
    /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt
{
    background-color: #f4f4f4;
    width: 100%;
    margin: 0em;
}

.csharpcode .lnum { color: #606060; }
</style>
<pre class="csharpcode">
<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">language</span><span class="kwrd">="javascript"</span> <span class="attr">src</span><span class="kwrd">="JavaScript/General.js"</span>
<span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="kwrd">&gt;&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>
</pre>
feuerten auch wieder die Events!

Ich bin eigentlich ein Freund der kurzen Schreibweise der Tags, doch hier scheint mehr mal wieder mehr zu sein...

 

Tags:

ASP.NET

Page List

My latest Flickr Photos

www.flickr.com

Shared items - Google Reader

Instagram Pictures