Hi,
I downloaded umbraco, installed, it ran the first time with IIS Express, just one run and then this happens. Umbraco does not run the second time.
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'Home' does not exist in the namespace 'Umbraco.Web.PublishedModels' (are you missing an assembly reference?) 1Viewshome.cshtml C:\Users\Janooo\source\repos\umbraco\Views\home.cshtml 1 Active
Looking at your screenshot and what you've said, I'm assuming you've done a clean install and you've installed the Starter Kit.
As such, by default Umbraco runs with Models Builder in PureLive mode. This means that views in Visual Studio will error and you won't get intelli sense as the Models (Home/Blog/BlogPost etc) don't actually exist until the site is running.
If you run the site in IISExpress, by default, it will try and go to the home page and it's possible you'll see that error again. However, what happens if you try and go to /Umbraco, does the back office work?
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'Home' does not exist in the namespace 'Umbraco.Web.PublishedModels' (are you missing an assembly reference?) 1Viewshome.cshtml C:\Users\Janooo\source\repos\umbraco\Views\home.cshtml 1 Active
Error CS1061 'IPublishedContent' does not contain a definition for 'HeroBackgroundImage' and no accessible extension method 'HeroBackgroundImage' accepting a first argument of type 'IPublishedContent' could be found (are you missing a using directive or an assembly reference?) 1Viewshome.cshtml C:\Users\Janooo\source\repos\umbraco\Views\home.cshtml 5 Active
Error CS1061 'IPublishedContent' does not contain a definition for 'HeroBackgroundImage' and no accessible extension method 'HeroBackgroundImage' accepting a first argument of type 'IPublishedContent' could be found (are you missing a using directive or an assembly reference?) 1Viewshome.cshtml C:\Users\Janooo\source\repos\umbraco\Views\home.cshtml 5 Active
Severity Code Description Project File Line Suppression State
Error The name 'CurrentPage' does not exist in the current context C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\FeaturedProducts.cshtml 12
Error foreach statement cannot operate on variables of type '?' because '?' does not contain a public instance definition for 'GetEnumerator' C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\FeaturedProducts.cshtml 15
Error Argument 1: cannot convert from 'method group' to 'object' C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\FeaturedProducts.cshtml 19
Error Argument 1: cannot convert from 'method group' to 'HelperResult' C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\FeaturedProducts.cshtml 19
Error The type or namespace name 'Blogpost' does not exist in the namespace 'Umbraco.Web.PublishedModels' (are you missing an assembly reference?) C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\LatestBlogposts.cshtml 50
Error Argument 1: cannot convert from 'method group' to 'object' C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\LatestBlogposts.cshtml 52
It's really odd tbh, those errors don't normally stop the website from running as they are in the views. It is as if, some how, pre-compilation of the views is being triggered and normally that happens at run time rather than at compile time.
Do you have any odd settings in Visual Studio around that sort of behaviour?
Server Error in '/' Application.
'Umbraco.Web.PublishedModels.ContentPage' does not contain a definition for 'sections'
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: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Umbraco.Web.PublishedModels.ContentPage' does not contain a definition for 'sections'
Source Error:
Line 7: *@
Line 8:
Line 9: @if (Model != null && Model.sections != null)
Line 10: {
Line 11: var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
CS0234 - and many more... broken umbraco
Hi, I downloaded umbraco, installed, it ran the first time with IIS Express, just one run and then this happens. Umbraco does not run the second time.
Severity Code Description Project File Line Suppression State Error CS0234 The type or namespace name 'Home' does not exist in the namespace 'Umbraco.Web.PublishedModels' (are you missing an assembly reference?) 1Viewshome.cshtml C:\Users\Janooo\source\repos\umbraco\Views\home.cshtml 1 Active
... and many more errors. What is wrong?
Thanks,
Jano
Hi Jano,
Looking at your screenshot and what you've said, I'm assuming you've done a clean install and you've installed the Starter Kit.
As such, by default Umbraco runs with Models Builder in PureLive mode. This means that views in Visual Studio will error and you won't get intelli sense as the Models (Home/Blog/BlogPost etc) don't actually exist until the site is running.
If you run the site in IISExpress, by default, it will try and go to the home page and it's possible you'll see that error again. However, what happens if you try and go to /Umbraco, does the back office work?
Cheers
Nik
Hi Nik,
Thank you for your reply. I am lost here. Where would I type(go to) /Umbraco?
Thanks,
Jano
If you run the site in IISExpress from Visual Studio, what happens?
Thanks
Nik
My collection of errors grows, I went from 8 to 18 ;)
I get this.
No - the errors show up as shown in my second screenshot.
Yes - the site does not work.
This is the Yes result...
Hi Jano,
Okay, so the yes result is correct behaviour as you can't browse directly to a cshtml file. So if you were to remove
/Views/home.cshtml
what happens?Also, can you copy all of the errors from your error list as they are getting cut off in the screenshots so can't see them all.
Thanks
Nik
Right, I got in...
Couple of errors:
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'Home' does not exist in the namespace 'Umbraco.Web.PublishedModels' (are you missing an assembly reference?) 1Viewshome.cshtml C:\Users\Janooo\source\repos\umbraco\Views\home.cshtml 1 Active
Error CS1061 'IPublishedContent' does not contain a definition for 'HeroBackgroundImage' and no accessible extension method 'HeroBackgroundImage' accepting a first argument of type 'IPublishedContent' could be found (are you missing a using directive or an assembly reference?) 1Viewshome.cshtml C:\Users\Janooo\source\repos\umbraco\Views\home.cshtml 5 Active
Error CS1061 'IPublishedContent' does not contain a definition for 'HeroBackgroundImage' and no accessible extension method 'HeroBackgroundImage' accepting a first argument of type 'IPublishedContent' could be found (are you missing a using directive or an assembly reference?) 1Viewshome.cshtml C:\Users\Janooo\source\repos\umbraco\Views\home.cshtml 5 Active
Severity Code Description Project File Line Suppression State
Error The name 'CurrentPage' does not exist in the current context C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\FeaturedProducts.cshtml 12
Error foreach statement cannot operate on variables of type '?' because '?' does not contain a public instance definition for 'GetEnumerator' C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\FeaturedProducts.cshtml 15
Error Argument 1: cannot convert from 'method group' to 'object' C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\FeaturedProducts.cshtml 19
Error Argument 1: cannot convert from 'method group' to 'HelperResult' C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\FeaturedProducts.cshtml 19
Error The type or namespace name 'Blogpost' does not exist in the namespace 'Umbraco.Web.PublishedModels' (are you missing an assembly reference?) C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\LatestBlogposts.cshtml 50
Error Argument 1: cannot convert from 'method group' to 'object' C:\Users\Janooo\source\repos\umbraco\Views\MacroPartials\LatestBlogposts.cshtml 52
I am left with no capability to compile any changes if I want to make some adjustments.
That's just VS beginner's luck, I guess :-)
I have never seen this 'trick' of code being generated on the fly.
It's really odd tbh, those errors don't normally stop the website from running as they are in the views. It is as if, some how, pre-compilation of the views is being triggered and normally that happens at run time rather than at compile time.
Do you have any odd settings in Visual Studio around that sort of behaviour?
Odd VS settings?
I don't think so. I am new to VS so I cannot say for certain what is going on.
I had high hopes for Umbraco, but I might just look elsewhere I guess. This really does not make sense.
Is there any other way how to work with umbraco?
How do people do development? What am I missing? What is the best practice?
This is a disaster for me.
Server Error in '/' Application. 'Umbraco.Web.PublishedModels.ContentPage' does not contain a definition for 'sections' 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: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Umbraco.Web.PublishedModels.ContentPage' does not contain a definition for 'sections'
Source Error:
Line 7: *@ Line 8:
Line 9: @if (Model != null && Model.sections != null) Line 10: { Line 11: var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
Source File: C:\Users\Janooo\source\repos\umbraco\Views\Partials\Grid\Bootstrap3-Fluid.cshtml Line: 9
Stack Trace:
[RuntimeBinderException: 'Umbraco.Web.PublishedModels.ContentPage' does not contain a definition for 'sections'] CallSite.Target(Closure , CallSite , Object ) +137 System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +664 CallSite.Target(Closure , CallSite , Object ) +270 ASP.PageViewsPartialsGridBootstrap3Fluidcshtml.Execute() in C:\Users\Janooo\source\repos\umbraco\Views\Partials\Grid\Bootstrap3-Fluid.cshtml:9 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90 System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +256 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107 Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +98 System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +277 System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +91 Umbraco.Web.GridTemplateExtensions.GetGridHtml(HtmlHelper html, IPublishedContent contentItem, String propertyAlias, String framework) +185 ASP.PageViewscontentPage_cshtml.Execute() in C:\Users\Janooo\source\repos\umbraco\Views\contentPage.cshtml:21 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78 System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +256 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107 Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +98 System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +290 System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +56 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult) +52 System.Web.Mvc.Async.<>c__DisplayClass3_6.<BeginInvokeAction>b__4() +198 System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +100 System.Web.Mvc.Async.WrappedAsyncResult
1.CallEndDelegate(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +11 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +47 System.Web.Mvc.<>c.<BeginExecute>b__151_2(IAsyncResult asyncResult, Controller controller) +13 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +22 System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +28 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +28 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallEndDelegate(IAsyncResult asyncResult) +29 System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +577 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +132 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +163Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4330.0
is working on a reply...