publishing asp.net website give “Object reference not set to an instance of an object.” error

后端 未结 10 1575
遥遥无期
遥遥无期 2021-02-15 05:24

I am getting fed up with this error. I have search all over the web and tried every possible suggestion to this error I could find.

  1. delete app_code, build, add fil
10条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-15 05:52

    Again, this is an old post, but I had the following:

    VS2012 asp.net web forms app -> upgraded to VS2013

    Try to publish - get same error as OP.

    When I finally figured it out, the problem was caused by one thing:

    when I looked into the membership providers in web.config, one item was missing the connectionStringName attribute:

    bad:

    
      
        
        
        
      
    
    

    good:

    
      
        
        
        
      
    
    

    I'm not sure why one of the connectionStringName attributes was stripped out, or even if it was ever there, but you can turn this error on and off with this one setting.

提交回复
热议问题