1515using GitCredentialManager . UI . ViewModels ;
1616using GitCredentialManager . UI . Views ;
1717using Microsoft . Identity . Client . AppConfig ;
18-
19- #if NETFRAMEWORK
2018using Microsoft . Identity . Client . Broker ;
21- #endif
2219
2320namespace GitCredentialManager . Authentication
2421{
@@ -508,15 +505,13 @@ private async Task<IPublicClientApplication> CreatePublicClientApplicationAsync(
508505 // to save on the distribution size of the .NET builds (no need for MSALRuntime bits).
509506 if ( enableBroker )
510507 {
511- #if NETFRAMEWORK
512508 appBuilder . WithBroker (
513509 new BrokerOptions ( BrokerOptions . OperatingSystems . Windows )
514510 {
515511 Title = "Git Credential Manager" ,
516512 MsaPassthrough = msaPt ,
517513 }
518514 ) ;
519- #endif
520515 }
521516
522517 IPublicClientApplication app = appBuilder . Build ( ) ;
@@ -808,7 +803,6 @@ public HttpClient GetHttpClient()
808803
809804 public bool CanUseBroker ( )
810805 {
811- #if NETFRAMEWORK
812806 // We only support the broker on Windows 10+ and in an interactive session
813807 if ( ! Context . SessionManager . IsDesktopSession || ! PlatformUtils . IsWindowsBrokerSupported ( ) )
814808 {
@@ -827,34 +821,27 @@ public bool CanUseBroker()
827821 }
828822
829823 return defaultValue ;
830- #else
831- // OS broker requires .NET Framework right now until we migrate to .NET 5.0 (net5.0-windows10.x.y.z)
832- return false ;
833- #endif
834824 }
835825
836826 private bool CanUseEmbeddedWebView ( )
837827 {
838- // If we're in an interactive session and on .NET Framework then MSAL can show the WinForms-based embedded UI
839- #if NETFRAMEWORK
840- return Context . SessionManager . IsDesktopSession ;
841- #else
842- return false ;
843- #endif
828+ // If we're in an interactive session and on Windows then MSAL can show the WinForms-based embedded UI
829+ return PlatformUtils . IsWindows ( ) && Context . SessionManager . IsDesktopSession ;
844830 }
845831
846832 private void EnsureCanUseEmbeddedWebView ( )
847833 {
848- #if NETFRAMEWORK
849834 if ( ! Context . SessionManager . IsDesktopSession )
850835 {
851836 throw new Trace2InvalidOperationException ( Context . Trace2 ,
852837 "Embedded web view is not available without a desktop session." ) ;
853838 }
854- #else
855- throw new Trace2InvalidOperationException ( Context . Trace2 ,
856- "Embedded web view is not available on .NET Core." ) ;
857- #endif
839+
840+ if ( ! PlatformUtils . IsWindows ( ) )
841+ {
842+ throw new Trace2InvalidOperationException ( Context . Trace2 ,
843+ "Embedded web view is only available on Windows." ) ;
844+ }
858845 }
859846
860847 private bool CanUseSystemWebView ( IPublicClientApplication app , Uri redirectUri )
0 commit comments