internal static bool EnsureProjectLockFile(string projectLockFile) { return(MicrosoftCSharpCompiler.EnsureProjectLockFile(new NuGetPackageResolver() { ProjectLockFile = projectLockFile })); }
private string[] GetNETWSAAssemblies(WSASDK wsaSDK) { if (wsaSDK != WSASDK.UWP || MicrosoftCSharpCompiler.GetCurrentScriptingBackend() == ScriptingImplementation.IL2CPP) { return(Directory.GetFiles(MicrosoftCSharpCompiler.GetNETCoreFrameworkReferencesDirectory(wsaSDK), "*.dll")); } NuGetPackageResolver nuGetPackageResolver = new NuGetPackageResolver { ProjectLockFile = "UWP\\project.lock.json" }; for (int num = (!MicrosoftCSharpCompiler.EnsureProjectLockFile(nuGetPackageResolver)) ? 1 : 2; num != 0; num--) { try { nuGetPackageResolver.Resolve(); } catch (Exception) { if (num <= 1) { throw; } Console.WriteLine("Failed to resolve NuGet packages. Deleting \"{0}\" and retrying.", Path.GetFullPath(nuGetPackageResolver.ProjectLockFile)); File.Delete(nuGetPackageResolver.ProjectLockFile); MicrosoftCSharpCompiler.EnsureProjectLockFile(nuGetPackageResolver); } } return(nuGetPackageResolver.ResolvedReferences); }
private string[] GetNETWSAAssemblies(WSASDK wsaSDK) { if (MicrosoftCSharpCompiler.GetCurrentScriptingBackend() == ScriptingImplementation.IL2CPP) { // ISSUE: object of a compiler-generated type is created // ISSUE: reference to a compiler-generated method return(((IEnumerable <string>)MicrosoftCSharpCompiler.GetReferencesFromMonoDistribution()).Select <string, string>(new Func <string, string>(new MicrosoftCSharpCompiler.\u003CGetNETWSAAssemblies\u003Ec__AnonStoreyB3() { monoAssemblyDirectory = BuildPipeline.GetMonoLibDirectory(BuildTarget.WSAPlayer) }.\u003C\u003Em__20C)).ToArray <string>()); } if (wsaSDK != WSASDK.UWP) { return(Directory.GetFiles(MicrosoftCSharpCompiler.GetNETCoreFrameworkReferencesDirectory(wsaSDK), "*.dll")); } NuGetPackageResolver resolver = new NuGetPackageResolver() { ProjectLockFile = "UWP\\project.lock.json" }; for (int index = !MicrosoftCSharpCompiler.EnsureProjectLockFile(resolver) ? 1 : 2; index != 0; --index) { try { resolver.Resolve(); } catch (Exception ex) { if (index > 1) { Console.WriteLine("Failed to resolve NuGet packages. Deleting \"{0}\" and retrying.", (object)Path.GetFullPath(resolver.ProjectLockFile)); File.Delete(resolver.ProjectLockFile); MicrosoftCSharpCompiler.EnsureProjectLockFile(resolver); } else { throw; } } } return(resolver.ResolvedReferences); }