Feed
Google+
Contact
XING
LinkedIn
Twitter
ICQ
meebo.com

BlogEngine.NET - error in the on and turn off extensions

by Roland Schumacher alias GENiALi 16. August 2010 -- 208 words  -- 1 mal gelesen

If hide in BlogEngine.NET an extension or is turned on a message that one tells that on the Web.config cannot be changed. This is because that the extension manager is trying a change in status of an extension, to start the blog. That slightly modifies the Web.config will be tried. Whenever the Web.config, the Web is automatically restarted.

To prevent the error, one would have to give the account, which runs the Web, write rights to the Web.config. If you have an own IIS this is no problem. A shared hosting that is but not always. I can change any rights to the files in the root directory. The Web.config is always read-only for the Web application. It is then getting the error.

You may restart but still unlike the Web. With HttpRuntime.UnloadAppDomain(); to reach the same without the error message and felt more quickly. Be adjusted the following needs.

In the ExtensionManager.cs:

public static void ChangeStatus(string extension, bool enabled)
{
    foreach (ManagedExtension x in _extensions)
    {
        if (x.Name == extension)
        {
            x.Enabled = enabled;
            BlogEngine.Core.DataStore.ExtensionSettings xs = new BlogEngine.Core.DataStore.ExtensionSettings(x.Name);
            xs.SaveSettings(x);
            SaveToCache();

            //string ConfigPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "Web.Config";
            //File.SetLastWriteTimeUtc(ConfigPath, DateTime.UtcNow);

            HttpRuntime.UnloadAppDomain();
            break;
        }
    }
}

Lines 12 and 13 are commented out. The line 15 is new and causes a restart of the Web application.

Tags:

Kommentare sind geschlossen

Statistik

Gesamte Posts: 1025
Dieses Jahr: 7
Diesen Monat: 1
Diese Woche: 0
Kommentare: 929
Total Bewertungen: 91
Ø Bewertung: 4,42
Meisten Kommentare
Google+ ... (28)
Beste Ø Bewertung
Tastaturlayout von Visual Stud ... (5)
Meiste Bewertungen
Windows 7 und die ersten Erfah ... (5)

Buttons

Stop Spam Harvesters, Join Project Honey Pot Benutzerprofil von GENiALi connection speed test network connection Bloggeramt.de Slug.ch Blog Verzeichnis und Blog Webkatalog Schumacher Roland Seitwert Valid XHTML 1.0 Transitional

writing