Deploying lightswitch web application on the server: HTTP Error 500.19 - Internal Server Error - visual-studio

I have a problem with deploying the 3 tier lightswitch web application on the server.
On the local server IIS7 everything works perfect but when i deploy it to the vps which also runs IIS7 it gives me this error when i try to navigate to the page:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
I have published a package on the disc, uploaded it to the server, installed the application under Default Website with success. But when i navigate to the application it shows that error...
This is what is shown as a problem area:
Config Source
141: </system.serviceModel>
142: <uri>
143: <schemeSettings>
It is part of the web.config file. When i open it and go there i see this:
<uri>
<schemeSettings>
<add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes" />
<add name="https" genericUriParserOptions="DontUnescapePathDotsAndSlashes" />
</schemeSettings>
</uri>
and add part is underlined which gives me further explanation of the error:
web.conf error: the element 'schemeSettings' cannot contain child element 'add' because the parent element's content model is empty.
I tried looking on the internet for the solution but no luck...
Thank you!

I have found what was the problem.
On the IIS i had DefaultAppPool selected for the application. When i changed it to ASP.NET v4.0 error was gone. This can be done in application basic settings.
Open IIS Manager, select the application, in the right column of explorer click Basic Settings, click button Select and choose ASP.NET v4.0, click Ok.
That was it for me. Hope it helps someone...

Related

Getting error after publishing my project into Azure App-Aplication (Web Hosting)

I tried several times to publish my website from Visual Studio 2019 to the Azure server but I getting errors.
I have an MVC-CORE 3.0 project which works fine using IIS EXPRESS (localhost).
In my web-application, there is a login page (home page), which is the first view. It perfectly works both on Azure and the localhost.
But once I using the published website and log in to my account (=move to the next view), I got this error:
*The login process works great using localhost
*I already published my app 2 months ago and it perfectly worked!
This error appeared just after republishing (private needs).
Please HELP ME !!!
I think you should try these way to solve you issues.
According to your describe, you can open you site correctly. But when you do other operations, the error occured. Here are my advice,
Tips 1, check your web.config file ,make sure you dbConnection is correct. Pls pay attention to Connection strings in portal.And the priority on the portal is higher than that in the web.config.
Tips 2, check your web.config file ,modify the config, like the post. Add settings like below,
<configuration>
<system.web>
<customErrors mode="Off" />
</system.web>
</configuration>
If my advices don't work, you can try to solve the problem by Monika Reddy-MSFT's way.
Update
If you can't open you site correctly, pls check Stack settings in portal.
And next time when you republish your apps, you can backup publish file first in order to restore previous version. Or you can publish your app in slot, if it works fine then you can swap it.
Have you tried to set the environment variable inside the web app on Azure?
If not, please try this:
Open the Application Settings blade --> Scroll Down to -->"Application Settings" --> add the "ASPNETCORE_ENVIRONMENT" and "Development".
Also please take a look at this doc for more reference.

WCF not working when debugging in visual studio but works in IE

