403 Error (Forbidden) when trying to view my MVC4 application on AppHarbor - asp.net-mvc-4

I'm new to both ASP.net and AppHarbor. I also have never deployed an ASP.net application before.
I've set up an MVC4 website using the Visual Studio 2012 release candidate and it is near completion. Locally, it is working fine / as expected.
To send the client a current progress demo, I've been advised that I should use AppHarbor to host the application / website.
I've gone through the process of setting up a Git repository and connecting that with AppHarbor. I then used the Build -> Publish Selection option in Visual Studio to create a 'Web Deploy Package' within my local copy of the repository. Finally, I pushed the files (shown below) that were created to the repository and AppHarbor listed the commit as 'Active'.
However, when I click Go to your application, all I get is this magnificent 403 page.
I've tried a bunch of things (none of which have worked so far) that I've seen in forums (including here and AppHarbor support), including:
Adding a <modules runAllManagedModulesForAllRequests="true"/>
Ensuring I didn't have multiple web projects.
Checking and confirming that there are no errors listed in AppHarbor.
I've turned CustomErrors off, yielding no differences.
I haven't touched any of the .config stuff since I began the project (because I don't know how to use them yet). Perhaps I've just not added something blatantly obvious in there?

You shouldn't use the Web Publish stuff when you want to deploy to AppHarbor. AppHarbor takes your source code straight up, builds it, tests it and deploys it.
Here's a guide on deploying your first app on AppHarbor using Git. There's also a video on the AppHarbor front page that you can check out.

Related

Deployment error: "The requested page cannot be accessed because the related configuration data for the page is invalid"

What happens?
I publish a website to UnoEuro on a windows server.
When I do I keep getting the error message:
"HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid."
What have I set up/tried?
What I've done is that I've created a .NET Core 2.1 Web API which hosts fine locally on my computer using IIS. I have then published the web api to the hosting site UnoEuro where I can see that the files are uploaded as they should be.
I asked the hosting sites support, they told me to just ensure that it was deployed as self-contained but that otherwise they could not help further. It looks like there is a hosting issue of some sort related to that it cannot seem to find the webconfig file. At least that's what the error message says.
Is there any form of setup I should make? A configuration I should change? Should I set up some SSL settings in the web API which I might have missed? When I started the project I told it to enforce HTTPS, but surely I should get another error message if that was the fault?
I've tried publishing with the target runtime set to both x64 and x86.
I've never published an API like this to anything but Azure before, so I might be doing a thing or two wrong but I cannot see what it should be? I have Googled around but not found anything that seems relevant which has worked.
Most of the solutions seem related to changing the server environment which I don't have so much control over, I mostly just have control over the application/web api, at least that's what it looks like to me.
Hope you have any suggestions, I'm all eyes n ears.
Side question: Should I use IIS Manager for this? I'm currently publishing through Visual Studio 2017.
Images for further understanding
Publishing settings
Deployed/published files
Error message I get
EDIT:
I tried moving the files to /public_html on the same domain as ISS Manager seemed to indicate it expected the config file to be there.
That then resulted in a different error message as you see below.
Link from error message: https://go.microsoft.com/fwlink/?LinkID=808681
It's hard to say exactly, but I think the issue is that the ASP.NET Core hosting bundle is not installed on the server. There's two pieces to hosting in IIS. First, you need the .NET Core runtime, and then you need the ASP.NET Core hosting module for IIS. Deploying as self-contained buys you the runtime, but not the hosting module in IIS. There's non-standard sections in the Web.config created by publishing an ASP.NET Core app. The hosting module shims in support in IIS for these config sections (among other things). Therefore, the config error seems to imply that this is not happening.
If you don't control the server, there's not much you can do about it. Honestly, at this point, I wouldn't host anywhere where you do not at least have some measure of control over the environment. You can get a full VPS from numerous hosting services for $5 or less a month. Either continue hosting in Azure, or look into other respected cloud providers like DigitalOcean, AWS, etc.

IIS 8.5 on Server 2012 R2 stops responding after a time

I recently updated a server from 2008 R2 to 2012 R2 that hosts a few MVC sites and a Web API. After deployment, everything seems to work fine for a few days before the web api seems to fail. It returns a 404 for all requests to the API from the failure forward. The parent MVC site seems to continue working fine.
A few things:
The web api is hosted as a web application inside a parent website within iis.
This is a 4.6.2 framework site and api.
I would prefer it to be its own site but I don't control this.
It seems to stop at roughly the same time when it occurs - around 2:35 AM
The only route defined by the web api is a GET
I've checked the event log as well as IIS logs. The event log doesn't reflect anything during these times and the IIS logs just show a 404 response. Resetting IIS/AppPools/etc... don't fix the api nor does restarting the machine. In fact, the only thing that seems to fix it temporarily is a VS publish over top of site.
I suspect something to do with MSDeploy but have nothing concrete. Does anyone have any ideas on where to look or what to look for? I feel it must be something to do with the server configuration as we've never seen this problem prior.
I ended up finding out the problem. Our project uses NLog with the config specified to create a new log file daily. Something within either NLog or IIS recently decided not to play nicely together. A temporary fix was to turn off the daily file creation from within NLog. Since making this change, the site has stayed up consistently for the past week.
This post is what got me checking into NLog as a possible culprit.

