我在发布配置文件中添加了一个部分,将外部文件夹的内容复制到 bin 文件夹。该文件夹的内容是包含两个 dll,以便我们可以使用空间函数。我遇到的问题是 DLL 被 IIS 锁定。发布配置文件由 MS Build 执行。
作为发布的一部分,如何重新启动 IIS?或仅在文件存在时复制文件?
以下是 pubxml 文件中的当前代码:
<Target Name="CustomCollectFiles2">
<ItemGroup>
<_CustomFiles2 Include="..\Lib\SqlServerTypes\**\*" />
<FilesForPackagingFromProject Include="%(_CustomFiles2.Identity)">
<DestinationRelativePath>bin\SqlServerTypes\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CustomCollectFiles2;
;
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
CustomCollectFiles2;
;
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>