param([ValidateSet("Debug","Release")][Parameter(Position=0)][string]$Configuration="Release")$WorkingDir=split-path-parent$MyInvocation.MyCommand.DefinitionfunctionWrite-Diagnostic{param([Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$true)][string]$Message)Write-HostWrite-Host$Message-ForegroundColorGreenWrite-Host}functionGenerateRefAssemblySource{$genapiVersion='6.0.0-beta.20610.4'$genapi=Join-Path$WorkingDir\tools\microsoft.dotnet.genapi.$genapiVersion\tools\net472\Microsoft.DotNet.GenAPI.exeif(-not(Test-Path$genapi)){$toolsFolder=Join-Path$WorkingDir\tools$genapiNupkg=Join-Path$toolsFolder\microsoft.dotnet.genapi.$genapiVersion.nupkg$genapiZip=Join-Path$toolsFolder\microsoft.dotnet.genapi.$genapiVersion.zip$client=New-ObjectSystem.Net.WebClient;#https://www.myget.org/F/cefsharp/api/v2/package/Microsoft.DotNet.GenAPI/6.0.0-beta.20610.4$downloadUrl='https://www.myget.org/F/cefsharp/api/v2/package/Microsoft.DotNet.GenAPI/'+$genapiVersionWrite-Diagnostic"Attempting to download $downloadUrl"$client.DownloadFile($downloadUrl,$genapiNupkg);#Expand-Archive won't extract a nupkg file, simply rename to zipRename-Item-Path$genapiNupkg-NewName$genapiZipExpand-Archive-LiteralPath$genapiZip-DestinationPath(Join-Path$toolsFoldermicrosoft.dotnet.genapi.$genapiVersion)}$inputDll=Join-Path$WorkingDir\CefSharp.Core.Runtime\bin\Win32\$Configuration\CefSharp.Core.Runtime.dll#This is a little problematic in developmenet as Win32 version might not nessicarily be the current target build#as yet I've not found a way to get the solutionif(-not(Test-Path$inputDll)){$inputDll=Join-Path$WorkingDir\CefSharp.Core.Runtime\bin\x64\$Configuration\CefSharp.Core.Runtime.dll}if((Test-Path$inputDll)){$outputFile=Join-Path$WorkingDir\CefSharp.Core.Runtime.RefAssembly\CefSharp.Core.Runtime.cs$cefSharpDllPath=Join-Path$WorkingDir\CefSharp\bin\$Configuration\$mscorlibDllPath=(Get-Item([System.String].Assembly.Location)).Directory.ToString()$libPath=$cefSharpDllPath+';'+$mscorlibDllPath.$genapi$inputDll--lang-version7.1--lib-path$libPath--out$outputFile#Generates slightly incorrect C#, so just manually fix it.$outputFileText=((Get-Content-path$outputFile-Raw)-replace'public sealed override void Dispose','public void Dispose')$outputFileText=$outputFileText.Trim()#Set-Content puts an empty line at the end, so use WriteAllText instead[System.IO.File]::WriteAllText($outputFile,$outputFileText)Write-Diagnostic"Generated Ref Assembly Source $outputFile"}else{Write-Diagnostic"Unable to Generate Ref Assembly Source, file not found $inputDll"}}GenerateRefAssemblySource
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。