Saving Settings in 2.0 RC Doesn't Save

Topics: ASP.NET 2.0, Business Logic Layer, Controls, Themes
Dec 24, 2010 at 3:27 PM

I installed the site and it comes up just fine. I changed the default blog provider to DbBlogProvider. When I got into settings and try saving any changes, the changes don't get saved. I don't get any sort of error, the changes just aren't saved.

Here is what I did to install.

  1. Downloaded the 2.0 RC binaries.
  2. Unblocked the zip.
  3. Extracted the zip.
  4. Created an integrated .NET 4.0 app pool for the site.
  5. Created the virtual app in IIS.
  6. Copied the files to the app location.
  7. Changed permissions for the NETWORK SERVICE user on the App_Data folder and Web.config file.
  8. Removed the section group system.web.extensions, because it was throwing a duplicate entry error.
  9. Changed the default blog provider to DbBlogProvider.
  10. Used the 2.0 sql server script to create a database.
  11. Changed the connection string info to connect to the database.

The site comes up fine, but I can't change any settings. If I use sql profiler, I can see there are queries happening, but nothing shows up when saving settings.

Any suggestions?

Coordinator
Dec 24, 2010 at 7:29 PM

I'll try it out on my end, but which Settings page are you on?  Just the "Basic" settings?  What about the other settings tabs?  Can you create a Post -- i.e. does it appear in the be_Posts DB table?

If you have Firefox available, you might want to check the Error Console (Tools -> Error Console) and see if you see any errors show up when you save the settings.  When you click "Save", do you see a green bar at the top that says "Settings saved"?  Or does nothing happen?

Coordinator
Dec 24, 2010 at 7:57 PM

I was able to reproduce that problem.  There's a JavaScript error occurring.  You might see it too in the Firefox Error Console.

Error: this[0] is undefined
Source File: http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js
Line: 15

Someone just recently reported this same JS error here.

After the RC was put out, we started including a real .NET 4.0 web.config file with BE.  If I switch to this "real" .NET 4.0 web.config file, this error does not occur, and settings successfully save.

Here's a direct link to the .NET 4.0 web.config file for SQL Server.  The only thing you need to do is change the connection string.  When you have a chance, please try using that web.config file to see if it works for you too.  Thanks.

Dec 26, 2010 at 7:41 PM

I am having the same problem but am not understanding your solution.

I copied 2.0 to a new directory, created a virtual directory from IIS, made sure the APP_DATA directory has write access.

I am using .NET 4.0 in the setting and it is an XML only BLOG.

I am able to post and some setting save but basic settings give the follow error.

line: 15

Char: 1394

Error: 'this.0.form' is null or not an object

Code: http://locahost/food/js.axd?path=Script%2fjquery.validate.min.js

I have tried copying the "real" .NET 4.0 web.config file you linked to but it looks the same as the file I had after installing.

You mention the only thing I need to change is the connection string?  Since it is XML only what am I changing, I don't have MySQLServer so can't set that, do I need to?

  <BlogEngine>
    <blogProvider defaultProvider="XmlBlogProvider">
      <providers>
        <add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>
        <add name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" connectionStringName="BlogEngine"/>
      </providers>
    </blogProvider>
  </BlogEngine>
  <connectionStrings>
    <clear/>
    <add name="BlogEngine" connectionString="Data Source=MySQLServer;User ID=user;Password=password;persist security info=False;initial catalog=BlogEngine;" providerName="System.Data.SqlClient"/>
  </connectionStrings>

Coordinator
Dec 26, 2010 at 8:08 PM

If you're using the default XML storage, the .NET 4.0 web.config file for that is at the URL below.  For this, you don't need to change any connection strings -- that was just for Josh.

http://blogengine.codeplex.com/SourceControl/changeset/view/3022b9514f6c#BlogEngine%2fBlogEngine.NET%2fsetup%2fASP.NET_4.0_Web.Config

When you get to the above URL, the .NET 4.0 web.config file will be displayed in the bottom right corner (taking up most of the screen).  You will want to select all the text w/ your mouse, Copy, and then Paste into the web.config file on your computer.

If you're still seeing this error, then please copy and paste your web.config file contents here -- thanks.

Dec 26, 2010 at 9:40 PM

Ok I may have an apple~oranges problem.  If I use the web.config as you suggest unchanged it site does on "SecuritySiteMap", if I use the web.config from the "2.0 RC" unchanged the site runs but I get the error message as defined above.  Do I need to download a newer version for the web.config you suggested?  The old one use the following SecuritySiteMap

        <add name="SecuritySiteMap" description="Used for authenticated users." type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" securityTrimmingEnabled="true" siteMapFile="Web.sitemap"/>

--- Error message with new web.config

Server Error in '/food' Application.
--------------------------------------------------------------------------------

Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load type 'BlogEngine.Core.SecuritySiteMapProvider' from assembly 'BlogEngine.Core'.

Source Error: 


Line 111:			<providers>
Line 112:				<add name="PageSiteMap" description="The site map provider that reads in the .sitemap XML files." type="BlogEngine.Core.Web.Controls.PageSiteMap, BlogEngine.Core"/>
Line 113:				<add name="SecuritySiteMap" description="Used for authenticated users." type="BlogEngine.Core.SecuritySiteMapProvider, BlogEngine.Core" securityTrimmingEnabled="true" siteMapFile="Web.sitemap"/>
Line 114:			</providers>
Line 115:		</siteMap>
 

Source File: C:\Inetpub\wwwroot\food\web.config    Line: 113 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 
Dec 26, 2010 at 10:31 PM

