App fails to start

Topics: ASP.NET 2.0
Jul 24, 2009 at 8:15 PM

I have installed BlogEngine at my hoster DomainBox.de. I'm running my .NET2.0 based Website there, so the environment should be okay for BlogEngine.
The issue is that the app won't even start. I get the error below.
BlogEngine is running on a subdomain of my site. Can somebody give me a hint?

Thanks.

René

Serverfehler in der Anwendung /.


Der Wert darf nicht NULL sein.
Parametername: pattern

Beschreibung: Unbehandelte Ausnahme beim Ausführen der aktuellen Webanforderung. Überprüfen Sie die Stapelüberwachung, um weitere Informationen über diesen Fehler anzuzeigen und festzustellen, wo der Fehler im Code verursacht wurde.

Ausnahmedetails: System.ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: pattern

Quellfehler:

Zeile 30:   void Application_Start(object sender, EventArgs e)
Zeile 31: {
Zeile 32: ArrayList codeAssemblies = Utils.CodeAssemblies();
Zeile 33: List<SortedExtension> sortedExtensions = new List<SortedExtension>();
Zeile 34:


Quelldatei: d:\vhosts\wildsau.net\httpdocs\blog\Global.asax    Zeile: 32

Stapelüberwachung:

[ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: 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() +181

[TypeInitializationException: Der Typeninitialisierer für "BlogEngine.Core.Utils" hat eine Ausnahme verursacht.]
BlogEngine.Core.Utils.CodeAssemblies() +0
ASP.global_asax.Application_Start(Object sender, EventArgs e) in d:\vhosts\wildsau.net\httpdocs\blog\Global.asax:32
Jan 28, 2010 at 4:24 AM

Same here - 

Line 30:   void Application_Start(object sender, EventArgs e)
Line 31:   {
Line 32:     ArrayList codeAssemblies = Utils.CodeAssemblies();
Line 33:     List<SortedExtension> sortedExtensions = new List<SortedExtension>();
Line 34: 
Coordinator
Jan 28, 2010 at 4:55 AM

If you could post the error message (preferrably everything you see) that might help.

Jan 28, 2010 at 8:44 AM

I don't remember exactly what the issue was but I played around with the permissions on the webserver and then it worked.
Could also be that I wrapped the code in a try-catch and ignored it - as I say, I cannot really remember.

Btw: The complete error is in my post. Why would plexdaan post it again if he has the same problem?

 

René

Coordinator
Jan 28, 2010 at 9:39 AM

>>Btw: The complete error is in my post. Why would plexdaan post it again if he has the same problem?

Because I can't read German.

Also, it's not uncommon for two people to get the same error, but the reason for the error might be different.  The stack trace and other details in the error message can sometimes help identify the cause for each scenario leading to the error.

Jan 28, 2010 at 10:51 PM

Error is thrown at the first operational line of Global.asax. 

[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() +181

[TypeInitializationException: The type initializer for 'BlogEngine.Core.Utils' threw an exception.]
   BlogEngine.Core.Utils.CodeAssemblies() +0

Comments before line 32 are:
/// <summary>
/// <summary> /// Hooks up the available extensions located in the App_Code folder. /// An extension must be decorated with the ExtensionAttribute to work. /// <example> /// <code> /// [Extension("Description of the SomeExtension class")] /// public class SomeExtension /// { /// //There must be a parameterless default constructor. /// public SomeExtension() /// { /// //Hook up to the BlogEngine.NET events. /// } /// } /// </code> /// </example> /// </summary>
Suspect the ExtensionAttribute is not something used at most hosted sites? This would throw the empty exception error.
It has been reported that blog engine does not work for hosted sites, only local machines. Having a custom system-wide setting would fit that comment.
Can this be re-written to not depend on ExtensionAttributes?
  /// Hooks up the available extensions located in the App_Code folder.
  /// An extension must be decorated with the ExtensionAttribute to work.
  /// <example>
  ///  <code>
  /// [Extension("Description of the SomeExtension class")]
  /// public class SomeExtension
  /// {
  ///   //There must be a parameterless default constructor.
  ///   public SomeExtension()
  ///   {
  ///     //Hook up to the BlogEngine.NET events.
  ///   }
  /// }
  /// </code>
  /// </example>
  /// </summary>
Coordinator
Jan 29, 2010 at 2:56 AM

If you haven't yet, you could try wrapping up that code in Global.asax into a try-catch block.

try
{
........ all the existing code in Application_Start in Global.asax ..........
}
catch
{ }

See if the try-catch helps.

The ExtensionAttribute is an attribute defined by BE.  Normally it doesn't cause any problems, and there's no indication this attribute is causing any problems in this case either.

I suspect if you're getting an error with this code, even if you get past this particular error with a try-catch, you might get other errors within the application.  Maybe not ... but this is not a typical error.  Your website may not be configured correctly or have enough permissions.

I don't know where you heard that BE does not work for hosted sites.  Between the different hosts I have BE at, and the web hosts of other people I know who have BE hosted, there's at least 6 different web hosts in total I can think of where it runs fine.  There's nothing out of the ordinary with the BE application.  Wherever typical ASP.NET applications can run, BE should also be able to run.  Does your webhost specialize in ASP.NET, or at least is ASP.NET a big part of their business?

Jan 29, 2010 at 4:28 PM

Work-around led to the below error message (it may not be an error, but it was an error message).

Message thrown at Default.aspx page ...

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" 

I hope you do not think we were flaming you with the comment about hosted servers. As developers for a fortune 500 company, an evaluation was being make of open source blogs. Testing involved using a few public hosting companies to see ease of installation and operation. When we were unable to install (using published instructions) a quick google was done. Our 'informal' evaluation of the resultant comments was that this software could not be reliably installed on hosted servers.  The rules of this particular game are we only do what is specified/published. We saw numerous positive comments about the product but only in conjunction with home IIS servers. Due to legal considerations, we can not comment on any code except to make general observations. We deeply apologize for any bad feeling created.

You and your team have obviously put a lot of time, energy, and thought into this project. We are impressed with the skill and team coordination shown. Where it works, it looks as good (or better) than the 'big guys'. But to be a prime-time player, it must have bullet-proof instructions and trouble-shooting guides. This project wasn't created in a day. Keep slogging though the issues and, we think, the world will beat a path to your door. The fact that you are getting as much traffic as you are should be a good indication of that. 

If you want, we can continue to test to help get this install issue resolved. Otherwise, thanks to everyone for their time and efforts.

 

Coordinator
Jan 29, 2010 at 7:53 PM

plexdaan:  This is another error that I can't recall being reported by others on these Discussion boards (or at least not reported enough to make me remember).

On a side note, it's nice you keep posting the "red" lines of code, but you never post the actual error messages.  If you're looking to get any real help, providing as much information as possible (in particular the actual error message(s)) is critical.

Seeing the error message might actually help us to solve the problem.  BUT, I think there is a more important underlying problem with the hosting environment that is causing these basic pieces of functionality to not work.

Are you using the "Publish" option in Visual Studio to publish this project to a hosting server?  Or are you just copying the files extracted from the ZIP file directly to the hosting server, as-is?  There's been some known problems when using the Publish option.  In the BIN folder, there should only be one DLL file -- BlogEngine.Core.dll.  The Publish option will create other DLL files -- which we don't want.

BE should run fine in any medium trust or higher .NET hosting environment.  There really are no special or non-standard technical requirements I can think of.  Here's a short list of well known hosting companies (or companies I have dealt with) that either offer BE as an installation option, or BE can be installed on:

GoDaddy
Network Solutions
Discount ASP.NET
CrystalTech
1and1.com
mochahost.com

There's many other webhosts people have BE hosted at.  As you mentioned, BE is used by many people.  And most people out there don't have their own dedicated servers.  They're using shared web hosting.  I'm pretty active on the Discussions here and honestly don't see any reports or conclusions stating BE doesn't run at their webhost.

Jan 29, 2010 at 8:14 PM

I have two websites hosted on Softsys, one is running BE 1.4.5.0 and the other 1.5.0.7 without any issues at all.

Jan 29, 2010 at 9:49 PM

Thanks guys & gals! However, the difference between enthusiasts and professionals is this; enthusiast celebrates where the software works while the professional worries about where it doesn't work. If you cannot help the user to get the software running, they are not going to use it, no matter how great you know it to be. Even though this is open source, you should be the full master of your domain and able to make it do what you want. 

Please, no more on this for me. Sorry we couldn't troubleshoot together. The client went with Presstopia.

BenAmada - A special thank you for your interest. At our level, we really don't see error messages. They are just too generic. We get the throwing module, page, stack, dependencies, ax/bx registers etc. Again, what is offered in observations is meant to be helpful. No one is knocking the software, the effort, or where you are at in the development life-cycle. 

 

Feb 8, 2010 at 9:21 AM

I think the real issue is app paths. My host initially points http requests to my root directory by default. So .. mydomain.com and myotherdomain.com both initially point to my web server root directory. There, I need a default.aspx file to redirect incoming calls to each of my site locations under root. My root directory (/) has a mydomain subdirectory and a myotherdomain subdirectory. The default.aspx file in the root directory sends http://mydomain.com and http://www.mydomain.com requests to the mydomain subdirectory. That is, mydomain/default.aspx, specifically. The subdirectory (mydomain) must also contain the web.config for the application. If you don't have a redirect script (in the default.aspx), then you get application errors at root. It really doesn't matter what the errors are, because they are arriving from the fact that ISS can't find the path for application dependancies. Same would apply to site subdirectories. HTH.