Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 289479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:54:38+00:00 2026-05-12T05:54:38+00:00

I’m using Heather Solomon’s minimal publishing master page, I’ve got a simple feature with

  • 0

I’m using Heather Solomon’s minimal publishing master page, I’ve got a simple feature with an apsx page and a code behind file that does this

public class SSInformPage : Page
{
    protected Literal Literal1;

    protected override void OnLoad(EventArgs e)
    {
        //base.OnLoad(e);
        try
        {                
            HttpContext.Current.Session["Name"] = "Mr Ben";
            Literal1.Text = string.Format("{0} {1}", HttpContext.Current.Session["Name"].ToString(), Session.SessionID);
        }
        catch (Exception ex)
        {
            Literal1.Text = string.Format(ex.Message.ToString());
        }
    }

}

When this page loads in the browser I get the following error

Object reference not set to an instance of an object.

Yet if I switch to an out of the box master page (e.g. Black Vertical) the code works! I get the expected output of “Mr Ben {session ID}”

I’ve even created a new blank master page and copied the entire contents of the Black Vertical master page into it. I set the site to this new master page, I load the page expecting everything to work and receive the ‘Object reference…’ error. How does that work? It’s exactly the same master page yet the code only works if it’s an OOTB version.

I’ve enabled session state in central admin, the web.config file and the assembly is deployed to the GAC.

Update
From a suggestion on another forum it seems to be a trust issue, i was mistaken in thinking the solution deploys to the GAC, it was actually deploying to the Bin folder. I’ve tried to reset this but can’t seem to get WSPBuilder to deploy to the solution to the GAC, although i’ve managed to get it to stop deploying to the web application’s bin folder.

Does anyone know how to get a soltution to deploy to the GAC folder? this is my stsadm command

stsadm -o deploysolution -name Test.SessionState.Solution.wsp -immediate -url http://example -allowGacDeployment -allowCasPolicies -force

Udpate 2
No it’s not a trust issue, I re-created my solution and ensures it deploys to the GAC. If I open a OOTB master page in sharepoint designer and click the save button it’s will ‘customise’ the page. As soon as I do this my code stops working, if I then reset the master page back to the site definition my code starts working again!

I have a soltion file is anyone want to install this to see the behaviour.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:54:39+00:00Added an answer on May 12, 2026 at 5:54 am

    I think i found the reason, it seems if a custom master page is wrapped in a solution this problem doesn’t occur (most of the time).

    Here’s an article listing the issue and possible work arounds

    https://stackoverflow.com/questions/981836/perform-find-and-replace-in-visual-studio-build-events

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 136k
  • Answers 136k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can't do it. See the comp.lang.c FAQ. The closest… May 12, 2026 at 7:05 am
  • Editorial Team
    Editorial Team added an answer class AboutFrame(wx.Frame): title = "About this program" def __init__(self): wx.Frame.__init__(self,… May 12, 2026 at 7:05 am
  • Editorial Team
    Editorial Team added an answer If you are creating a user and don't specify a… May 12, 2026 at 7:05 am

Related Questions

I'm using the RESTful authentication Rails plugin for an app I'm developing. I'm having
I'm using TortoiseSVN against the SourceForge SVN repository. I'd like to move a file
I'm using Castle Windsor to do some dependency injection, specifically I've abstracted the DAL
I'm using ant to generate javadocs, but get this exception over and over -
I'm using ByteBuffers and FileChannels to write binary data to a file. When doing

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.