Setup And Getting Started Forum


Error deploying to server

 
Hi,

I downloaded and successfully installed and ran version 1.0 on my local machine. When I tried to move it to my hosted server, I get the following:

[NullReferenceException: Object reference not set to an instance of an object.]
MvcCms.Data.EntityCmsRepository.ListAllCategories() in EntityCMSRepository.cs:161
MvcCms.Service.CmsService.ListAllCategories() in CMSService.cs:356
MvcCms.Web.Code.Routing.SetAppRoutes() in Routing.cs:41
MvcCms.Web.MvcApplication.Application_Start() in Global.asax.cs:87




Any ideas?
1 years 4 months 6 days ago by Stryder

Replies

Reply posted by jon 1 years 4 months 6 days ago View Branch And Reply
You have to change the portal url in the portal table to the url that you are using on the server.

We have an open issue to handle this more nicely and remind people to do then when moving out of the local environment but for now you just get that nasty error.

Basically the app is telling you that it tried to find a portal with the url being requested and it couldn't find one and that it was null.
Reply posted by Stryder 1 years 4 months 5 days ago View Branch And Reply
Hi Jon,

Thanks for your reply. However I had already found several issues related to this and tried to change the url as they indicated with no luck. Here's my setup:

I changed the "Default" UrlAuthority value to "www.mysite.com". I have the app hosted in directories below the root so to reach the site you enter "www.mysite.com/folder1/folder2" in the browser. The "folder2" directory is set up as an application.

I reviewed the code, but haven't seen where this would be an issue, but could you confirm?
Reply posted by jon 1 years 4 months 5 days ago View Branch And Reply
I haven't tried using the app in a subdirectory before but I would imagine that will cause quite a few problems with the routes, well I know it would. The way the app builds routes to content is based on the idea that it is at the root.

Ya, I don't think that will work, and I don't really know of any good way it could be made to work. Sorry! LOL

I suppose somehow you could make it work if you built something on to hold the name of the root folder you were at and then in the code that builds the routes append them on after your folder name. Even then though I think most of the add ons, the forum, and wiki, might still have problems with that.
Reply posted by Stryder 1 years 4 months 5 days ago View Branch And Reply
Ok, I understand. This is just a testing setup for now so I can work on it before moving it to a live site. There it will be on root.

So would this cause the original error? If not, and I can at least get it to recognize a valid portal, that would let me know it will work on my provider's server.
Reply posted by jon 1 years 4 months 4 days ago View Branch And Reply
Ya, that is the place where that error always occurs when it can't match the category, so I am pretty much 90% sure that is the reason.

The 2.0 version should be getting done sometime in the next few months and has quite a few improvements over the 1.0 version but if you are going for production probably best to wait as there is quite a bit of untested stuff in the 2.0.

I am not sure yet how hard the upgrade process from 1.0 to 2.0 is going to be but I would think a few sql scripts would be able to get the database ready for 2.0 without too much trouble.
  1 2