-1

I modified a data type from int to float, then, I updated model->edms file by select the 'update model from database'.

It successfully updated but turns out with an error:Error 12 'Membership' is an ambiguous reference between 'System.Web.Security.Membership' and 'testSiteV1.Model.Membership'.

May anyone helps me with this problem?

By the way, there is another warning says: Warning 5 The variable 'e' is declared but never used

Qiming
  • 1
  • 2
  • Show the code, where the Exception is thrown – Romano Zumbé Jul 07 '17 at 06:20
  • @RomanoZumbé It's not an exception but a compile error – Sentry Jul 07 '17 at 06:33
  • Most likely duplicated – Cleptus Jul 07 '17 at 06:35
  • Ok. Whatever. Show the code where the error appears – Romano Zumbé Jul 07 '17 at 06:35
  • That warning is raised when variables are declared and not used, because maybe they are declared to be used. If you have an empty `catch(Exception e)` in a `try-catch` block that could be the cause. If you click the error or the warning Visual Studio goes to the line raising the error or the warning. You should check the [MCVE] link. – Cleptus Jul 07 '17 at 06:38
  • Possible duplicate of [.Net 4.0 System.Web.Security.MembershipProvider ambiguous reference?](https://stackoverflow.com/questions/3712467/net-4-0-system-web-security-membershipprovider-ambiguous-reference) – Cleptus Jul 07 '17 at 06:40

1 Answers1

2

You have class Membership in your model and also include the namespace System.Web.Security, which contains a class called Membership.

Hence the error:

'Membership' is an ambiguous reference between 'System.Web.Security.Membership' and 'testSiteV1.Model.Membership'.

Remove the using System.Web.Security; statement if you don't need it or qualify the class usage by using the full name, i.e. testSiteV1.Model.Membership or System.Web.Security.Membership.

I can't tell you more because you don't show your code.

Sentry
  • 4,102
  • 2
  • 30
  • 38