问题
I have a website based on Umbraco CMS. Currently the site is running on another site with no problems at all. Now when I tried it on another server, it doesn't work anymore.
This is the detail of the error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'TextPage' does not exist in the namespace 'Umbraco.Web.PublishedContentModels' (are you missing an assembly reference?)
Source Error:
Line 40:
Line 41:
Line 42: public class _Page_Views_TextPage_cshtml : Umbraco.Web.Mvc.UmbracoTemplatePage {
Line 43:
Line 44: #line hidden
I just don't understand why it isn't running wherein they are all the same.
These are the steps that I made:
1. I tried changing the <add key="Umbraco.ModelsBuilder.ModelsMode" value="PureLive" />
to <add key="Umbraco.ModelsBuilder.ModelsMode" value="Dll" />
but it isn't working
2. I already set the application pool to .NET 4.5 which is the same with the previous server that is running.
I hope that you can help me with this. Thank you very much. :-)
回答1:
Try going to /umbraco#/developer
and navigating to the Models Builder tab. Sometimes when you click on Generate models, an error may popup which could help explain why any errors are occurring.
It's also worth checking your log to see if there's any Models Builder related errors.
回答2:
It does appear to be an issue with ModelsBuilder.
Is it possible that your broken site doesn't have the document type TextPage
?
The ModelsBuilder creates a model for each document type you have in Umbraco, so if that document type does not exist, it will not create a model for it!
回答3:
This is the answer
I didn't set the permission in my server.
What you need to do is to right click the folder and set its security to everyone although it is quite inappropriate. But for experimental purposes, you can set it and you can just manage it later.
Temporarily, you can just set it to everyone and allow everyone to acces it and it works fine now.
来源:https://stackoverflow.com/questions/46074636/umbraco-cs0234-the-type-or-namespace-name-textpage-does-not-exist