I have a WCF that is hosted in an ASP.NET application. Suddenly, the WCF service has stopped working when i debug it in visual studio 2010. When i try to access the service, it throws the below exception.
CommunicationException was unhandled by user code. The remote server returned an error: NotFound
I have WCF tracing enabled but no errors are being logged.
The strange bit is that if i deploy the code to my QA server and access the application, the service works fine, so the code looks like not the problem.
If i also get the source code currently running in production successfully & try debugging it in my dev environment, it fails with the same error i mention above.
Any one have an idea what could be messed up in my dev environment?. I have tried both IE, Firefox & Chrome & the results are the same.
I after a very long debugging involving deleting Bin & obj folders and lots of rebuilds, i finally got this WCF service working again.
First, i suspected the service could be corrupted somehow, so i tried to update the service reference in my silverlight application but was bumped with the following error.
There was an error downloading 'http://localhost/mySite/Webservice/GetData.svc'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'http://localhost/mySite/Webservice/GetData.svc'.
The remote server returned an unexpected response: (405) Method Not Allowed.
The remote server returned an error: (405) Method Not Allowed.
I then browsed to the physical folder path to confirm if really my .svc file was there and indeed as expected, the file was there.
Trying to Browse to the path http://localhost/mySite/Webservice/GetData.svc in my browser bumped me with another error below.
HTTP Error 404.7 - Not Found The request filtering module is
configured to deny the file extension.
Most likely causes: Request filtering is configured for the Web server
and the file extension for this request is explicitly denied.
This made me start thinking that suddenly, IIS 7.0 has decided to block access to my .svc files.
I then added fileExtension=".svc" mimeType="application/octet-stream" to IIS, restart IIS but got the same error.
I then read on some blog i cant remember about adding <add fileExtension=".svc" allowed="true" /> under <requestFiltering> tag in file applicationHost.config located at C:\Windows\System32\inetsrv\Config, still nothing changed. Tried adding <mimeMap fileExtension=".svc" mimeType="application/octet-stream" /> under serverSideInclude in the same file, again with no luck.
Tried this http://www.adamwlewis.com/articles/iis-7-not-serving-files-4047-error still with no luck.
The following 2 steps are i think what resolved the issue.
I added a mapping for the SVC extension to ASP.NET by running ServiceModelReg.exe -i from C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation
Browsed to my .svc file in the browser and this time it looked like i had made some progress but still, i had one more error to overcome . The is bellow.
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
I resolved the above error by registering the correct version of ASP.NET using the ASP.NET IIS Registration Tool (aspnet_regiis.exe,) as described in the link below
https://msdn.microsoft.com/en-us/library/hh169179(v=nav.70).aspx
At this point my service was back to normal as it had always been. I still haven't figured out what messed up my development machine.

Cannot debug ASP website on IIS 6.1

I am new to our company and just trying to set up my workstation. We have an ASP website I am trying to debug in Visual Studio 2010. In the "Web" section of the project properties we have the "Use Local IIS Web server" option selected, however when I try to debug the page I'm working on I get the error "Unable to start debugging on the web server. See help for common configuration errors." I can see the site in IIS (Under Sites -> Default Web Site -> SiteImWorkingOn), and both IIS and the VS project are using .NET 4.0. Any suggestions?
EDIT: I should mention that I've run the "aspnet regiis -i" command in the command prompt to make sure IIS was running .NET 4.0
SECOND EDIT: I found that ASP.NET was not turned on, after doing this I am getting the following error:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x8007000d
Config Error
Config File \\?\C:\Projects\sym_Periscope_NEAL\Periscope\Web\web.config
Requested URL http://localhost:80/Periscope/Pages/Dist.aspx
Physical Path C:\Projects\sym_Periscope_NEAL\Periscope\Web\Pages\Dist.aspx
Logon Method Not yet determined
Logon User Not yet determined

Why am I getting error 500.0 in when using IIS Express (significant debug info included)

