teenup
teenup

Reputation: 7667

Object reference not set to an instance of an object on build web site

I have a web site that is just serving as a Remoting Server and has remoting configuration inside its web.config file.

<system.runtime.remoting>
    <application>
      <service>
        <activated type="abc.def.ghi"/>
      </service>
      <channels>
        <channel ref="http" machineName="localhost"/>
      </channels>
    </application>
  </system.runtime.remoting>

Besides this web.config file, it has only these files in it:

dataConfiguration.config
enterpriseLibrary.config
log.config
website.publishproj
bin folder - which has the DLLs that are served from this project via remoting

When I build the web site, I receive build error which is:

"object reference not set to an instance of an object".

How can I debug what's causing this error and how to remove it?

Please advise.

Upvotes: 4

Views: 8034

Answers (3)

Pidoski
Pidoski

Reputation: 71

On my side i noticed that somehow I referenced two different connectionStrings and only one was used. Adding another connectionString solved this issue, but you can have one connectionString and change on the reference pages for that connectionString because two will just complicate things and affect the performance of your application. Hope this helps someone.

Upvotes: 0

Pramod Kumar
Pramod Kumar

Reputation: 1

This error appears when Target framework is not selected. enter image description here

Upvotes: 0

teenup
teenup

Reputation: 7667

The issue is resolved. I had a assembly reference in my web.config where there was a version mismatch between it and the assembly present inside the bin folder:

<add assembly="Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89B483F429C47342"/>

Upvotes: 5

Related Questions