I created a new Document Type called "News Page" and when I create a page called "Internal News" of type "News Page" I am getting the following error.
An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.
One or more compilation references may be missing. If you're seeing this in a published application, set 'CopyRefAssembliesToPublishDirectory' to true in your project file to ensure files in the refs directory are published.
The type or namespace name 'NewsPage' does not exist in the namespace 'Umbraco.Cms.Web.Common.PublishedModels' (are you missing an assembly reference?)
+
public class Views_NewsPage : Umbraco.Cms.Web.Common.Views.UmbracoViewPage
When I looked at my models I see I have a file called NewsPage.generated.cs
It appears that the model that you generated cannot be found.
There are multiple possible causes for this:
Can you confirm that the namespace of your model matches the namespace that the error mentions?
You seem to be generating your models as C# source files. Can you confirm that these source code files are included in your project and have been compiled into the output of your application?
An error occurred during the compilation...
I created a new Document Type called "News Page" and when I create a page called "Internal News" of type "News Page" I am getting the following error.
An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.
One or more compilation references may be missing. If you're seeing this in a published application, set 'CopyRefAssembliesToPublishDirectory' to true in your project file to ensure files in the refs directory are published.
The type or namespace name 'NewsPage' does not exist in the namespace 'Umbraco.Cms.Web.Common.PublishedModels' (are you missing an assembly reference?) + public class Views_NewsPage : Umbraco.Cms.Web.Common.Views.UmbracoViewPage
When I looked at my models I see I have a file called NewsPage.generated.cs
Can anyone point me to what I am doing wrong?
If I go to the Template and updated
to
The page works... Can someone explain to me why?
Heyo!
It appears that the model that you generated cannot be found.
There are multiple possible causes for this:
Hello Dennis,
I see the models are created see image.
This is the page that calls the Model
Any ideas?
Hey,
Just to be sure: have you rebuilt and restarted your application after creating your document type and template and after generating your models?
Kind regards, Dennis
Hello Dennis,
Yes, rebuilt the models by going to Settings >> Settings >> Models Builder and clicking on Generate Models.
After that I stopped VS and did a build (Build Solution) and when I run it again I still get the same error.
Can we do a 5 min Google Meeting for you to help me out with this?
I am not sure what I did, but it is now working...
The error indicates that a model does not exist or is not referenced. For example in a Razor model cannot be found.
is working on a reply...