Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microsoft.Identity.Client and getting rid of System.Windows.Forms reference #2009

Closed
swidz opened this issue Aug 21, 2020 · 3 comments
Closed

Comments

@swidz
Copy link

swidz commented Aug 21, 2020

I am working on an integration library that references Microsoft.Identity.Client (I have also tried to use older implementation Microsoft.IdentityModel.Clients.ActiveDirectory)

My library type is .Net Standard 2.0

If my library is referenced in .Net Core Class Library project then the build references Microsoft.Identity.Client which does not include reference to System.Windows.Forms

If my library is referenced in .Net Framework 4.6.1 Class Library project then the build references Microsoft.Identity.Client which does include reference to System.Windows.Forms

The customer has asked to prepare .Net Framework 4.6.1 library that can be linked in their ERP software which includes a webserver. It seems that the webserver application during startup runs some sort of validation before loading external libraries and checks if non of them is referencing System.Windows.Forms. In my case the webserver rejects the libraries.

I cannot build the libraries as .Net Core as it will not be compatible with the web application. I must use .Net Framework 4.6.1

Is there a solution to this problem?

@bgavrilMS
Copy link
Member

bgavrilMS commented Aug 21, 2020

Hmm, we will actually take a dependnecy on WInForms from .net core as well soon...

We've tried splitting MSAL into public client (which requires WinForms) and confidential client (for web and without WinForms), but sadly this turns out to be extremely complicated.

One thing I can think of is to try to use our .net standard version (.net standard 1.3). I had to remove quite a lot of functionality from it, but for confidential client it should work fine.

We have a feature request to add support for a higher version of .net standard with more functionality, as scenarios such as yours are quite common. #1991

@henrik-me
Copy link
Contributor

@swidz We are not planning on removing the reference to winforms for the net desktop target. however we are planning on supporting embedded webviews on netcore via custom ui. Closing, if you need more information please reopen and let us know

@pedrolupin
Copy link

pedrolupin commented Dec 13, 2023

Azure.Identity 1.9.0 -> Microsoft.Identity.Client 4.49.1 did not have a dependency on System.Windows.Forms, but when updating to newer Azure.Identity 1.10.4 -> Microsoft.Identity.Client 4.56.0 the dependency to Windows.Forms appeared, this is a problem.

Azure.Identity should be able to run headless, on servers and many situations that don't have access to System.Windows.Forms because the .NET desktop runtime is not present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants