YAFLogo

magmo
  • magmo
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
13 years ago
Hi

I have just set up my forum in www.domainname/forum/

It almost works except for some things. When I click the admin link I get this error "Object reference not set to an instance of an object." on this line.. <%# this.HtmlEncode(YafUserProfile.GetProfile(Eval("UserName").ToString()).Location)%>

And when I click the link that should display my profile I get this error "System.NullReferenceException".

But I only get these errors when I run the forum on my server, they dont appear when I run the same forum on my local developer pc.

Any ideas of why this occurs and what I might check?

.

Sponsor
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
13 years ago
Yes, check your profile provider settings on your production server. Sounds like its not loading profiles properly.
magmo
  • magmo
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
13 years ago

Yes, check your profile provider settings on your production server. Sounds like its not loading profiles properly.

Originally Posted by: Jaben 

Hi

Where do I find the "Profile Provider Settings"? Is this something a check in IIS, web.config or inside the forum's settings? I looked in the forum's settings but did not find what to look for....

magmo
  • magmo
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
13 years ago
I supose you mean my web.config file, but that cant be right beacuse the same forum work perfect on y local computer, the errors only occurs on the production server, and the forum files are identical.
magmo
  • magmo
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
13 years ago
This doesn't start off very well. I realize that this forum's support is based on volonters, but when it doesn't work out of the box I feel I'm better off buying a commercial forum.
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
13 years ago
The problem is you didn't provide much information. For example which yaf version you use, and if you use yaf as standalone application or if it an integrated solution with custom providers. You could post your web.config so we can take a look if there is something wrong.
magmo
  • magmo
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
13 years ago
I use the latest version 1.9.6.1RC1 as a standalone applikation on windows server 2008. My web.config look like this....

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <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>    
    <httpRuntime requestValidationMode="2.0"/>
    
    <xhtmlConformance mode="Strict"/>
    
    <customErrors defaultRedirect="Error.aspx" mode="On"/>
    
    <!--  GLOBALIZATION
    This section sets the globalization settings of the application. 
    Utf-8 is not supported on Netscape 4.x 
    If you need netscape compatiblity leave iso-8859-1.
    UTF-8 is recommended for complex languages
    -->    
    <globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
    <!--<globalization culture="en-US" uiCulture="en"  fileEncoding="iso-8859-1" requestEncoding="iso-8859-1" responseEncoding="iso-8859-1"/>-->
    
    <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 debug="false" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
        <add assembly="System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
      </assemblies>
    </compilation>
    
    <httpHandlers>
      <add verb="GET" path="Resource.ashx" type="YAF.YafResourceHandler, YAF" />
    </httpHandlers>
    
    <httpModules>
      <add name="YafTaskModule" type="YAF.Core.YafTaskModule, YAF.Core"/>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter"/>
    </httpModules>
    
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" enableEventValidation="false" validateRequest="false">
      <controls>
        <!-- Default: use non-dynamic (compiled classes) in YAF -->
        <add tagPrefix="YAF" namespace="YAF.Controls" assembly="YAF.Controls"/>
        <add tagPrefix="YAF" namespace="YAF.Controls.Statistics" assembly="YAF.Controls"/>
        <add tagPrefix="YAF" namespace="YAF.Classes"/>
        <add tagPrefix="YAF" namespace="YAF"/>
      </controls>
      <namespaces>
        <add namespace="YAF.Core"/>
        <add namespace="YAF.Controls"/>
        <add namespace="YAF.Utils"/>
        <add namespace="YAF.Types.Interfaces"/>
        <add namespace="YAF.Types"/>
      </namespaces>
    </pages>
    
    <membership defaultProvider="YafMembershipProvider" hashAlgorithmType="SHA1">
      <providers>
        <clear />
        <!-- YAF's ASP.NET Membership Provider is designed to work a bit better with YAF.NET options, but is by no means required.
             But, you will not be able to switch providers after installing your forum. -->
        <add name="YafMembershipProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" requiresUniqueEmail="true" useSalt="true" type="YAF.Providers.Membership.YafMembershipProvider"/>
        <!-- Set as default if you want to use use the built-in ASP.NET membership provider. Password Type of "Encrypted" requires a machine key. -->
        <add name="AspNetSqlMembershipProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" enablePasswordReset="false" enablePasswordRetrieval="true" maxInvalidPasswordAttempts="5" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="5" passwordAttemptWindow="15" passwordFormat="Encrypted" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" type="System.Web.Security.SqlMembershipProvider" />
      </providers>
    </membership>

    <roleManager enabled="true" defaultProvider="YafRoleProvider">
      <providers>
        <clear />
        <!-- YAF's ASP.NET Role Provider is designed to work a bit better with YAF.NET options, but is by no means required.
             But, you will not be able to switch providers after installing your forum. -->
        <add name="YafRoleProvider" applicationName="YetAnotherForum"  connectionStringName="yafnet" type="YAF.Providers.Roles.YafRoleProvider"/>
        <!-- Set as default if you want to use use the built-in ASP.NET role provider. -->
        <add name="AspNetSqlRoleProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" type="System.Web.Security.SqlRoleProvider" />
      </providers>
    </roleManager>

    <profile enabled="true" defaultProvider="YafProfileProvider" inherits="YAF.Utils.YafUserProfile">
      <providers>
        <clear/>
        <!-- YAF's ASP.NET Profile Provider is designed to work a bit better with YAF.NET options, but is by no means required.
             But, you will not be able to switch providers after installing your forum. -->
        <add name="YafProfileProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" type="YAF.Providers.Profile.YafProfileProvider"/>
        <!-- Set as default if you want to use use the built-in ASP.NET profile provider. -->
        <add name="AspNetSqlProfileProvider" applicationName="YetAnotherForum" connectionStringName="yafnet" type="System.Web.Profile.SqlProfileProvider"/>
      </providers>
    </profile>
    <machineKey validationKey="BEE9472B337F8FA094B7D42090CC90E3EB4D54258B853598FD804459AF8A73C53C85A9A6CAD68E5B5B1D68B1FD5C9490C7C3C9E0A2F5123FC920910621D84DB4" decryptionKey="8BA8A5E4F3C7E5EE8C5AA39175D895BA3590037B48AB61F6CFC5C333B49770CA" validation="SHA1" decryption="AES" />
    <!--  Enable it if your application is hosted in a web farm or cluster (e.g. GoDaddy hosting) or you are using standard ASP.NET providers and encryption. 
          IMPORTANT: DO NOT USE THIS KEY! You need to generate your own machine key (google it).
    -->
    <!-- machineKey
      validationKey="5B169A4270DB7D6A285CF068B81047D1A73A5FDDE9B204254AB86147B061C3C13DB6E84311E98EDFDD7FF50309DB9632A1C573A716CF120535EC3401BF7706D7"
      decryptionKey="910403AE3DEB5DD0AF73911DBB180518144AC983C1C7E7BDEE1CC8B6C74CBEF3"
      validation="SHA1" decryption="AES"
      /> -->
  </system.web>
  
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <remove name="YafTaskModule"/>
      <remove name="UrlRewriter"/>
      <add name="YafTaskModule" type="YAF.Core.YafTaskModule, YAF.Core" preCondition="managedHandler"/>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" preCondition="managedHandler"/>
    </modules>
    <handlers>
      <add name="YafHandler" preCondition="integratedMode" verb="GET" path="Resource.ashx" type="YAF.YafResourceHandler, YAF" />
    </handlers>
  </system.webServer>
</configuration>
daveburke
13 years ago
Magmo,

So if your web.configs are identical, what about the databases? I assume they are not identical. You could temporarily replace the production database with your development database to test if that is the source of your issue.

What was the installation process on Production. The same as development?

In approaching this solution, since development is working, we have to determine what is different or what has caused the differences.

Good luck,

Dave

magmo
  • magmo
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
13 years ago

Magmo,

So if your web.configs are identical, what about the databases? I assume they are not identical. You could temporarily replace the production database with your development database to test if that is the source of your issue.

What was the installation process on Production. The same as development?

In approaching this solution, since development is working, we have to determine what is different or what has caused the differences.

Good luck,

Dave

Originally Posted by: daveburke 

Hi

The database is the same, I did the initial setup om my local development pc and typen transfered all filés to the server.

Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
13 years ago

This doesn't start off very well. I realize that this forum's support is based on volonters, but when it doesn't work out of the box I feel I'm better off buying a commercial forum.

Originally Posted by: magmo 

Agreed... you are probably better off buying a commercial forum.

I'm not trying to be mean, I'm just admitting YAF.NET is more complex and less documented/user friendly than some commercial products.

The big question: why are you attempting to transfer the database? Why not just reinstall? That's a much simpler way to go.

magmo
  • magmo
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
13 years ago

This doesn't start off very well. I realize that this forum's support is based on volonters, but when it doesn't work out of the box I feel I'm better off buying a commercial forum.

Originally Posted by: Jaben 

Agreed... you are probably better off buying a commercial forum.

I'm not trying to be mean, I'm just admitting YAF.NET is more complex and less documented/user friendly than some commercial products.

The big question: why are you attempting to transfer the database? Why not just reinstall? That's a much simpler way to go.

Originally Posted by: magmo 

I'm not attempting to transfer the database... I have only one database, this was set up on our production sql server. Here's what I did...

* Downloaded the latest build and unzipped it on my local computer.

* Set up the database on a Sql Server 2005

* renamed the web.config file.

* provided a password inside the app.config file

* created a application in IIS (32 bit enabled .Net 4 application pool)

* ran the install

Then it worked on my local development pc, I the transfered all forum files (not the database) to my production web server using ftp.

* Set up a identical application in the servers IIS

* when I then tried out the different pages on the server I got the errors mentioned.

Maybe the forum is more complex, but that doesn't mean people should get these kind of trouble imidiatly after the setup. And it happend on just certain pages, that should be a pretty good clue on whats wrong.

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
13 years ago
Did you install it into /forum folder on the local machine too?
magmo
  • magmo
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
13 years ago

Did you install it into /forum folder on the local machine too?

Originally Posted by: bbobb 

I'm not sure what you mean, but I did setup the forum on my developer machine first, yes and got it working there. Its the same files ( forum) thatcher doesn't work on the production server

squirrel
13 years ago
Is the SQL Configuration different for the client between the 'development server' and the production server? When I develop, my sql server is remote, and behind a different port to get through the firewall. When I get on the production server, my SQL connection is different.
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
magmo
  • magmo
  • 57.2% (Neutral)
  • YAF Camper Topic Starter
13 years ago

Is the SQL Configuration different for the client between the 'development server' and the production server? When I develop, my sql server is remote, and behind a different port to get through the firewall. When I get on the production server, my SQL connection is different.

Originally Posted by: squirrel 

No its the same