If I miss any setting in web.config file?

I'm a beginner to use ibo API in .NET project. I added reference Asi.iBO.dll to my project, then try to run following code:

CStaffUser.GetDefaultStaffUser();

but I got following error:

Could not load file or assembly 'Asi, Version=15.0.3.2399, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Then I try to run following code:

Asi.iBO.CStaffUser user = CStaffUser.Login("MANAGER", "manager");

and I got this error:

Object reference not set to an instance of an object.

I want to know if I miss some setting in web.config file or any other place.

Many thanks,

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Shun, what version is your

Shun, what version is your iMIS database (10.6 or 15.0.x)?

The version of our iMIS

The version of our iMIS database is 15.0.3.

I also trid to add this connection string in the web.config file, but still not working.

<connectionStrings><add name="DataSource.iMIS.Connection" connectionString="Data Source=192.168.1.6;User ID=sa;Password=***;Initial Catalog=pbkimis;" providerName="System.Data.SqlClient"/>
</connectionStrings>

I appreciate if you can give me some advice.

Thanks again.

Hi Shun, On the

Hi Shun,

On the "Asi.iBO.CStaffUser user = CStaffUser.Login("MANAGER", "manager");" you will get an object reference note set to an instance of an object error if you do not initialize the connection.

Try this.
Asi.iBO.iboAdmin.InitializeSystem();
Asi.iBO.CStaffUser user = CStaffUser.Login("MANAGER", "manager");"

On the ASI.dll error, try copying over Asi.dll, Asi.Lexicon.dll from your iMIS 15 or adding to your binary folder or adding references to them as well.

Sean

It works now, thanks.

It works now, thanks.

First, I added the code to the Global.asax.cs.

Asi.iBO.iboAdmin.InitializeSystem();

Second, added reference of the following files.

Asi.dll, Asi.Lexicon.dll and Asi.Membership.dll

Lastly, added following section to the web.config file.

<appSettings>
    <add key="System.WebLogin" value="MANAGER"/>
    <add key="iBOCacheRefreshIntervalSeconds" value="300"/>
    <add key="ImisWebServerUrl" value="http://192.168.1.6/iMIS15"/>
  </appSettings>

Then it works well.