I created a blank MVC 3 application on VS2010 SP1, and set the app to use IIS Express. When I debug, I get error 500.0 (0x80070585)
I am able to succesfuly run the app using the VS dev server
I have set the app directory to Full Permissions for Everyone, just to eliminate all possibility of security issues. I have further verified that IIS express is able to hit the web.config by confirming it using SysInternals ProcMon. ProcMon does not show the IISExpress process attempting to read from any other files in my application directory.
I have followed the suggestions in the following question, but it does not give me any better information. HTTP 500 Internal Error - IIS websites
No logs are generated in the IISExpress directory in either the Logs or TraceLogs directory, but a log is created in Temp, however it is not very useful.
Successfully registered URL "http://localhost:62017/" for site "MvcApplication1" application "/"
Registration completed for site "MvcApplication1"
Request ended: http://localhost:62017/ with HTTP status 500.0
Request ended: http://localhost:62017/ with HTTP status 500.0
Request ended: http://localhost:62017/ with HTTP status 500.0
There are no messages I am able to find in the Event Viewer
**Updates : **
Disabled firewall, no change
Ran IISExpress via command line, no change
I had the same issue last week, the app running perfect in dev web server from VS Studio. But in IISExpress anytime HTTP Error 500. My solution on this time was:
close VS Studio - solution set with IISExpress
got to: /Document/IISExpress/config/ in your profile
rename or delete applicationhost.config
open your solution in VS Studio
a Dialog will fire up from IISExpress - this will set a fresh config.
try to run your web app
You may have some mime code in the Web.Config file like this:
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
if so, you should remove mimeMap before adding like this:
.
..
...
....
</system.web>
<system.webServer>
<staticContent>
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
</system.webServer>
....
...
..
.
This may be related to a conflict between the IIS Express applicationhost.config and your web.config.
A mimeType was added to my local web.config that was already present in the applicationhost.config and IIS Express started serving many 500 errors.
You may also notice this error in your Windows Event Log, "The directory specified for caching compressed content is invalid. Static compression is being disabled."
More info: http://blog.degree.no/2013/04/the-directory-specified-for-caching-compressed-content-is-invalid-static-compression-is-being-disabled/
I removed the mimeTypes from the web.config and the issue was resolved.
applicationhost.config location: C:\Users\[User]\Documents\IISExpress\config
reinstalling iis express appears to have resolved this problem
Are you using any PLINQ(.AsParallel) or Parallel.For or similar methods? I've found that the AggregateExceptions they throw aren't handled well by MVC (In my case, I got a blank 500 page and nothing in Logs/Event logs).
I identified the problem by paying attention to the "First Chance" exceptions which are logged in the Debug output window in VS. Try running the site, waiting for it to error, clearing the Debug window and the reloading the page. Do you see anything useful?
There might be a problem with your config files, specifically web.config and applicationhost.config.
The only way I know how to diagnose this, is to publish a build to regular IIS, and in IIS Manager check the "Error Pages" module of the Site. If it is indeed an issue with those config files, you'll get a popup here with something along the lines: "Cannot add duplicate entry of type …". Google accordingly.
If the "duplicate entry" is of type "error", you can try adding the following element below httpErrors:
<remove statusCode="404"/>
That is, assuming you have an Error element below the HttpErrors with statusCode 404. (I had once.)
In my case the issue was caused by using windows authentication + firefox + wrong domain login with insufficient permissions.
Details:
My dev machine is using windows domain "domA", the application will run in an environment accepting logins from domain "domA" and "domB". While on the webserver both will work, on my dev machine only my account in "domA" has sufficient permissions to access all files of the application. In IE "domA" is used by default while in FF I get a login dialog where I did login with my account from "domB".
Confusing issue I know, but maybe there is someone else having the same situation. At least it will help me the next time I run into it. :)
Just in case catches someone else out, I had similar error but the issue was I had updated my web.config and there was an extra ">" character where it should be.. so malformed web.config file can cause the same behaviour.

allowDefinition='MachineToApplication' - MVC3 ERROR

I'm developing an application in MVC3 (http://www.colombiatrolley.com/sitrolley). In my computer it runs correctly, but when I upload it to the server (a hosting service) I get this error:
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
I know it is a very common error but I have not fixed it yet.
Some config sections are only allowed at the "root" of the application, then authentication section is one of them.
You need to configure IIS to run your your site as an application, not a sub-directory in an existing application.
For IIS 7+, right click the directory that contains your web application, and select "Convert to Application".
EDIT:
Arie van Someren is right. Looking carefully at your error, you want the <authentication> configuration to be in the web.config one level up, not the web.config in Views.
I had the same problem. I solved it by deleting the obj folder that appeared after doing a "Build > Publish".

Resources