System.NullReferenceException RRS feed

  • Question

  • User-54348429 posted

    I am getting System.NullReferenceException: Object reference not set to an instance of an object at the connection.

    OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["testdb"].ConnectionString);

    The connection works fine when I debug from Visual studio but when I run from IIS I get null reference error.

    My web.config file is located in the root:

    <? xml version="1.0"?>



    <add name="testdb" connectionString="Data Source=testds;User ID=testuser;Password=testpwd;Persist Security Info=True;Min Pool Size=10;Incr Pool Size=5;Decr Pool Size=7;Max Pool Size=75;"/>



    <compilation debug="true" targetFramework="4.0">


    <add assembly="Oracle.DataAccess, Version=, Culture=neutral, PublicKeyToken=11111111111"/>




    Thursday, June 21, 2012 1:19 PM

All replies

  • User581921910 posted

    Mostly web.config was not deployed .If error comes after this fix please let me know.

    Wednesday, June 27, 2012 6:27 AM
  • User1405945375 posted


       Publish your application 

       put Oracle.DataAccess Assembly after seaching from your developement environment to  bin folder of publish code

       & run publish application through  IIS 

    Thursday, June 28, 2012 5:17 AM