warrenbuckley / CWS-Start

This is the new shiny MVC version of Umbraco CWS starter site package
MIT License
23 stars 13 forks source link

The type or namespace name 'EmailAddressAttribute' could not be found #24

Closed MrMattTaylor closed 10 years ago

MrMattTaylor commented 10 years ago

I've used NuGet to install the package into my VS 2010 project which already has Umbraco 6.1.6 installed.

With the CWS package installed I cannot compile the project due to the following error:

Error 1 The type or namespace name 'EmailAddressAttribute' could not be found (are you missing a using directive or an assembly reference?) D:\Websites\UmbracoCWSStarterKit\UmbracoCWSStarterKit\Models\AuthModel.cs 18 10 UmbracoCWSStarterKit

My project targets .Net 4.0 and so does Umbraco 6.1 I believe.

Any idea on what is missing?

warrenbuckley commented 10 years ago

Hello @MrMattTaylor seems like as your compiling against .NET 4 as opposed to .NET 4.5 where this attribute seemed to have got added to the .NET FrameWork

http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.emailaddressattribute(v=vs.110).aspx

If toy can update to .NET 4.5 then I believe this will be resolved. Closing this for the time being, please re-open if this is not the case.

Thanks :)

MrMattTaylor commented 10 years ago

Hi Warren,

Yes you're right and that does solve the issue. Maybe it was just my setup or perhaps the project here needs updating to target 4.5.

Cheers, Matt