【发布时间】:2021-07-22 00:03:32
【问题描述】:
我有以下问题。
我创建了一个 Azure 函数,并希望运行存储在 {ProjectFile}/AlCompiler 文件夹中的编译器。
文件夹包含.dll的和alc.exe文件。 exe 文件需要这些 .dll 的 才能运行,否则会产生错误。
我尝试将 AlCompiler 文件夹的文件发布到 wwwroot 目录在 .csproj 项目文件中添加以下内容:
<ItemGroup>
<Content Include="AlCompiler/**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
我也试过这个标记:
<ItemGroup>
<ContentWithTargetPath Include="AlCompiler/**">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<TargetPath>AlCompiler\%(Filename)%(Extension)</TargetPath>
</ContentWithTargetPath>
</ItemGroup>
并尝试使用<Link>属性:
<ItemGroup>
<Content Include="AlCompiler/**">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<Link>AlCompiler\%(Filename)%(Extension)</Link>
</Content>
</ItemGroup>
所有这些都会导致 AlCompiler 目录的文件在发布时被拆分:
- exe 和其他一些文件转到 wwwroot/AlCompiler 文件夹
- 所有 .dll 都转到 wwwroot/bin/AlCompiler 文件夹
我没有找到任何方法将它们保存在一个地方。
由于 .dll 丢失,我无法运行 alc.exe 文件。
如果您能在这方面提供帮助,我将非常高兴!
【问题讨论】:
标签: c# azure visual-studio dll azure-functions