The type or namespace name 'MyFirstForm' could not be found
I'm new to Umbraco and all associated technologies. It is for that reason, I find the tutorials very valuable. I have followed the instructions in the tutorial in Documentation=>Getting Started=> Code =>Creating Forms, very carefully.
I have a document called "Generic" that uses the view (GenericContactForm.cshtml) that loads the Partial View:
However, in spite of meticulously following these directions, I get the following error when calling http://localhost/generic:
Server Error in '/' Application.
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: CS0246: The type or namespace name 'MyFirstForm' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 3: Layout = null;
Line 4: }
Line 5: @using MyFirstForm.Models;
Line 6:
Line 7: @{
Source File: c:\ESC_Test\ESCProject\Views\GenericContactForm.cshtml Line: 5
I'm using Umbraco 7.4
Thanks in advance for any help to solve this. Once corrected, I will suggest an update to the otherwise great tutorial if appropriate.
Thank you for the prompt reply. I did change from MyFirstForm.Models to ESCProject.Models. This resulted in a slight improvement in that ESCProject (my Visual Studio project name) was recognized but "Models" was not:
Compiler Error Message: CS0234: The type or namespace name 'Models' does not exist in the namespace 'ESCProject' (are you missing an assembly reference?)
Source Error:
Line 3: Layout = null;
Line 4: }
Line 5: @using ESCProject.Models;
Line 6:
Line 7: @{
Source File: c:\ESC_Test\ESCProject\Views\GenericContactForm.cshtml Line: 5
The path to the Models folder is below the ESCProject folder:
C:\ESC_Test\ESCProject\Models\ContactFormViewModel.cs
yet "Models" is not recognized. I'm using VS 2012 with Umbraco 7.4
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace ESCProject.Models
{
public class ContactFormViewModel
{
public string Name { get; set; }
public string Email { get; set; }
public string Message { get; set; }
}
}
I'm getting the same error, "The type or namespace name 'IDoctype' could not be found" where 'Doctype' is the name of one of my doc types.
This is the error when I try and build the VS solution. It reports the same for other models too.
I also can't log into the CMS anymore - the error is "Could not load file or assembly 'Umbraco.ModelsBuilder' or one of its dependencies. The system cannot find the file specified."
No idea what's causing this, except that I just did a rebuild of the Models in the CMS. I'm using DLL version.
The type or namespace name 'MyFirstForm' could not be found
I'm new to Umbraco and all associated technologies. It is for that reason, I find the tutorials very valuable. I have followed the instructions in the tutorial in Documentation=>Getting Started=> Code =>Creating Forms, very carefully.
I have a document called "Generic" that uses the view (GenericContactForm.cshtml) that loads the Partial View:
However, in spite of meticulously following these directions, I get the following error when calling http://localhost/generic:
I'm using Umbraco 7.4 Thanks in advance for any help to solve this. Once corrected, I will suggest an update to the otherwise great tutorial if appropriate.
Thank you
Hello Mike
I think you need to change
to your projects namespace, maybe something like ESCProject.Models ? :)
Thank you for the prompt reply. I did change from MyFirstForm.Models to ESCProject.Models. This resulted in a slight improvement in that ESCProject (my Visual Studio project name) was recognized but "Models" was not:
The path to the Models folder is below the ESCProject folder: C:\ESC_Test\ESCProject\Models\ContactFormViewModel.cs
yet "Models" is not recognized. I'm using VS 2012 with Umbraco 7.4
Again, thanks in advance. Mike
Hey Again mike
Can i see your ContactFormViewModel.cs please ?
Thanks for taking the time.
Hi Mike,
Did you build your solution?
I'm getting the same error, "The type or namespace name 'IDoctype' could not be found" where 'Doctype' is the name of one of my doc types.
This is the error when I try and build the VS solution. It reports the same for other models too.
I also can't log into the CMS anymore - the error is "Could not load file or assembly 'Umbraco.ModelsBuilder' or one of its dependencies. The system cannot find the file specified."
No idea what's causing this, except that I just did a rebuild of the Models in the CMS. I'm using DLL version.
Any thoughts...?
Thanks
is working on a reply...