1
votes

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.

  1. 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?

  2. 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?)

2

2 Answers

4
votes
  1. 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.

  2. 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)?

1
votes

There is a way to change the internal path used within the zip:

/p:_PackageTempDir="C:\websites\myNewSite"

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.