2

Good day. Try run asp mvc on mod_mono. It seems ok, but when i try go to login page see 500 internal error:

System.TypeLoadException Could not load type 'System.Web.Security.MembershipPasswordAttribute' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): System.Web.Mvc.

Exception stack trace: at System.Web.Mvc.DataAnnotationsModelValidatorProvider..cctor () [0x00000] in :0

Use authentication mode "Forms".

Project files:

    Microsoft.Web.Infrastructure.dll
    System.Web.Helpers.dll
    System.Web.Mvc.dll
    System.Web.Razor.dll
    System.Web.WebPages.Deployment.dll
    System.Web.WebPages.dll
    System.Web.WebPages.Razor.dll

existing in bin folder

May be somebody have solution of this problem? Thanks.

tereško
  • 58,060
  • 25
  • 98
  • 150
foolsoft
  • 147
  • 6

1 Answers1

3

This is because the runtime does not have System.Web.Security.MembershipPasswordAttribute implemented yet (as of May 12, 2014). You can check what need to be done at http://www.go-mono.com/status/status.aspx?reference=4.5&profile=4.5&assembly=System.Web

You could implement your own. If you are using version 3.4 of Mono, then you should get the code from 3.4 branch. The class library are under [mono-code-root]/mcs/class/

You will see that System.Web.Security.MembershipPasswordAttribute is not there (and may be System.ComponentModel.DataAnnotations.UrlAttribute also). You have to create those classes and make sure they work. Then make and install it.

You could see more information here: http://www.mono-project.com/Contributing#Contributing_to_the_Class_Libraries Also here: http://blog.neteril.org/blog/2013/08/11/the-very-basic-guide-to-contribute-to-mono-bcl/

I have also ran into this issue while trying to develop MVC5 project with Mono on my Mac. And I have the code that you can get it from here: https://github.com/nonagon-x/mono/tree/mono-3.4.0-mvc5-support if you are using mono 3.4.0

Please note that my code added there are not for production. I just made it to be able to develop MVC5 on my Mac. There are no NUnit test there. So don't use it for production.