ArgumentNullException on initial setup

Topics: ASP.NET 2.0
Dec 24, 2008 at 5:45 PM
I looked through what I could find on the forum and blogengine site without any luck so thought I'd ask here.

I'm trying to setup BlogEngine.Net and followed the instructions in the 1.4 installation video. I'm on a hosted site but believe that thngs are setup properly.

When I try to load the site I get the following error.

Server Error in '/' Application.

Value cannot be null.
Parameter name: pattern

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: pattern

Source Error:

Line 29:   void Application_Start(object sender, EventArgs e)
Line 30:   {
Line 31: ArrayList codeAssemblies = Utils.CodeAssemblies();Line 32:     foreach (Assembly a in codeAssemblies)
Line 33:     {

Source File: c:\inetpub\vhosts\tastingmaster.com\httpdocs\blogs\Global.asax    Line: 31

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: pattern]
   System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, Boolean useCache) +5185548
   System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options) +11
   BlogEngine.Core.Utils..cctor() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\Utils.cs:247

[TypeInitializationException: The type initializer for 'BlogEngine.Core.Utils' threw an exception.]
   BlogEngine.Core.Utils.CodeAssemblies() in C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects\BlogEngine.NET\DotNetSlave.BusinessLogic\Utils.cs:421
   ASP.global_asax.Application_Start(Object sender, EventArgs e) in c:\inetpub\vhosts\tastingmaster.com\httpdocs\blogs\Global.asax:31


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053


I'm not sure if this is a code issue or something not right in setup.
Dec 24, 2008 at 6:09 PM
I changed permissions for some other user accounts on my hosted service and now get the following error ... different...

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Unknown server tag 'blog:PostCalendar'.

Source Error:

Line 5:    <div id="divError" runat="Server" />
Line 6:    <uc1:PostList ID="PostList1" runat="server" />
Line 7: <blog:PostCalendar runat="server" ID="calendar" Line 8:      EnableViewState="false"
Line 9:      ShowPostTitles="true" 

Source File: /Default.aspx    Line: 7


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
Dec 24, 2008 at 9:19 PM
Unless your name is "Mads Kristensen", I'd be a little suspicious of the path "C:\Documents and Settings\Mads Kristensen\Dokumenter\Visual Studio 2005\Projects..."
Coordinator
Dec 24, 2008 at 9:37 PM
You may want to search the Discussions here for your error msg.  Here's a couple of past discussions that look related.

Unknown server tag 'blog:PostCalendar' in Published site
http://www.codeplex.com/blogengine/Thread/View.aspx?ThreadId=12809

Unknown server tag 'blog:PostCalendar' 
http://www.codeplex.com/blogengine/Thread/View.aspx?ThreadId=18573
Dec 24, 2008 at 10:40 PM
Thanks, Yes, I should have done a search on this second error I got but did not. The posts did not actually help me but I guess the web project is not actually deployable.
I'll try downloading the source and build/deploy manually to see if I can get it working.
Feb 5, 2010 at 4:11 AM

I'm getting the same as the first issue; what did you do to solve it? I've set full control on my App_Data folder for my Application Pool identity user:

Server Error in '/blog' Application.

Value cannot be null.
Parameter name: pattern

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: pattern

Source Error: 

Line 85:     void Application_Start(object sender, EventArgs e)
Line 86:     {
Line 87:         Utils.LoadExtensions();
Line 88:     }
Line 89: 


Source File: c:\inetpub\vhosts\taskey.com\httpdocs\blog\Global.asax    Line: 87 

Stack Trace: 

[ArgumentNullException: Value cannot be null.
Parameter name: pattern]
   System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, Boolean useCache) +5186460
   System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options) +11
   BlogEngine.Core.Utils..cctor() in C:\Data\Development\BlogEngine.NET\BlogEngine\DotNetSlave.BusinessLogic\Utils.cs:326

[TypeInitializationException: The type initializer for 'BlogEngine.Core.Utils' threw an exception.]
   BlogEngine.Core.Utils.LoadExtensions() in C:\Data\Development\BlogEngine.NET\BlogEngine\DotNetSlave.BusinessLogic\Utils.cs:552
   ASP.global_asax.Application_Start(Object sender, EventArgs e) in c:\inetpub\vhosts\taskey.com\httpdocs\blog\Global.asax:87

[HttpException (0x80004005): The type initializer for 'BlogEngine.Core.Utils' threw an exception.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +2723014
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +128
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +188
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +295
   System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +56
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +231

[HttpException (0x80004005): The type initializer for 'BlogEngine.Core.Utils' threw an exception.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333



Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074

Feb 5, 2010 at 4:17 AM

(This is with 1.6)

Coordinator
Feb 5, 2010 at 5:04 AM

Check your web.config file.  I think you're missing this appSetting:

<add key="BlogEngine.MobileDevices" value="(nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)"/>