YAFLogo

AngelAshley
  • AngelAshley
  • 50.6% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
Hi All,

Have been messing around with 1.9.3 RC2 and I got it working with the default providers. I then did a fresh install but this time I changed the providers to the ones I use for my website. All seemed OK, I was able to run through the install and select my website's admin user as the forum admin. However, when I try to log in I get the following error:

Object reference not set to an instance of an object. 
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.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 


Line 106:					this.Controls.AddAt( 0, _header );
Line 107:
Line 108:				this.Controls.Add( forumControl );
Line 109:
Line 110:				// add the footer control after the page...
 

Source File: d:\silverstarcheer.co.uk\wwwroot\forum\App_Code\YAF\Forum.cs    Line: 108 

Stack Trace: 


[NullReferenceException: Object reference not set to an instance of an object.]
   YAF.Classes.Utils.YafContext.get_UnreadPrivate() +16
   YAF.Classes.Base.ForumPage.ForumPage_Init(Object sender, EventArgs e) +615
   System.Web.UI.Control.OnInit(EventArgs e) +99
   System.Web.UI.UserControl.OnInit(EventArgs e) +77
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +198
   System.Web.UI.ControlCollection.Add(Control child) +80
   YAF.Forum.Forum_Load(Object sender, EventArgs e) in d:\silverstarcheer.co.uk\wwwroot\forum\App_Code\YAF\Forum.cs:108
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

 

I have searched around and seen a few other people have had this and fixed it but I've not found a solution so far 😞 It's not the private message bug, since I've not even logged in yet to be able to send any PMs (The PMessage table is empty).

My forum is set up as a seperate website, it's physically a subdirectory but set up in IIS as a new site and accessable through a subdomain. YAF and my website have their own seperate databases.

What I did was followed the installation instructions, then prior to uploading, I copied the .dll file for my sites providers into YAFs /bin directory, then added the connection string to db.config, changed web.config to use my providers instead of YAFs, then ran the /install page which worked fine. Just logging in caused that error 😞 Tried to debug it a bit myself but it's kinda hard when you can't attach a debugger to your shared hosting providers server! heh.

I can post the code for my providers if need be...

Am I doin' it rong? Or is there a know issue? If anybody can point me in the right direction I'd much appriciate it!

Cheers,

AngelAshley

http://forum.silverstarcheer.co.uk/default.aspx 

