Got some issues with installing V1.7

  • 381 Views
  • Last Post 17 August 2017
  • Topic Is Solved
james depret posted this 18 September 2015

So as YodasMyDad suggested yesterday, I'm trying to install v1.7 with the source code, but I'm problably doing it wrong again, so tips are welcome.

I did as mentioned in the file, enabling the Nuget Package Restore and then changing the connection string appropriately. The build is successful, but when I run I get stuck in SideAdminPanel file with an unhandled NullReferenceException on line 35:

<li>@Html.ActionLink(Html.LanguageString("Members.SearchMembers"), "Search", "Members")</li>

Order By: Standard | Newest | Votes
james depret posted this 18 September 2015

System.NullReferenceException was unhandled by user code

  HResult=-2147467261

  Message=Object reference not set to an instance of an object.

  Source=App_Web_q5exsaza

  StackTrace:

       at ASP._Page_Views_Members_SideAdminPanel_cshtml.<DropDownContents>b__0(TextWriter __razor_helper_writer) in c:\Users\Gebruiker\Desktop\mvcforum-1.7\MVCForum.Website\Views\Members\SideAdminPanel.cshtml:line 35

       at System.Web.WebPages.HelperResult.ToString()

       at System.Web.Mvc.HtmlHelper.Raw(Object value)

       at ASP._Page_Views_Members_SideAdminPanel_cshtml.Execute() in c:\Users\Gebruiker\Desktop\mvcforum-1.7\MVCForum.Website\Views\Members\SideAdminPanel.cshtml:line 24

       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()

       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()

       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)

       at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)

       at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)

       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)

       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)

       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)

       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)

  InnerException:

Wesley Chih-Wei Huang posted this 18 September 2015

I am not quite sure about this, but I had seem this error before when I have something wrong with my database.

Maybe you can delete the database, and the website will create a new one for you.

  • Liked by
  • james depret
james depret posted this 18 September 2015

So I deleted the database thriugh my sql management studio and now it works, some bug on the first build I guess... I log in as admin and got an error but then go to main page and all is working again? Strange... going to fiddle some more later on, I'll keep you guys posted.

YodasMyDad posted this 19 September 2015

 Please check database permissions, and you given the user or network service or whatever the right permissions to be able to update/delete etc... on the database.

rosamabi posted this 26 August 2016

I get the exact same error here. Everything was up and running until suddenly it was not.

When it started firing this error, I was updating a language, but I'm not sure if it is something related to that, since I've tried deleting the database, checking the permissions, downloading the source code again, installing via nuget on an empty project, running with .sdf instead, but no results...

I'm using v.1.9.

Any thoughts? Thanks

walshmagger posted this 19 December 2016

The message "Object not set to instance of Object" means that you are trying to use an object which has not been initialized. That is, you either set it to null, or you never set it to anything at all. The runtime throwing a NullReferenceException always means the same thing: you are trying to use a reference. The reference is not initialized (or it was initialized, but is no longer initialized). This points to one of the following:

Your code declared an object variable, but it did not initialize it (create an instance or 'instantiate' it)

Something which your code assumed would initialize an object, did not

Possibly, other code prematurely invalidated an object still in use.

 

More about....NullReferenceException

 

Walsh

Lorien posted this 21 February 2017

Hello! My first post here, Just want to share I had the exact same issue today after my first Install of this project it happened right after I fiddled with languages. I think it's a cookie issue cause I've reinstalled the database after I found out My new language was empty. Problem is the site tries to log using the cookie I think that is set to the now non existing language. I was able to have the site show up fine in other browser and an anonymous tab. That's why I blame the cookies.

siaonong posted this 17 August 2017

Hi everyone,

I got the same error and managed to resolve it just now so I'd like to share my experience and hope others won't get stuck by it.

I'm trying to integrate MVC forum with an existing site so I installed it in 3 ways with 3 different sites:
Site 1->Installed with Web Platform Installer which is running on Microsoft WebMatrix. (using database "MVCForum")
Site 2->Downloaded the source in a zip from Github. Then I modified it to use pure String instead of GUID for user ID. (using database "MVCForum2")
Site 3->Installed it in a blank project of the existing site's solution by Nuget in VS 2017.  (using database "MVCForum3")

When I just installed site 3 and tried to run it the first time, I had an System.NullReferenceException error in SideAdminPanel.cshtml on line 35:
<li>@Html.ActionLink(Html.LanguageString("Members.SearchMembers"), "Search", "Members")</li>

Site 1 was working perfectly all the time so I turned to try site 1 but it also showes the same error.
Then I traced code in site 3 and found it tried to use the user name I logged in site 2 to log in. That user name doesn't exist in the new MVCForum3 database for site 3 which cause this error.

After I logged out the user in site 2 manually, this error on site 1 and site 3 both disappeared.

Close