代码拉取完成,页面将自动刷新
param(
[string]$inPath=".\", # the directory containing the build
[string]$targetfileName="a.dll" # The name of the dll to be registered ( relative to $outpath )
)
[char[]]$trimChars = '\\'
function FixTerminatingSlash ($root) {
return $root.TrimEnd($trimChars)
}
#################################################################
# Key generation tool. We generate a new key every time. Why not?
# All we care about is that each addin has a different identity. We
# are not really caring exactly what that identity is.
#################################################################
$keyFile = "$outPath\StrongName.snk"
$netfxpath = "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools"
$sn = "$netfxpath\sn.exe"
&sn -k 2048 $keyFile
#############################
# Setup tools
#############################
# .Net Framework version
$fmwk="v4.0.30319"
# GAC Assembly registerer
$regasm = "$env:windir\Microsoft.NET\Framework64\$fmwk\regasm"
# Strong name assembly signing tool stored in nuget package
$strongNameSigner = "$(gci $PSScriptRoot\packages\Brutal.Dev.StrongNameSigner.*)\tools\StrongNameSigner.Console.exe"
echo $strongNameSigner
#############################
# Signing process
#
# Copies the build to a new directory, signs all dlls and then registers
# the main dll in the GAC
#############################
$outPath = "$(FixTerminatingSlash(Get-Item $inPath).FullName).Signed\"
echo "InPath is $inPath"
echo "OutPath is $outPath"
rmdir -Force -Recurse $outPath
copy -Recurse $inPath $outPath
&$strongNameSigner -in $inPath -out $outPath -k $keyFile
$targetPath = "$outPath$targetFileName"
cd $outPath
$command = "$regasm /verbose /codebase $targetFileName"
$command
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。