This project is read-only.

BE 2.6 -> online Gallery is empty

Topics: Controls, Themes
May 26, 2012 at 6:07 AM

I downloaded the new version 2.6, run it with WebMatrix and wanted to get a new theme by the gallery, but there are no items. Just loading, loading....

Is this a configuration problem? Or is the gallery empty and filled later?

Best Carl


May 26, 2012 at 11:46 AM

If you have a chance, try it again to see if it's still empty.  It could have been that the gallery was intermittently not available.  And if you are seeing Loading, Loading ... you might want to try to go directly to the BE gallery in your browser to see if it is running and you see items on the site.

A few minutes ago, I tested BE 2.6 with WebMatrix 2.0 Beta (the latest one), and am seeing themes/extensions/widgets from the gallery appearing.  WebMatrix uses IIS Express to run the website, so if there was a problem, it would probably be related to IIS Express rather than WebMatrix (although I suppose something with WebMatrix itself could cause a problem).

May 26, 2012 at 11:53 AM

The problem is still there.

I think that the standard Gallery Feed URL is targeting an empty file:


May 26, 2012 at 12:04 PM

I tested again in WebMatrix while running Fiddler.  It is making calls to that URL you posted (  That URL by itself returns a little bit of XML data.  The queries coming from BE to the gallery look like this (OData queries, I believe):$orderby=Id&$filter=IsLatestVersion&$skip=0&$top=100&$expand=Screenshots

If you click on the URL above, do you see a lot of data?  It looks like that returns about 500 KB of data.

If you have Fiddler, you could watch to see what queries are being sent and what is coming back.  I'm seeing about 6 queries to the gallery feed, with URLs similar to the one above.

You might want to also look in the App_Data folder for a logger.txt file.  The gallery package system in BE does a fair amount of error logging in case any problems arise when it's getting data from the gallery.  Those errors/logging would be in that file.

Lastly, you might want to click around your BE site to see if everything else looks like it's functioning correctly.  i.e. try creating a blog post, try creating a comment, try saving the admin Settings just to see if everything is working.

May 26, 2012 at 5:08 PM is not empty, it is just a root of the document. If you look at you'll see packages on that feed.

May 26, 2012 at 6:29 PM

Both provided links (long url and the version from rtur) returns lot of data. And both links solve the problem with: loading, loading, .... But Blogengine just shows one (allready installed) theme in the Gallery.

The only other problems I found was:

Everything else works fine.


May 27, 2012 at 7:07 AM

If you are experiencing the Admin.Dashboard Convert string to DateTime Error problem, that is an error relating to Packages, either from the Gallery or ones already installed in your blog.  It's likely that the problem with no packages appearing under Appearence | Themes is because the Package code may be erring -- i.e. these might be connected problems.

We are trying to reproduce the error in that issue, so we can fix it.  Are you running a non English version of Windows?  And if so, which language?

May 27, 2012 at 7:23 AM

I am using Windows 7 in German and downloaded BE 2.6 (without changing/adding anything).

After this I tried also changing from file based saving to SQL CE. Everything works, except of files uploading and Dashboard -> Nothing changed.

Thanks for your help.


May 27, 2012 at 6:15 PM

Was the error reproduceable?

May 27, 2012 at 7:38 PM

I just pushed with a date format fix - can someone confirm it works? Main issue is that it is hard to reproduce error when you have en-US machine, for some reason even VM set to run on different culture worked fine and did not show this error. I only was able to produce it by manually setting default culture to de-DE and then using en-US in code to sort gallery list. Anyways, let me know if you still getting this error or it finally went away.

May 28, 2012 at 12:29 PM
Edited May 28, 2012 at 12:33 PM

I downloaded the Source Code compiled it (Visual Studio 2010) and started the BlogEngine.NET Folder with WebMatrix.

Everything works: Dashboard + Gallery. But everything is very slow (perhaps: debug code).

When I try to add a picture to a blog follwing error message and stacktrace is produced:

Line 23:

//var fileContainer = string.Concat(Blog.CurrentInstance.StorageLocation.Trim(), "files/").Trim();
//VirtualPath = VirtualPath.ToLower().StartsWith(fileContainer.ToLower()) ? VirtualPath : string.Format("{0}{1}", fileContainer, VirtualPath);
return HostingEnvironment.MapPath(string.IsNullOrWhiteSpace(VirtualPath) ? "~" : VirtualPath);


[NotSupportedException: Das angegebene Pfadformat wird nicht unterstützt.]
   System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) +9363820
   System.Web.Hosting.HostingEnvironment.MapPath(String virtualPath) +19
   BlogEngine.Core.Providers.XmlFileSystemProvider.BlogAbsolutePath(String VirtualPath) in BlogEngine\BlogEngine.Core\Providers\FileSystemProviders\XmlFileSystemProvider.cs:25
   BlogEngine.Core.Providers.XmlFileSystemProvider.FileExists(String VirtualPath) in BlogEngine\BlogEngine.Core\Providers\FileSystemProviders\XmlFileSystemProvider.cs:217
   BlogEngine.Core.Providers.XmlFileSystemProvider.UploadFile(Byte[] FileBinary, String FileName, Directory BaseDirectory, Boolean Overwrite) in BlogEngine\BlogEngine.Core\Providers\FileSystemProviders\XmlFileSystemProvider.cs:258
   BlogEngine.Core.Providers.BlogService.UploadFile(Stream FileStream, String FileName, Directory BaseDirectory, Boolean Overwrite) in BlogEngine\BlogEngine.Core\Providers\BlogService.cs:795
   Admin.Posts.AddEntry.BtnUploadImageClick(Object sender, EventArgs e) in BlogEngine\BlogEngine.NET\admin\Posts\Add_entry.aspx.cs:433

