Visual Studio部署包中的打包字体和zip文件夹结构
我正在使用 MSBuild 创建部署包作为构建过程的一部分。我使用 /t:package
作为命令的一部分调用 MSBuild。
除了两件事之外,这非常有效。
我正在使用网络字体,但这些字体似乎没有包含在包中(它们包含在项目中)。我如何包含这些字体?
zip 文件中的文件夹结构非常可笑 - 它包含从驱动器号向下的完整路径。我预计这可能会在某些时候导致路径名长度出现问题。有谁知道如何防止这种情况? (我知道这是重复的: Visual Studio 部署包 - 更改 .zip 创建的文件结构?)
I'm using MSBuild to create a deployment package as part of my build process. I am calling MSBuild with /t:package
as part of the command.
This is working great except for two things.
I am using web fonts and it seems that these are not being included as part of the package (they are included in the project). How do I include these fonts?
The folder structure within the zip file is ludicrous - it includes the full path from the drive letter down. I anticipate this could cause problems with the length of path names at some point. Does anyone know how to prevent this? (I know it's a duplicate of this: Visual Studio Deployment Package - change the file structure the .zip creates?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的字体(或任何其他非标准文件)未部署的原因是“构建操作”设置为“无”。要解决此问题,请在解决方案资源管理器中选择该文件并将生成操作修改为“内容”。打包您的项目,它将被包含在内。
我也从来不理解文件夹结构。通过使用 msdeploy 发布站点,它会使用该文件夹结构一次部署多个站点。看着包装本身很烦人,但它确实“有效”。另外...最大文件长度约为 32k 个字符。请参阅:NTFS(Windows XP 和 Windows Vista)中的最大文件名长度?< /a>
The reason your fonts (or any other non-standard file) are not being deployed is the "build action" is set to "none". To fix this, select the file in solution explorer and modify the build action to "content". Package your project and it will be included.
I never understood the folder structure either. By using msdeploy to publish the site it uses that folder structure to deploy multiple sites at once. It's annoying when looking at the package itself but it does "work". Also... the max file length is something like 32k characters. See: Maximum filename length in NTFS (Windows XP and Windows Vista)?
有一种方法可以更改 zip 中使用的内部路径:
可以在命令行上使用 msbuild 来更改它在 zip 中创建的路径。也可以在 VS 中更改此设置,但我不记得如何更改。
There is a way to change the internal path used within the zip:
The switch can be used on the command line with msbuild to change the path it creates inside the zip. It is also possible to change this within VS but can't remember how off the top of my head.