예제 #1
0
 public SdkResult(SdkReference sdkReference, IEnumerable <string> errors, IEnumerable <string> warnings)
 {
     Success      = false;
     SdkReference = sdkReference;
     Errors       = errors;
     Warnings     = warnings;
 }
        public override SdkResultBase Resolve(SdkReference sdk, SdkResolverContextBase context, SdkResultFactoryBase factory)
        {
            // Escape hatch to disable this resolver
            if (Traits.Instance.EscapeHatches.DisableNuGetSdkResolver)
            {
                return(null);
            }

#if FEATURE_APPDOMAIN
            AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolve;
#else
            AssemblyLoadContext.Default.Resolving += AssemblyResolve;
#endif

            try
            {
                return(ResolveSdk(sdk, context, factory));
            }
            finally
            {
#if FEATURE_APPDOMAIN
                AppDomain.CurrentDomain.AssemblyResolve -= AssemblyResolve;
#else
                AssemblyLoadContext.Default.Resolving -= AssemblyResolve;
#endif
            }
        }
예제 #3
0
 public SdkResult(SdkReference sdkReference, string path, string version, IEnumerable <string> warnings)
 {
     Success      = true;
     SdkReference = sdkReference;
     _path        = path;
     _version     = version;
     Warnings     = warnings;
 }
예제 #4
0
 internal SdkResultFactory(SdkReference sdkReference)
 {
     _sdkReference = sdkReference;
 }
예제 #5
0
 public abstract Microsoft.Build.Framework.SdkResult Resolve(Microsoft.Build.Framework.SdkReference sdkReference, Microsoft.Build.Framework.SdkResolverContext resolverContext, Microsoft.Build.Framework.SdkResultFactory factory);
 protected abstract SdkResultBase ResolveSdk(SdkReference sdk, SdkResolverContextBase context, SdkResultFactoryBase factory);