pps. Web.Config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>

	<configSections>
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
				<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
					<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
					<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
					<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
				</sectionGroup>
			</sectionGroup>
		</sectionGroup>
		<section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" requirePermission="false"/>
	</configSections>

	<connectionStrings configSource="db.config"/>
	<appSettings configSource="app.config"/>
	<rewriter configSource="URLRewriter.config" />

	<system.net>
		<mailSettings>
			<smtp configSource="mail.config"/>
		</mailSettings>
	</system.net>

	<system.web>

		<trace enabled="false" />
		<xhtmlConformance mode="Transitional" />
		<customErrors defaultRedirect="Error.aspx" mode="Off"/>

		<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

		<authentication mode="Forms">
			<forms name=".YAFNET_Authentication" protection="All" timeout="43200" cookieless="UseCookies"/>
		</authentication>

		<!-- Set debug to "true" to test out the system in development -->
		<compilation defaultLanguage="c#" debug="true">
			<assemblies>
				<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
				<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
			</assemblies>
		</compilation>

		<httpHandlers>
			<remove verb="*" path="*.asmx"/>
			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
		</httpHandlers>

		<httpModules>
			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add name="YafInitModule" type="YAF.Classes.Base.YafInitModule, YAF.Classes.Base"/>
			<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" />
		</httpModules>

		<pages validateRequest="false" smartNavigation="false">
			<controls>
				<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
				<add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>

				<!-- Default: use non-dynamic (compiled classes) in YAF -->
				<add tagPrefix="YAF" namespace="YAF.Classes.UI" assembly="YAF.Classes.UI" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Utils" assembly="YAF.Classes.Utils" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Data" assembly="YAF.Classes.Data" />
				<add tagPrefix="YAF" namespace="YAF.Controls" assembly="YAF.Controls" />
				<add tagPrefix="YAF" namespace="YAF.Controls.Statistics" assembly="YAF.Controls" />

				<!-- Optional: use dynamic classes in YAF by moving all the YAF.x directories (YAF.Classes.*, YAF.Providers)
						into the App_Code\YAF directory. Delete the associated .dll files from the \bin directory. Comment out the above 
						"non-dynamic" namespaces above and enable these: 
				-->

				<!--add tagPrefix="YAF" namespace="YAF.Classes.UI" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Utils" />
				<add tagPrefix="YAF" namespace="YAF.Classes.Data" />
				<add tagPrefix="YAF" namespace="YAF.Controls" />
				<add tagPrefix="YAF" namespace="YAF.Controls.Statistics" /-->

				<add tagPrefix="YAF" namespace="YAF.Classes" />
				<add tagPrefix="YAF" namespace="YAF"/>
				<add tagPrefix="editor" namespace="YAF.Editor"/>

			</controls>
			<namespaces>
				<add namespace="YAF" />
				<add namespace="YAF.Classes.UI" />
				<add namespace="YAF.Classes.Utils" />
				<add namespace="YAF.Controls" />
				<add namespace="YAF.Classes.Data" />
			</namespaces>
		</pages>

		<roleManager enabled="true" defaultProvider="SilverStarRoleProvider">
			<providers>
				<clear/>
				<add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafRoleProvider" type="YAF.Providers.Roles.YafRoleProvider"/>
				<add name="SilverStarRoleProvider" type="SilverStar.Membership.SilverStarRoleProvider" connectionStringName="SilverStar" />
			</providers>
		</roleManager>
		<membership defaultProvider="SilverStarMembershipProvider" hashAlgorithmType="SHA1">
			<providers>
				<clear/>
				<add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafMembershipProvider" requiresUniqueEmail="true" useSalt="true" type="YAF.Providers.Membership.YafMembershipProvider"/>
				<add name="SilverStarMembershipProvider" type="SilverStar.Membership.SilverStarMembershipProvider" connectionStringName="SilverStar" description="SilverStar Memebership Provider" enablePasswordReset="true" />
			</providers>
		</membership>
		<profile enabled="true" defaultProvider="YafProfileProvider" inherits="YAF.Classes.Utils.YafUserProfile">
			<providers>
				<clear/>
        		<add connectionStringName="yafnet" applicationName="YetAnotherForum" name="YafProfileProvider" type="YAF.Providers.Profile.YafProfileProvider"/>
			</providers>
		</profile>

	</system.web>

	<system.web.extensions>
		<scripting>
			<webServices>
				<!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
				<!--
         <jsonSerialization maxJsonLength="500">
            <converters>
               <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
            </converters>
         </jsonSerialization>
         -->
				<!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
				<!--
         <authenticationService enabled="true" requireSSL = "true|false"/>
         -->
				<!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved 
                 and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
                 writeAccessProperties attributes. -->
				<!--
         <profileService enabled="true"
                                 readAccessProperties="propertyname1,propertyname2"
                                 writeAccessProperties="propertyname1,propertyname2" />
         -->
			</webServices>
			<!-- 
      <scriptResourceHandler enableCompression="true" enableCaching="true" />
      -->
		</scripting>
	</system.web.extensions>

	<system.webServer>
		<validation validateIntegratedModeConfiguration="false"/>
		<modules>
			<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add name="YafInitModule" type="YAF.Classes.Base.YafInitModule, YAF.Classes.Base"/>
			<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" preCondition="managedHandler" />
		</modules>
		<handlers>
			<remove name="WebServiceHandlerFactory-Integrated"/>
			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
			<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
		</handlers>
	</system.webServer>

</configuration>

SilverStar Cheerleading

SilverStar Cheerleading 

Sponsor
Zeph
  • Zeph
  • 50.6% (Neutral)
  • YAF Forumling
15 years ago
I have the same error. Strange that if I open the website in VS2008 and debug it, everything works properly. I set up the virtual directory in IIS and I get this error. So this sounds like a configuration issue in IIS but it's so straightforward what could i possibly mess up?

I have a dev server which I copied my files to and it runs just fine. Could possibly have to do with my IIS? I'm running windows xp sp 2, while it works in windows server 2003 sp 2. Argh...