Octopack not including .htaccess file, even though it is marked as content

We have a web project that includes a file named .htaccess (nothing before the period). Normally, this type of file is only used by Apache servers, but we are using an extension that allows us to use .htaccess files.

The file is part of the project, and it is marked as “content”, just like all of the image files, etc. However, this particular file does not get picked up by OctoPack. Is anyone else running into this kind of problem?


Hi James,

Thanks for reaching out. When you mark a file as “content”, it gets marked as such in the project’s .csproj file. That file is what Octopack reads to know which files it has to pack.

Can you check if your .htaccess file is marked as content on the csproj file in your source control? If you are not sure about this, send the whole project file and we’ll check it here.


Yes, it is marked as content in the .csproj file, and the file is checked in.

Furthermore, TFS Build is placing the file in the output folder. I know that Octopack doesn’t use the output folder – it uses the .csproj file directly if there is no .nuspec file. Still, that indicates that the file is properly marked as content.


Hi James,

Could you send us the project file along with the TFS build log?

Hi Dalmiro,

I apologize for not getting back to you sooner. I recently had to revisit this issue and I discovered the cause of the problem, as well as the solution, here:


It turns out that the default NuGet behavior is to exclude files that begin with a dot (.), which makes sense for things like git repositories. However, for .htaccess files, they need to be included. The fix was to make use of the OctoPackNuGetArguments parameter to pass along the -NoDefaultExcludes parameter to NuGet, like so:


Thanks again for your help and sorry for letting this lapse.

No worries James! Glad to hear you sorted it out.



This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.