May 28, 2012 at 1:04 PM

That's good news on the Dashboard/Gallery part.  It might be the initial load of the gallery data that is slow, as the data is retrieved from the gallery site.  That data might get cached, and subsequent loads of the Dashboard or Appearance tab could be faster.. not sure, but hopefully.

For the other error, now that you have Visual Studio 2010 fired up, you could a couple of logging statements to see what values are there.  That error is happening in the BE Core, XmlFileSystemProvider.cs within BlogAbsolutePath(), on line 23.  If you have a chance, add the following right above the "return HostingEnvironment.MapPath(....) (I included that line too).  This will log info into the logger.txt file in the App_Data folder.

System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.AppendLine("VirtualPath: " + (VirtualPath ?? string.Empty));
	"Blog.CurrentInstance.StorageLocation: " +
	(Blog.CurrentInstance.StorageLocation ?? string.Empty));
return HostingEnvironment.MapPath(string.IsNullOrWhiteSpace(VirtualPath) ? "~" : VirtualPath);

It adds a few logging statements in logger.txt.  Here's a couple of them from my logger.txt file.

VirtualPath: ~/App_Data/files
Blog.CurrentInstance.StorageLocation: ~/App_Data/
VirtualPath: ~/App_Data/files/2012
Blog.CurrentInstance.StorageLocation: ~/App_Data/

I believe ~/App_Data/ comes from an appSetting in the web.config file.  You might want to make sure you have the following appSetting (which by default is there).

<add key="StorageLocation" value="~/App_Data/"/>
May 28, 2012 at 3:39 PM
Edited May 28, 2012 at 3:43 PM

Just found out that XmlFileSystemProvider.BlogAbsolutePath gets following Virtual Path: "~/App_Data/files/2012/05/C:\\WP_000175.jpg"

May 28, 2012 at 5:21 PM

My mistake, made a change to URL for images by copying logic from file rewrite, forgot to change in substring from 6 to 7. Good catch, I'll deploy correction later today with another unrelated bug in child blogs I found yesterday.

May 28, 2012 at 8:46 PM

All should be good with

May 29, 2012 at 7:11 AM
Edited May 29, 2012 at 7:11 AM

I'm very sorry, but I still have the same problem (with images and other files). It seems that .NET has a problem with C:

Is this perhaps just a problem on my PC? In the previous version I had no problems.

But many thanks for your help.

May 29, 2012 at 7:39 AM

I think I see what the problem is.  It's a change in 2.6, where 2.5 worked better.  What browser and browser version are you using btw?

You can test this out by making a change on your end, to see if it works... I'm pretty sure it will.

In /admin/Posts/Add_entry.aspx.cs, there is BtnUploadImageClick and BtnUploadFileClick.  In those 2 methods, you'll find these lines of code (only one of these in each method).


Change those, by removing the PostedFile part, so they become:


According to the docs, HttpPostedFile.FileName returns the filename AND the path, but that also depends on whether the browser includes the path.  The browsers I've tested on are not including the path, which is why I'm wondering if you are using an old version of IE, or something unconvential.  Whereas FileUpload.FileName is the filename without the path.  We want this latter one which the proposed code change above gives us, and what was used in BE 2.5.

Try making those 2 changes, and see if it works.  If so, we'll update the code.

May 29, 2012 at 7:48 AM

This works perfect. Thank you. I am using Internet Explorer 9 (on Win 7 and in German).

May 29, 2012 at 7:57 AM

Great, that's good to hear.  This change is in

I did test with IE9, but it could be that if you're on Localhost, or depending on the IE "zone" you are in (e.g. a Trusted zone or Intranet zone), IE may include the path information with the uploaded files, whereas in the normal Internet zone, IE probably doesn't include the path.  In any case, we should be covered with this change.  Thanks for testing out the change.

May 29, 2012 at 8:02 AM

We needed the same thing on BE Pages too, fyi, in case you are uploading files/images on Pages.  The same update has been made for Page in

May 29, 2012 at 6:48 PM

It was a pleasure to help (just by testing) the BlogEngine team.

Will there be a new release build published (or just the code)?

May 30, 2012 at 2:00 AM

We might update the existing Release to this latest build.  In the near future, the Web App Gallery (here) needs to be updated to 2.6 and when that is updated, it'll be the latest build ( or greater), and so the Release at CodePlex might get updated to the latest build at the same time.