Kestrel / IIS Express requires restart before edited .cshtml view changes are shown in browser

I'm in the process of setting up my first ASP.NET vNext web application project.
I've got as far as getting the default project to build and run fine in both Windows and OSX. I've tested with kestrel on the mac, and in Windows IIS Express along with kestrel.
The problem I have encountered is that in Windows, editing a cshtml View file while the web server is running isn't reflected when I next refresh the browser.
In OSX, I can run 'dnx web' and navigate to localhost:5000 and browse the site. I can then edit the .cshtml View files, switch back to the browser, hit refresh, and I can see all the changes. This is what I expect to happen and happened in previous versions.*
In Windows, I can either run dnx web or IIS Express on the same site as I was using on OSX, navigate to localhost:5000 (or for IIS Express its own port number) and browse the site. I then switch to edit the cshtml View files, but when I switch back to the browser to reset, the changes aren't shown. It's not until I restart kestrel or IIS express that the changes are shown.
Curiously, however, I can edit a .cs Controller file and the site then recompiles by itself and I don't need to re-start it - in Windows at least. (In OSX, editing a controller file doesn't cause an auto-recompile, but that's an aside, I believe dnx-watch will fix that).
Is there something that I've missed in the project.json, or another setup file, which is causing the issue in Windows?
I have tried:
creating a second completely clean web application project
reinstalling ASP.NET
desperately, lastly, creating a clean install of Windows 10 with Visual Studio 2015 Community Edition, to no avail
What's the way to get Kestrel or IIS Express in Windows to serve the updated cshtml View file after it's been edited, without restarting the server?
*side note, ASP.NET MVC in OSX is awesome!
Following on from #SRQ Coder's response, in particular the reassurance that it's supposed to work as I hoped, I found the reason but as yet no decent solution.
My project directory is located on a network share and I load the projects directly from there (I run Parallels Desktop on a mac). This works great with ASP.NET 4.x / MVC 5 (and earlier). However it looks like ASP.NET 5 doesn't support this setup.
The moment I copied the project folder to the local C: drive it all worked fine
When opening the project from a \\network-share, the project loads and I can run/debug the website, but CSHTML edits aren't shown in browser until IIS Express/Kestrel is restarted
Opening the project from a X:\ mapped network drive doesn't make any difference
I'm not able to recreate your problem on my machine: VS2015; Win10 etc. in either the IIS mode or Web: localhost/5000 mode and on multiple browsers.
I can edit both 'shared' cshtml files like '_Layout' and also the default 'home/index cshtml file with no problem.
Since you've re-installed so much of your system, I'm wondering if you have not re-installed web-essentials and enabled 'browser link'.
I feel your pain...

IIS Express re-compiling on almost every call after load of NuGet package

My web application has been working fine. Just recently, I began trying to add Twitter Bootstrap to my project using NuGet (it doesn't appear that NuGet is the issue because the same thing happens if I add TB manually). After doing so, I noticed that my app was misbehaving ... some items that I was displaying to a page from server-side cache were missing.
As I dug into this, I realized that my app was being re-loaded on almost every call. I placed a break point in BundleConfig and sure enough ... almost every call, I'm hitting the break point.
If I uninstall the package, things start working fine again.
Furthermore, it doesn't seem to be just Twitter Bootstrap. It seems that if I install any new packages into my system, this starts happening ... almost as if I'm pushing IIS Express over some sort of memory boundary?
I've tried to verify some of the normal IISExpress issues with re-compiling ... things being written into bin, etc. But I don't see any activity on that front (and I'm definitely not explicitly writing anything there). I'm not writing to web.config in code or anything either.
Last bit of information -- if I publish the non-working app to my QA server, everything works fine. QA server is full-blown IIS -- not express. This further confirms that nothing is being written into bin or messing with web.config.
EDIT
When I say I added Twitter Bootstrap, I mean that all I did was add it to the project. I haven't even referenced it in any pages. I haven't included it in my bundling/minification, etc. It's basically just sitting there unused but still causes my app to recycle/recompile.

Can adding a solution to TFS server cause WCF to break?

I am running on SP1 beta of 2010... it may or may not related to the beta. But, in general, can adding a project to the codeplex TFS server somehow make WCF break when also inside an Azure project?
Seems to be the pattern for me. Immediately upon launch I get a ServicePoint exception. If I remove the app from source control everything works fine.
My project consists of
Azure WCF hello world application
VS2010 SP1 beta
Adding codeplex TFS reference causes exception
Is it a CommunicationFaultedException? If it is, it is a bug when working with Azure 1.3 SDK projects that are checked into TFS. Make sure you have the Web.config file checked out (writeable).
If not, can you give any other information on on the ServicePoint execption?