I have an Umbraco website that is running on IIS7.5 and is Load Balanced. The users are updating via one side only so that we don't get any issues whilst updating the site. The problem is, each day we have to force a restart of the website by touching the web.config file. If we don't touch the web.config file, the users are displayed with an Object reference not set to an instance of an object error. I have configured the DistributedCall element in the umbracoSettings config file, but can't figure out why I have to keep restarting the website.
Any ideas?
It's not a perfect solution, but I've managed to get this working by changing the Regular Interval Time in the Application Pool.
Related
The Problem
I have a website running in IIS. If I rename or delete one of the layout page .cshtml files under /Views/ the site immediately begins throwing following yellow screen error as expected
The layout page "_Layout.cshtml" could not be found at the following path: "~/Views/_Layout.cshtml".
What surprises me is that if I recreate or rename the file so it is exactly like it was before, the yellow screen persists. Why is this particular 500 error sticky?
I currently think that this has something to do with IIS and is specifically related to error handling. The site immediately detects that the layout page file is missing. It does not immediately realize when the file is back in place.
Thanks!
Some interesting clues
This happens on all of my sites I've tried this on so far. It isn't related to a specific site
I tried this on two websites at the same time. On one site I repeatedly and consistently refreshed the page hoping for a success. On the other, I left it alone for several minutes before checking again. The site I leave alone will resolve its problems and find the layout page on disk again. The site I continually make requests to appears to display the error indefinitely.
What I've tried
I have reproduced the problem on Umbraco websites using Umbraco's default routing as well as regular MVC pages using custom routing. The problem is the same for both.
I don't have output caching configured in IIS
When I am reproducing the yellow screen error, I am able to reproduce the error in multiple browsers, so I don't believe it is related to browser caching
I checked on the httpRuntime in the root web.config and the fcnMode is set to fcnMode="Single"
I've fiddled around with the web.config customErrors and httpErrors. Nothing I've done here has affected the problem.
I am able to reproduce the problem on websites where there is no custom code for caching. No CDN. No load balancer.
Versions
IIS: I have reproduced the problem on Windows Server 2012R2 running IIS 8 and Windows 11 running IIS 10
CMS: All of the websites I have tested on so far are Umbraco 7 sites. However, I have reproduced the problem on pages that are routed using Umbraco's out of the box routing as well as pages that are just set up using MVC and aren't leveraging Umbraco.
It appears to be part of the behavior of FcnMode="Single". See https://learn.microsoft.com/en-us/dotnet/api/system.web.configuration.fcnmode?view=netframework-4.8. It isn't an issue with caching. It is a problem with the way that the site's file change notifications (FCN) are configured.
The sticky 500 behavior on renaming files happens when I use FcnMode="Single" but not when I use FcnMode="Default".
FcnMode="Single" will result in only a single object to monitor file changes. This single object is responsible for monitoring changes to files in the main directory and sub directories.
FcnMode="Default" will result in a separate object to monitor file changes for each directory.
Umbraco sites, by default, use FcnMode="Single". This makes sense because Umbraco sites cache under very deeply nested directories in /App_Data/. This can result in so many of these monitors that it can affect the performance of the site. There is a great explanation of FcnMode and why it matters for Umbraco here: https://shazwazza.com/post/all-about-aspnet-file-change-notification-fcn/
Unfortunately, it appears that the single file monitor can miss renames of files in some cases.
I have a ASPNET Core application that works fine on my machine with URL https://localhost:5001/, but not on the client's server, where the application's URL is https://example.com/subfolder/.
The problem seems to be an error in a redirect on one of the pages, where a user is sent to /something rather than /subfolder/something. I'm using relative URL's only. In the rest of the application, redirects work fine.
I was wondering if it is possible to debug the application in Visual Studio and have it run in a subfolder, preferably using Kestrel, but IIS Express might be an option too.
Update after comments While adding specifics about the problem, I found out that I was looking at it from the wrong angle. The actual problem seems to be that the application is started as https://example.com/subfolder (no trailing slash). Redirecting to ./something (or just something) will result in https://example.com/something.
(My real question therefore would be: If https://example.com/subfolder is opened, how can I redirect to https://example.com/subfolder/? I'll first try to fix this myself, maybe it should be configured in the webserver. In the meantime, I'd still like to know if subfolders can be used in debugging)
In development, it seems you can't debug your program in subfolder.
I don't recommand you to spend a lot of time to serach how to do that, and I also suggest you use IIS. Because in IIS, it supports Virtual Application, and I think it is you want.
Steps:
create a main website, and create a virtual application.
choose the project folder as Physical Path, mainsite and virtualapplication.
open vs2019 as administrator, maybe you need open it twice,and one for main site and another for virtual application.
then you can attach to a running process on your local machine.
you can start your two webapp in one port, and you can debug them.
Has anyone come across the problem whereby Umbraco says content changes have been saved successfully, you close everything down (including webmatrix), only to go back in and find that the changes have been lost?
I'm working on my localhost.
I think it's to do with caching of data on webmatrix, but I haven't a clue how you'd start up http://localhost:xyz without using webmatrix (if only to rule it out of the equation).
I believe when the message displays, the changes will be stored in database and next time you open your Umbraco for some reason, the XML file does not sync with database. In order to force it to be synced, simply delete the Umbraco.config file and restart WebMatrix and re-open the Umbraco.
The main advantage of using Webmatrix for Umbraco is it's IISExpress. So if you want to work with Umbraco without Webmatrix, add your website to IIS directly and since then you can have access to your site.
Seems to be a mystery problem still happening in SQL CE, for both WebMatrix and Visual Studio users alike. See the ongoing discussion in the umbraco issue tracker for more information at http://issues.umbraco.org/issue/U4-4621
We are developing an ASP.NET MVC web app that will be hosted on Windows Azure. We have deployed the application a few times during development without any problems. It was actually quite surprising how smooth the process went. Then, when we went to deploy the app for beta testing we kept getting 403 Access Denied errors whenever we tried to navigate to the base url of the site. If we tried to navigate to any of the various Controllers and Actions of the site thereafter we would get 404 The resource could not be found errors.
The other strange thing that we noticed is that we had defined the authentication redirect page to be /Access/SignIn rather than the default Account/Login. Everything worked fine on the development machine and we were redirected to /Access/SignIn but when publishing to Azure we saw we were being redirected to /Account/Login. This made us think there was an issue with the web.config file.
We enabled remote desktop on the Azure deployment and took a look at the web.config file only to find out that it was almost completely empty! The only setting in there was the machineKey. We manually copied the web.config from one of our development machines up to the Azure virtual machine instance and everything started to work from there on.
What in the world would make the deployment wipe out the web.config file? And how can we prevent this from happening as we aren't going to be able to update the web.config file manually every time we deploy an update?
I often solve these sorts of problems by looking at the contents of the .cspkg file. This allows me to avoid waiting for the Azure package upload and initialization. Here are the steps to view the .cspkg contents:
Navigate to the /bin//app.publish folder
Rename the .cspkg file to .cspkg.zip.
Open .cspkg.zip. You will find a .cssx file (which is really a zip file) for each project referenced by the Azure project.
Extract the .cssx file you wich to inspect and rename it to .cssx.zip
Open the .cssx.zip and look around. For WorkerRoles, check out the approot folder. For WebRoles, check out the sitesroot folder.
I am seeing a weird behavior on IIS7 on Windows 2008. I have an ASP MVC application installed and fully functioning. Every time i reset its application pool, the website stops working and displays a 404 error.
The only workaround I found for this is:
1. Rename default.aspx, global.aspx, and web.config to something else
2. Create a simple index.htm file and place it in the root
3. Browse to the site (which correctly displays index.htm)
4. Rename the three files back
At that point the site will load properly and work as expected. Anyone has any idea why that would happen?
Thanks!
Check out the Windows Event Viewer, under Application. The website might be throwing an exception each time it attempts to restart.