小编Pun*_*ani的帖子

添加类型:无法添加类型.无法找到程序集"System.IO.Compression.FileSystem"

我在TeamCity Builds中使用简单的PowerShell脚本.

它需要System.IO.Compression.FileSystem并且代理已安装.NET 4.5.2.下面是安装的.NET框架

PSChildName         Version             Release             Product            
-----------         -------             -------             -------            
v2.0.50727          2.0.50727.5420                                             
v3.0                3.0.30729.5420                                             
Windows Communic... 3.0.4506.5420                                              
Windows Presenta... 3.0.6920.5011                                              
v3.5                3.5.30729.5420                                             
Client              4.5.51209           379893              4.5.2              
Full                4.5.51209           379893              4.5.2              
Client              4.0.0.0                                    
Run Code Online (Sandbox Code Playgroud)

PowerShell脚本具有以下行

[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem");
Add-Type -AssemblyName System.IO.Compression.FileSystem
Run Code Online (Sandbox Code Playgroud)

在第二行,执行失败并出现错误

Add-Type : Cannot add type. The assembly 'System.IO.Compression.FileSystem' could not be found.
At C:\BuildAgent\someFile.ps1:104 char:13
+     Add-Type <<<<  -AssemblyName System.IO.Compression.FileSystem
+ CategoryInfo          : ObjectNotFound: (System.IO.Compression.FileSystem:String) [Add-Type], Exception
+ FullyQualifiedErrorId : ASSEMBLY_NOT_FOUND,Microsoft.PowerShell.Commands.AddTypeCommand
Run Code Online (Sandbox Code Playgroud)

奇怪,但我预计.NET 4.5.2,PowerShell应该能够从中加载程序集GAC

任何帮助将不胜感激

.net powershell

5
推荐指数
1
解决办法
8475
查看次数

从 Azure DevOps 部署到应用服务环境

我们的子网中有 1 个内部ASE。在同一网络的不同子网中,我们部署了一台虚拟机,充当Azure DevOps Agent Windows v2

我们可以从访问此虚拟网络的计算机手动部署 Web 应用程序(使用 Visual Studio),但无法从 Azure DevOps 进行部署。

这是我们所做的

  • 存在默认 NSG 规则,因此在 80/443 端口上启用流量。更新了 NSG 以允许流量进出:13.107.6.18313.107.9.183(检查所有端口)
  • 管道任务添加标志-allowUntrusted

我们在部署过程中遇到的错误是:

More Information: Could not connect to the remote computer ("{myapp}.scm.{customdomain}.com"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: Unable to connect to the remote server
Error: A connection attempt …
Run Code Online (Sandbox Code Playgroud)

azure azure-deployment azure-app-service-envrmnt azure-devops

3
推荐指数
1
解决办法
4834
查看次数