I’m trying to create the .dll for the ADAL library to use with our multi platform application developed in Visual Studio. The sample (https://github.com/AzureADSamples/NativeClient-Xamarin-iOS) is the only usable information I’ve been able to find on how to bind the libADALiOS.a. Big thanks for that!
I am however stuck when trying to compile the sample library :( Xamarin Studio on OSX gives me two errors:
- [FILEPATH]/ADAuthenticationContext.g.cs(77,77): Error CS0246: The type or namespace name `ADTokenCacheStoring' could not be found. Are you missing an assembly reference? (CS0246) (Binding)
![adauthenticationsettings error](https://cloud.githubusercontent.com/assets/2743940/2899407/802cbcda-d5b5-11e3-834e-9ddf9146014d.png)
- [FILEPATH]/ADAuthenticationSettings.g.cs(18,18): Error CS0246: The type or namespace name `ADTokenCacheStoring' could not be found. Are you missing an assembly reference? (CS0246) (Binding)
![adauthenticationcontext error](https://cloud.githubusercontent.com/assets/2743940/2899410/8583f536-d5b5-11e3-84db-19f1c0272d3c.png)
I managed to build the solution into a dll file by changing some stuff. I moved the ADCredentialsType enum in ApiDefinitions.cs to StructsAndEnums.cs and changed the:
[Model]
public partial interface ADTokenCacheStoring {
into:
[BaseType (typeof (NSObject))]
[Model]
public partial interface ADTokenCacheStoring {
I also had to change the Field attributes in ADTokenCacheStoring from:
[Field ("ADAuthenticationErrorDomain”)]
into:
[Field (“ADAuthenticationErrorDomain”, “__internal”)]
After these changes it compiles into a +1mb dll file with success. Once inside the Visual Studio project I get an error when calling the constructor of ADAuthenticationContext with a "new ADTokenCacheStoring()" as the tokenCache. I’ve also tried providing "null" as the tokenCache but without success. I don't fully understand what implications my changes had and I would guess that my changes causes the ADAuthenticationContext constructor to fail in Visual Studio.
Any help you can provide or direction you can point me in would be tremendously helpful. Should I be able to compile the NativeClient-Xamarin-iOS project? I’ve also tried to compile a new libADALiOS.a library and added it to the NativeClient-Xamarin-iOS project but I still run into the same problem.
Many thanks in advance.
Regards,
Gustav