Compilation error on new Document Type in LiveAppData mode
Hi,
I have a strange problem that I have been struggling with for a few days now. In my existing website V8, which I developed in Visual Studio and then published, I created in live environment a Document Type with Template.
In the web.config I have the following settings as usual:
For testing purposes I create only one property. In the permissions I set Allow as root.
As expected, the .generated.cs is in the directory under App_Data > Models.
The .cshtml is in the Views directory.
Under content I now create a page. When I call up this page, I get the following 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
'ConfirmationPage' does not exist in the namespace
'Umbraco.Web.PublishedModels' (are you missing an assembly
reference?)
Source Error:
Line 40:
Line 41:
Line 42: public class _Page_Views_ConfirmationPage_cshtml :
Umbraco.Web.Mvc.UmbracoViewPage<ContentModels.ConfirmationPage>
{
Line 43:
Line 44: #line hidden
Source File: C:\Inetpub\vhosts\myDomain.com\tmp\root\315944a4\9c483555\App_Web_confirmationpage.cshtml.65a2d1ee.zwf0dxa1.0.cs Line: 42required to service this request. Please review the following specific error details and modify your source code appropriately.
Do you see a ConfirmationPage.generated.cs in App_Data > Models? If it's there, is the namespace actually Umbraco.Web.PublishedModels or did you configure a custom modelsbuilder namespace?
You have included the App_Data\Models folder in your solution? That is, the C# files in there are being compiled? You can also verify it by right-clicking ConfirmationPage.generated.cs in Visual Studio and select Properties.
It should say Build Action: Compile, do you also see that?
I am sorry if I have expressed myself in a misleading way. In my local development environment I can call up the page without errors.
The error occurs when I try to create a new document type in the Productive Online instance. (This has always worked without problems in the past).
After I download the database and start the project in VS, run the model builder, include the generated models and views in the project, the page works.
My problem then is that even if I load the dlls, views and generated models back onto the server, online the problem persists?
The compiled ConfirmationPage.generated.cs should be inside <Your_Project>.dll, and you have copied that one to the Production environment too after compiling it locally?
OK, that was the crucial clue. Now the page works.
Thanks for the help Daniël!
Does this mean that I can no longer create new document types in the backend in the productive environment? Then, every time I create new document types, I would have to do this locally at the same time so that the generated models are integrated into the main dll?
Has anything changed recently? As far as I remember, it used to be possible to make these changes exclusively online, on the fly, so to speak, or am I mistaken?
If you want it to work without updating the DLL you probably have to set ModelsMode to PureLive, maybe that setting was changed recently in your site? That compiles the models on the fly so should work but then you cannot use the model classes from your own code (then they are only available in Views as far as I know).
We also use AppData at my company so I have no experience using PureLive in production but that should work in theory.
Compilation error on new Document Type in LiveAppData mode
Hi,
I have a strange problem that I have been struggling with for a few days now. In my existing website V8, which I developed in Visual Studio and then published, I created in live environment a Document Type with Template.
In the web.config I have the following settings as usual:
For testing purposes I create only one property. In the permissions I set Allow as root.
As expected, the .generated.cs is in the directory under
App_Data > Models
. The .cshtml is in theViews
directory.Under content I now create a page. When I call up this page, I get the following error:
Any Ideas?
Do you see a
ConfirmationPage.generated.cs
in App_Data > Models? If it's there, is the namespace actuallyUmbraco.Web.PublishedModels
or did you configure a custom modelsbuilder namespace?It is there and the Namespace is
Umbraco.Web.PublishedModels
You have included the
App_Data\Models
folder in your solution? That is, the C# files in there are being compiled? You can also verify it by right-clickingConfirmationPage.generated.cs
in Visual Studio and select Properties.It should say Build Action: Compile, do you also see that?
I am sorry if I have expressed myself in a misleading way. In my local development environment I can call up the page without errors.
The error occurs when I try to create a new document type in the Productive Online instance. (This has always worked without problems in the past).
After I download the database and start the project in VS, run the model builder, include the generated models and views in the project, the page works.
My problem then is that even if I load the dlls, views and generated models back onto the server, online the problem persists?
Am I doing something wrong?
Thank you
The compiled ConfirmationPage.generated.cs should be inside
<Your_Project>.dll
, and you have copied that one to the Production environment too after compiling it locally?OK, that was the crucial clue. Now the page works.
Thanks for the help Daniël!
Does this mean that I can no longer create new document types in the backend in the productive environment? Then, every time I create new document types, I would have to do this locally at the same time so that the generated models are integrated into the main dll?
Has anything changed recently? As far as I remember, it used to be possible to make these changes exclusively online, on the fly, so to speak, or am I mistaken?
Glad that worked.
If you want it to work without updating the DLL you probably have to set ModelsMode to
PureLive
, maybe that setting was changed recently in your site? That compiles the models on the fly so should work but then you cannot use the model classes from your own code (then they are only available in Views as far as I know).We also use AppData at my company so I have no experience using PureLive in production but that should work in theory.
is working on a reply...