Luuuukke.NET

Bugs, headache, lost hairs... I love IT

Blog Engine, Windows Live Writer & Code formatting..

clock September 18, 2010 17:16 by author Luuuukke

Although the post editor is correct in Blog Engine.NET, it comes to a headache when you want to format code snippets…

Here is the perfect solution, that will take you 10’ to setup… and hours to enjoy :

Now to paste a nicely formatted code, just copy in Visual Studio, and paste with the plug-in button in Live Writer…

image

 

And get the easy cool formatted code…

    Sub Application_OnStart()
        
        If ConfigurationManager.AppSettings("AutomaticallyEncryptConnectionStrings") Is Nothing _
        OrElse CType(ConfigurationManager.AppSettings("AutomaticallyEncryptConnectionStrings"), Boolean) = True Then
            
            ' check that web.config connection is encrypted
            Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration(HttpRuntime.AppDomainAppVirtualPath)
            Dim section As ConfigurationSection = config.GetSection("connectionStrings")
            If (section.SectionInformation.IsProtected) = False Then
                section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider")
                config.Save()
            End If
        End If
                   
    End Sub

 

Enjoy !



A great Theme for BlogEngine.NET : portraitpress

clock August 3, 2010 12:12 by author Luuuukke

I also migrated my personal blog (Luuuukke.com) from dasblog to BlogEngine...
No time to design my own theme, so i lazily picked up one i like in the Mega pack.
PortraitPress from OneSoft (thanks !)

There was a small bug in the site.master code, causing the header to render incorrectly


That was just a missing closing tag on an anchor in the masterpage
<div id="rss-big">
<a href="<%=Utils.FeedUrl %>" class="feed">
</div>


Adding the closing anchor tag fixed the issue.

<div id="rss-big">
<a href="<%=Utils.FeedUrl %>" class="feed"></a>
</div>

 



Problem building your blog with a Web Deployment Project ?

clock August 3, 2010 11:10 by author Luuuukke

The problem when builiding with Visual Studio and a Web Deployment Project:

Error 8 An error occurred when merging assemblies: ILMerge.Merge: 
ERROR!!: Duplicate type 'site' found in assembly 'App_Web_ilcyydph'. 
aspnet_merge 1 1 Website_deploy

 

This comes becauses some page classes have the same name...
Seach for the duplicate name in the whole site... and rename a class...

In my case, i added all Themes from the Mega Pack in my test blog,
some masterpages inherits classes with the same name:

<%

@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="site" %>

base class: public  partial class site : System.Web.UI.MasterPage

 

Renaming classes does the trick:

<%

@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="ZZZsite" %>

public  partial class ZZZsite : System.Web.UI.MasterPage

 

Et hop online Cool



First post on live server

clock August 3, 2010 02:15 by author Luuuukke

After a few hair lost... BlogEngine is finally running on the production server...

IIS6... not 7, so i had to install the asp.net MVC,
http://www.microsoft.com/downloads/details.aspx?FamilyID=c9ba1fe1-3ba8-439a-9e21-def90a8615a9&displaylang=en

and then added a wildcard mapping to have IIS pass all requests to asp.net
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5c5ae5e0-f4f9-44b0-a743-f4c3a5ff68ec.mspx?mfr=true

  1. In IIS 6, go to the Application Configuration Properties for your ASP.NET MVC web application.
  2. Click "Insert..." in the Wildcard application maps section.
  3. Set the Executable to the path of the aspnet_isapi.dll (on my machine this is c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll).
  4. Make sure NOT to check the "Verify that file exists" and click "OK".

After all of this, the Blog was still crashing...

Even after disabling the Custom Errors in the web.config
<customErrors mode="Off" />

I still did get the nice oops error message of BlogEngine. Yell

I tried the trick to disallow inheritance for the whole system.web
http://www.colincochrane.com/post/2007/11/15/Disabling-Configuration-Inheritance-For-ASPNET-Child-Applications.aspx

<location path="." inheritInChildApplications="false">
  <system.web>
  ...
  </system.web>
</location>

No success

Only after enabling  <enableerrorlogging>True</enableerrorlogging>
in the /App_Data/settings.xml, i was finally able to retrieve the error from the file /App_Data/logger.txt !!!

Error message :

Could not find a part of the path 'X:\WebData\Websites\Luuuukke.NET\App_Data\profiles'. Sealed

wtf !!! all this for a missing empty directory (Visual.Studio did not include the App_Data/Profile folder in the web deployment because it was empty.... grrrrrrr)
anyhow, i created an empty "profile" folder in App_Data, and...

it's online now !!

 



BlogEngine, using aspnet SQL Membership & Roles Providers

clock August 2, 2010 00:10 by author Luuuukke

It is so easy to use the aspnet built-in SQL Providers...

Create the aspnet database (aspnet_regsql at a command prompt)
Insert the SQL Connection in your Blog Web.Config,
Set the SQL defaultProviders,
Create Roles "Administrators" & "Editors", a default Admin account and you're done...
http://blogengine.codeplex.com/wikipage?title=MSSQLMembershipRoleProvider - Watch the videos

Create the first users & roles?
Use the built-in Membership Administration Website (VS.NET: Website, ASP.NET Configuration)



BlogEngine, finally

clock July 30, 2010 23:57 by author Luuuukke

DasBlog community was quite sleeping those days,
and after spending some time looking for a new Blog, i finally landed at BlogEngine.NET.
http://www.dotnetblogengine.net

I juste played for 4 days and it really really rocks !

Here are some resources i found interesting for my first steps into BlogEngine, hope it helps...

Wordpress or BlogEngine.NET ?
http://vunty.com/blogging/blogengine-net-vs-wordpress/
BE of course, anyhow, i'll migrate Wordpress themes to BE !!

Migration from DasBlog, in a few minutes, thanks to :
http://merill.net/2008/02/migrated-from-dasblog-to-blogenginenet/
http://elijahmanor.com/webdevdotnet/post/Migrated-from-dasBlog-to-BlogEngineNET.aspx



Sign in