0

Possible Duplicate:
NullReferenceException when running published website in IIS

i got problem when a publish my site in the IIS 7.5 2008 Server. In my local pc it is located in D:\projects\visual_studio\site, then when i publish to the server, in C:/sites/mysite a i get this error message:

[NullReferenceException: Object reference not set to an instance of an object.] Inovação.Site1.Login1_Authenticate(Object sender, AuthenticateEventArgs e) in D:\projects\visual_studio\site\Site1.Master.cs:67 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +108 ....

I'm using a Login control in my MasterPage. Why the location is still point to D:\projects\visual_studio\site\Site1.Master (local pc) if my project is publish in C:/sites/mysite (server )?

Community
  • 1
  • 1
Michel Andrade
  • 4,056
  • 5
  • 27
  • 28

1 Answers1

0

Try this:

  1. click your site in IIS
  2. open Pages and Controls section
  3. find ViewState group and check if ViewState is enabled.

Such solution helped me to solve null reference exception problem after publish.

Prasad Jadhav
  • 5,090
  • 16
  • 62
  • 80
Denien
  • 1