0

I am using Webpack for my front-end, which will generate files with hashes in the filenames. Because of this, Visual Studio does not see them as included, and my publish fails.

My current flow is Publish -> Fail -> Add missing files, remove deleted ones -> Publish again.

Is it possible to just tell Visual Studio to include all files in a folder, no questions asked?

I already tried modifying the csproj like so:

<Content Include="SiteContent\**" />

But that does not work when publishing; I run the webpack tool in my pre-build script.

Jeff
  • 12,085
  • 12
  • 82
  • 152
  • I would love an answer to this as well, I am having the exact same issue. Did you happen to figure your problem out? – Luke Rice Apr 02 '16 at 20:22

1 Answers1

0

This worked (with modifications) for me: https://stackoverflow.com/a/9438419/1971537

The key was changing to

My situation is that after a successful build, powershell scripts move around and rename FE resources (js, css, html, vendor stuff) and given the renaming (for caching issue prevention), the filenames are never exactly the same, and the folder I think even gets axed. Changing this to afterbuild caused the files to get correctly added to the project after the build and the azure web deploy correctly picked them up.

Another hacky option I found that I played with initially just to see if my deployment was successful at all: https://msdn.microsoft.com/en-us/library/ee942158(v=vs.110).aspx#can_i_exclude_specific_files_or_folders_from_deployment

I tried the other two options for the Package/Publish Web tab (All files in this project and All files in the project folder) and this worked but with the issue of having to remove a ton of junk files just to get a couple files I wanted.

Hope this helps, I didn't figure anything out on my own but I eventually scraped it together. Go upvote the guy I linked first for his reply.

Community
  • 1
  • 1
Luke Rice
  • 236
  • 2
  • 13