I have an ASP.Net Core app with the usual default routing set up in Startup.cs. My app has a TestsController, with some action routines, including an Index() routine.
I've never had a problem navigating to my app's /tests/ or /tests/index endpoints before today. As of today, attempting to navigate to /tests gives me the IIS HTTP Error 403.14 - Forbidden error page. If I try to navigate to /tests/index then I get the IIS HTTP Error 404.0 - Not Found page.
All of the other endpoints in my app seem to work correctly. It's just the /tests endpoints that fail.
If I rename the controller from TestsController to TestController (remove the "s") then I have no problem navigating to either /test or /test/index.
So, this smells like IIS is maybe finding a Tests folder that it thinks I'm trying to list? But the only Tests folder I can see in Windows Explorer is in the obj\Debug\netcoreapp2.2\Razor\Views folder. I don't think IIS is tripping over that.
One other data point: Yesterday, I ran into a weird problem where VS 2019 would load my project and immediately complain that "A process used by VS has encountered an unrecoverable error". I eventually figured out that this was caused (for some unknown reason) by the presence of a tag helper I was working on. Removing the tag helper code fixed that problem. But it's suspicious that now I have this new problem. On the presumption that the tag helper problem left some detritus behind, I deleted all of the bin and obj folders, deleted all of the NuGet packages, rebooted (a couple of times) and rebuilt everything. No luck, I still can't navigate to the /tests endpoint.
EDIT: Another data point: I just tried the same code on another machine, and it works correctly. The problem is isolated to the one machine.
How do I ask IIS where it thinks it's finding a tests folder?
Not terribly helpful answer, but it's what I've got... I spent a frustrating week with MS tech support, with no resolution. In the end, I nuked the local repo and re-cloned it, and the problem went away.
It was really weird. If I simply renamed the parent directory for the solution and all of its projects then the problem went away. If I renamed the directory back to its original name then the problem came back.
Related
I'm trying to figure out the root cause of a strange TFS error we are seeing in our current instance. It wasn't noticed until after a server move, but I'm not sure if they're directly related, because the error seems to be showing up for check-ins about a week prior to the move, as well as all those following it.
We first noticed the problem when I tried to get latest, and got several errors indicating:
"The downloaded file is corrupt. Please get the file again."
Upon looking into the error, we have noticed that starting as of a single check-in every code update has resulted in files being replaced with the contents of other files, ranging from project files to binary executable files (presumably assembly DLLs), rather than the expected content which is still present on our local development machines.
I don't have admin access to the servers myself, but am looking for ideas on possible causes and/or fixes for our team to investigate.
After weeks of searching, I finally found another mention of this sort of thing happening, along with a solution that appears to have worked.
Clear the Application Tier cache.
MSDN Archived Forums: TFS swapping contents of files
I am creating my own site template for SharePoint. Everything has been going fine, building fine, deploying fine. For unrelated reasons, I needed to reboot my development server. I then made an update to my custom.xsl file and attempted to deploy in Visual Studio 2012. Even though it says Deployed Successfully, My changes are not reflected in SharePoint, and I received the error in my question. Additionally, I am getting 32 warnings that this or that attribute is not declared, even though I made one small change (added a link for testing) to the blog.xsl I copied my custom .xsl from. I reverted all changes, attempted to deploy again, but cannot get past this error now.
Any ideas where to start looking to solve this? Needless to say _layouts is NOT in the root of the C drive, but it the 14 hive under Templates.
I have several programs that I have created in vb.net visual studios 2010. I have been working on these programs for months with no problems. Recently I started having an issue where I can no longer access my temp directory while debugging within VS. I can't use My.Settings anymore because these use those temp files. This is the error I get:
Failed to save settings: An error occurred loading a configuration file: Could not find a part of the path 'C:\Users\USERNAME\AppData\Local\PROGNAME\PROGNAME.exe_Url_gty0snnfox5ji5xgprklljwb0e0mthek\1.0.0.0\nl3u0fw2.tmp'. (C:\Users\USERNAME\AppData\Local\PROGNAME\PROGNAME.exe_Url_gty0snnfox5ji5xgprklljwb0e0mthek\1.0.0.0\user.config)*
This file is there though.
I also get an error when trying to use my web services. I get this error:
Access to the temp directory is denied. Identity 'DOMAIN\Username' under which XmlSerializer is running does not have sufficient permission to access the temp directory. CodeDom will use the user account the process is using to do the compilation, so if the user doesn�t have access to system temp directory, you will not be able to compile. Use Path.GetTempPath() API to find out the temp directory location.*
I used the Path.GetTempPath() as the error says and I am trying to access: >"C:\Users\USERNAME\AppData\Local\Temp\"
I have tried going to these folders and making sure that I have the security set to allow everyone complete control. I believe it is a problem with VS not my program because I get the same problem on all of my programs, some of which I haven't opened in months. I did a repair on VS.
I can't think of what might have changed to cause this to stop working all of a sudden. I traveled to a customers facility where I had to change some network settings, but everything should be set back as it was now. My temporary security certificate expired, but I created a new one and now the certificate I am using to sign these applications is in my trusted root on certificate manager and looks to be valid. I should also mention that this is a clickonce deployment and the deployement works fine on my computer and others, it is only while debugging that I have these issues.
I have been running this down for weeks and spent countless hours looking for a solution and have come to a brick wall. Does anyone have any suggestions?
Thanks ahead of time for your help and time! Please let me know if I can clarify anything.
It turns out that the problem was coming from the fact that somehow one of the folders in the filepath to my user.config file got changed. Somehow a .vshost got thrown in on one of the folder names. I still have no idea how this happened and what caused this to happen, and I am not 100% sure that I have gotten to the real root of the problem, but for now, I am able to debug again. I changed the file name back to what it was supposed to be and the errors have stopped. Now lets just hope the file name doesn't get changed back again.
I've added a couple of lines to a file, let's say it builds to be foo.dll. It's part of more then one dll file, but it's the core dll. What I did was that I added a couple of lines so it should add some log data to the database. It should not affect any other files what so ever.
So i tried to deploy it. We don't have the magical one click deploy, we are just copying the right files to the right place.
So now, since i have a change in foo.dll, i thought for myself that i just could copy foo.dll and the server would be happy.
I was wrong. Browsing the website i now get "Generic Errors", dont know what that is. I've also tried to copy all the new dll files (4 i total) but that did not solve the problem either.
The error it gives are
Http Error 404.0 not found
Module: ISS Web Core
Notification: MapRequestHandler
Handler: Static File
Error Code: 0x80070002
replacing the new foo.dll with the old one solves the problem. and i've tried to restart the webserver. :-(
I asume you have "published" and not just "compiled" your Web?
You also need to take care off the "Solution Configurations": Debug and Release.
In a normal publish process you would change the configuration to release and publish your project into another folder.
After you have done that you just need to collect the desired files and upload them.
Keep in mind that you need the newest version of you web project. Maybe there are some changes online that your local project hasn'T. This would cause such problems.
We don't have the magical one click deploy
Why not? It's not magic, and it's pretty easy to set up. Get any continuous integration software (I would recommend BuildMaster since I am a developer for it and it's free now) and you'll never have this problem again.
Out of nowhere the "Publish Web Site" option in Visual Studio isn't doing anything for a particular project. It still compiles the site (no errors), but it never copies the output to the destination directory. I've tried changing the destination to a number of locations, and it creates the new folder, but never copies the output. I tried other projects and they seem to work fine. What would stop one project from copying the output?
Update: This is a web site project, if that makes any difference.
It appears the problem was with the "Allow this precompiled site to be updateable" option. This was turned off at some point and was causing the problem. Turning it back on caused the files to be copied again. Why should this make a difference? Is there another setting somewhere that needs to work in conjunction with this setting?