I attempted to follow a few guides to allow me to send a simple contact form, but failed to get it working (my ASP.NET / MVC is quite basic - I'm mostly just trying to use Umbraco as a CMS without much custom work but had to go out of my comfort zone to try and get a form working), so for now, I may have to use Umbraco Forms.
Anyway... during the tutorials, I made a change to the appsettings.json file to change the ModelsMode to 'SourceCodeAuto' like so:
This has resulted in me having to stop Debugging mode and rebuild the project every time I make a change such as adding a new Document Type (from within Umbraco in-browser), so I decided to change it back to the default 'InMemoryAuto' setting, but when I do that, I receive 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. Generated Code
The type 'HomePage' exists in both 'ModelsGeneratedAssembly, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null' and 'MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
+
public class Views_HomePage : Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.HomePage>
I would appreciate any suggestions how to get things back to how they were before I started meddling! Thanks.
I know this is old, but don't suppose you or anyone else worked out a solution to this Steve?
I'm having the same issue with Umbraco 10.2.1 and Visual Studio 2022
I did have (default) inMemoryAuto, changed to SourceCodeAuto when trying to fix another issue, and now can't go back to InMemoryAuto.
After setting appsettings to InMemoryAuto, building, and running the site, I get the following error:
The type '[myTypeName]' exists in both 'ModelsGeneratedAssembly, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null' and '[myProjectName], Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'
ModelsMode set to 'InMemoryAuto' causing error
I attempted to follow a few guides to allow me to send a simple contact form, but failed to get it working (my ASP.NET / MVC is quite basic - I'm mostly just trying to use Umbraco as a CMS without much custom work but had to go out of my comfort zone to try and get a form working), so for now, I may have to use Umbraco Forms.
Anyway... during the tutorials, I made a change to the appsettings.json file to change the ModelsMode to 'SourceCodeAuto' like so:
This has resulted in me having to stop Debugging mode and rebuild the project every time I make a change such as adding a new Document Type (from within Umbraco in-browser), so I decided to change it back to the default 'InMemoryAuto' setting, but when I do that, I receive the following error:
I would appreciate any suggestions how to get things back to how they were before I started meddling! Thanks.
I know this is old, but don't suppose you or anyone else worked out a solution to this Steve?
I'm having the same issue with Umbraco 10.2.1 and Visual Studio 2022
I did have (default) inMemoryAuto, changed to SourceCodeAuto when trying to fix another issue, and now can't go back to InMemoryAuto. After setting appsettings to InMemoryAuto, building, and running the site, I get the following error:
The type '[myTypeName]' exists in both 'ModelsGeneratedAssembly, Version=0.0.0.1, Culture=neutral, PublicKeyToken=null' and '[myProjectName], Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'
OK, I finally worked it out, and as usual it is obvious. The old models were still there.
Delete the /umbraco/models folder.
I also deleted all files in obj/debug/net6.0 and bin/Debug/net6.0 to be sure before I rebuilt and ran the solution
I got this error after renaming the site assembly; it was because in _ViewImports.cshtml the old assembly name was still being used.
is working on a reply...