Thanks Ben. I won't have a chance to try out the fix until Tuesday, and I will reply with the results.

Dec 26, 2010 at 11:26 PM

Oh well I downloaded "Change Set 3022b9514f6c", used the .NET 4 web.config.  Fixed the reference error for webapplication and all is well now.

Thanks for the help

Coordinator
Dec 27, 2010 at 7:15 PM

jjhii:  Oops, you're right ... I forgot the web.config was adjusted a bit and the one I pointed you to would not work with the RC.  Glad you figured it out.

Josh:  The .NET 4.0 web.config file I pointed you to you should still use.  It looks like one change to make based on what jjhii found, is to change the "SecuritySiteMap" so it is the following, which is required for BE 2.0 RC.

<add name="SecuritySiteMap" description="Used for authenticated users."
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
 securityTrimmingEnabled="true" siteMapFile="Web.sitemap"/>

Dec 28, 2010 at 1:44 PM

I put in the new config and changed the security sitemap setting. My blog pages are now all scrambled with a different char set.

Ex: �`I�%&/m�{J�J��t��`$ؐ@�����iG#)�*��eVe]f@�흼��{���{��;�N'���?\fdl��J�ɞ

Coordinator
Dec 28, 2010 at 5:58 PM

You can't read that?  :)

There's a global.asax file in the root of your blog.  In it, is an Application_Error handler.  If you replace the Application_Error handler with the one I posted here on Nov. 9th, you should get an actual error message.  Thanks.

Jan 2, 2011 at 3:56 AM

Getting the same problems here. wouldn't save my settings. Updated the web.confg to the 4.0 version and updated my connection string. I started getting the scrambled text. I updated
the app_error code but still got scrambled text. After updating the sitemap settings it started working. although i assume since i was getting scrambled text, the error handling
still isn't working correctly.

Coordinator
Jan 2, 2011 at 6:37 AM

The other thing that can help in this situation when you get garbage characters is to turn custom errors Off in the web.config file.

<customErrors mode="Off">

Jan 2, 2011 at 8:09 PM

I tried that, it didn't help. The garbled text changed, but it was still garbled. Anything else i should try?

Coordinator
Jan 2, 2011 at 9:07 PM

Are you trying to get the RC working?  In case you weren't aware, the final version of BE 2.0 was released yesterday.

Not sure if the final version will work better for you.  If you start off with the final release of BE 2.0 and if you are upgrading an existing blog, before copying any of your existing data to BE 2.0, I would first make sure that BE 2.0 runs for you without errors.  After that, you can follow these upgrade instructions to migrate your existing data to BE 2.0.

If you still see the garbage characters, turning off customErrors like you did is always a good idea.  You could also try removing the Application_Error handler from the global.asax file.

At this point, I'm interested in knowing if a new BE 2.0 installation runs for you without error -- which I think/hope will be the case.  And then if so, is it after you copy your existing data in when the errors start appearing.

Jan 2, 2011 at 10:51 PM

Ok, give me a little bit and i'll do a clean install of the released version of BE. This was a new install and i haven't done anything to the new install other then set a few settings here and there. Do i need to do anything as far as replacing the web.config with this new version (will be running under .net 4.x) ?

 

thanks

Coordinator
Jan 2, 2011 at 10:52 PM

I think replacing the web.config file with the .NET 4.0 one in the /setup folder is the only thing to do for a new install.

Jan 12, 2011 at 4:42 AM

In the process of trying to set up a new theme. Getting an error and I'm getting the garbled text again.

I tried setting customerror to off as well as commenting out the app_err handler from the global file but i still get garbled text. The only way i dont get garbled text is if i leave those things to default and view the page non-locally. 

If i pull the web page up on the server itself, text is unreadable. Any ideas?

Coordinator
Jan 12, 2011 at 7:08 AM

You could check the App_Data folder.  There may be a logger.txt file in there with error details.

Jan 12, 2011 at 4:06 PM

There is a logger.txt file, but unfortunately it doesn't have any information pertaining to the error i was getting.

I managed to resolve the error i was getting - it was a simple typo. But I'm more interested in resolved the garbled text error if possible.

Anything else i can do to try and resolve that?

Thanks

Coordinator
Jan 13, 2011 at 7:38 AM

With the default global.asax file that comes with BE, there is an Application_Error handler.  That *should* fire when there is an unhandled error.  The garbage text from what I know, is happening because there is an unhandled error.  So the Application_Error handler should fire.

In the Application_Error handler, it creates an error summary and calls Utils.Log().  The logger extension (if it's enabled, which it is by default) should pick up on that and log the error details into logger.txt.

So basically, the design is that when an unhandled error occurs, that should get logged into logger.txt.  And garbage characters are because an unhandled error is occurring.

This is theory!  But is also reality in most cases.

Definitely turning off custom errors is good when trying to find a problem.

One other person recently was getting the garbage characters, and then installed Elmah into his site, and it recorded the error details for him.  It's possible the error details were getting recorded into logger.txt for him too, but I didn't ask ... and I don't think he knew of BE's logger.txt ... but he did know of Elmah, and so installed that and was able to get a log record of the error.  This is another approach you could take.

Jan 13, 2011 at 7:50 AM

I think maybe it was missing from the log file because i tried disabling the error handler to see if that would fix the garbled text. By the time i re-enabled it, i had already fixed the cause of the error.

When i get around to it, i'll put in another typo to recreate the error and see if it shows up in the log.

From my understanding of work with .net, if there is an error, such as not having a ; at the end of a line of code, i should get a human read-able error message on the screen.

thanks for the explanation.