Technical support This forum is closed.
Version 1.x > Technical support > Error: Object reference not set to an instance of an object View modes: 
User avatar
Member
Member
mhchew - 3/20/2006 10:58:16 AM
   
Error: Object reference not set to an instance of an object
Hi,
I have created a SQL Database called kenticocms with login user sa, and it work perfectly everything. Later I decided to create another user called demo1 which share the same database Kenticocms. I use SQL Enterprise manage to create the login demo1, and assign Kenticocms database to it with db_owner. Than what I did is I edit the web.config and delete the addkey (add key="CMSConnectionString"). So when I lauched the http://localhost/kenticocms, the Database setup page came up ask me to input the SQL server name/database etc. So I input using demo1 login. than I select use an existing database (kenticocms) and click the option create Kentico CMS database tables, procedures and views. So when I click proceed button, the following error msg appears:

Server Error in '/KenticoCMS' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
Kentico.CMS.CMSDesk.install.SetConfigValue(String configFilePath, String key, String value) +73
Kentico.CMS.CMSDesk.install.btnInstallDB_Click(Object sender, EventArgs e) +825
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1292

May I know what is the problem? Is it the bug in your CMS? What's the solution for this?
BTW, I don't want to use the webinstaller.

Thanks

rgds




User avatar
Member
Member
mhchew - 3/21/2006 2:31:35 PM
   
Re: Error: Object reference not set to an instance of an object
I have simulated the problem. Initially after install using webinstaller, there is no bin folder at the cmsdesk folder. I can use the web interface to do the database setup. No problem. After I open the cmsdesk project and compile it. Than I open the corpoarte project and do the compilation too. Than I edit the web.config to delete the addkey="CMSConnectionString"...
Than I start my default page. It will come to the database setup page. As usual I input the SQL login id/password, and than select use an existing database (kenticocms) and click the option create Kentico CMS database tables, procedures and views. After clicking the proceed button, the above error message appear.

Thanks

rgds

User avatar
Guest
admin - 3/21/2006 5:49:45 PM
   
Re: Error: Object reference not set to an instance of an object
Hello,

Thank you for your message. We can reproduce this issue with Web Installer. We will check it and fix it in the nearest release. In the meantime, you will, unfortunately, need to use separate databases for every web site.

Best Regards,

User avatar
Member
Member
Martin_Kentico - 3/23/2006 8:40:49 AM
   
Re: Error: Object reference not set to an instance of an object
Hello,

The error you get is actually not caused by the database issue, but by the web.config editing you have done. The CMSConnectionString is one of the required configuration item, so it was not expected that someone deletes it (within the blank installation it is still present, but its value is blank). When you need to run the database setup again, you should just set the key value to the empty string instead of deleting the key itself. That should fix the problem you have with the null reference exception, if it does not, please let us know.

Considering the status of this issue, we sure will fix the code within the next version to automatically add the configuration key if not found.

Best regards