1

I was trying to build a solution in Travis CI for mono version 3.6.0. I am using System.Security.Claims.ClaimTypes in my project but unfortunately got this error:

'System.Security.Claims.ClaimTypes' does not contain a definition for `Role'

But as I can see in the source code of mono everything is fine. I tried to build manually in Elementary OS with apt-get install mono-complete with latest 3.6.0 version, but got the same error.

At Travis CI I am using this package.

Am I missing something?

5
  • You may not target .NET 4.5, note #if NET_4_5. Aug 25, 2014 at 15:48
  • This directive is using only when mono is building, I am using mono binaries, not compiling it from source code (But maybe should try it :) ). Aug 25, 2014 at 15:56
  • Yeah, I understand. Didn't use Mono for a while, don't remember how they ship binaries now days. One of the reasons Role to be missing it wasn't included due targeting 4.0. Other reasons? Hmm, don't know. Aug 25, 2014 at 16:02
  • The one strange thing is what I am using ClaimTypes.Name also, and only Role cause this error. Aug 25, 2014 at 16:07
  • Can you open the assembly by a tool like Reflector to see what is actually inside it and what is missing? Aug 25, 2014 at 16:35

1 Answer 1

1

Note that a bunch of entries, including Role, have been added recently. Although chronologically before 3.6.0 but that release has been made from a separate branch, so it does not contain the relevant commit. You can check the released version of ClaimTypes.cs and see that indeed it does not contain Role. You will have to wait for a new release or compile mono yourself.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.