4

I am using Visual Studio 2017 version 15.8.7 on windows 10.

This issue is happening for Asp.net MVC 4 websites and Web Api 2. Not for Aspnet.Core sites (so far)

Lately I have been having issues where I will be debugging a website and it will work fine then all of a sudden the next time you start the project up, it gives a 404 error. The only way to fix the error is to use a different computer, create a new project and copy the info over.

Every time I start the debugger and get 404, this event is recorded.

The directory specified for caching compressed content C:\inetpub\temp\IIS Temporary Compressed Files\Clr4IntegratedAppPool is invalid. Static compression is being disabled.

Things I have tried.

  • Uninstal VS / IISExpress and reinstall, including delete all folders in program files
  • Create a new project and copy code over. (works, but then happens again later on)
  • Use different computer. (works, but eventually that computer hits the issue too)
  • Tried creating the temporary folder and giving "Everyone" full control of it.
  • Tried changing port number and re-creating virtual directory
  • Tried deleting entire solution folder and re-cloning repo.

The issue does not happen on the web servers, only locally.

Any idea on what is going on? I can't find any configuration that is telling IIS to compress the files, so not sure why I keep seeing that error.

Edit

I determined that the application_start even in global.asax is never firing (StreamWriter code in it to log to a file in case debugger issue). So I assume the 404 is because the routes never get registered.

I tried updating Microsoft.AspNet.Mvc to the latest 5.2.6.

Edit 2 So I found a workaround. I installed IIS locally and publish to a folder and debug by attaching to the process. If I point IIS directly at the project or use IIS within VS it doesnt work.

I think the issue is related to some dll goofiness, project seems to work once published.

enter image description here

Edit 3

Found the root of the problem. I use Ubuntu/bash on windows. Cloning the git repo through bash seems to be setting the permissions wrong. If I clone through command line, the issue does not happen. Now I need to figure out why bash is screwing up the file permissions.

VaultBoy14
  • 251
  • 1
  • 4
  • 13
  • What is the complete 404 error page? The event about compression can be irrelevant. – Lex Li Oct 11 '18 at 17:20
  • Added screenshot of 404. – VaultBoy14 Oct 11 '18 at 19:26
  • Have you set a default page following https://stackoverflow.com/questions/1142003/set-homepage-in-asp-net-mvc? – Lex Li Oct 11 '18 at 19:48
  • Yes already tried that. It has nothing to do with the project. If I pull down the code to a different computer, it works for a bit. I think some files on the computer are getting corrupted or something. – VaultBoy14 Oct 17 '18 at 19:35

1 Answers1

1

Same issue with VS2017 on Windows 10, default IIS Express and git for Windows. Suddenly iisexpress returns 404 on /Default.aspx!!??

Solution:

  1. Close VS2017
  2. Delete the git repository in the file system.
  3. Open VS2017
  4. Clone the git repo

this helped on my machine.

Siraf
  • 1,133
  • 9
  • 24