7 Reeds
7 Reeds

Reputation: 2559

Web deploy "works" but some files not served

I have VS 2015 and a smallish C# web app. I can debug it on my desktop without issue. I have setup Web Deploy and have deployed the app to a dev server. The puzzling thing is that there are a couple of files that exist on the dev site that are not being served by the IIS server.

In my app I created a "LocalContent" folder at the same level as Views, Models, Scripts, etc with this structure

.../LocalContent/css
.../LocalContent/css/index.css
.../LocalContent/js
.../LocalContent/js/index.js

I can see the BuildAction property for the index.{css,js} files is set to Content and they do exist on the dev server.

When I load the dev site these resources both throw 403 errors (as seen through Chrome's Dev Tools). Not only that, looking at the URIs to these resources does not, for example, give .../LocalContent/css/index.css. Instead the dev-tools networking display shows something more like: .../LocalContent/css/?v=<long string of garble>.

This is my first IIS deployment so I am not sure what is or should be going on. Do I need to do something terribly Microsofty after each Publish event and restart the IIS process or reboot the IIS server machine?

Upvotes: 1

Views: 178

Answers (1)

Richard Szalay
Richard Szalay

Reputation: 84804

These files are likely being served by IIS's static file handler, which acts as a different identity to your application pool.

Assuming your server is configured with defaults, granting the IUSR user access to your web root (or at least the specific directory)\ that contain the static files) should solve your problem.

Upvotes: 1

Related Questions