Asp.Net Mvc Cloud hosting - asp.net-mvc

Asp Net MVC project works fine in IIS Server ,But after uploading it to a cloud space ,it shows an error code 500.19 ,I put the database in cloud ,it also works fine with IIS
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="false" />
<handlers accessPolicy="Read, Script">
<add name="PHP via FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe|-d open_basedir=C:" resourceType="Unspecified" requireAccess="Script" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="dotnet"
arguments=".\TickLogicApplication.dll"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
hostingModel="inprocess"/>
<httpErrors errorMode="Detailed" existingResponse="PassThrough" />
</system.webServer>
</configuration>
and in my local project .Can some one give me a solution?

Related

Problem in hosting Dot net Core on windows server with IIS (nop commerce)

I want to host nopcommerce 4.10 on windows server IIS. I have installed .net core hosting bundle, .net Sdk and also set its environment variable c++ redistributable package is also installed. But I am still getting this screen. I have also enables stdout but does not getting any log.
I've tried many solutions from forums and all other site but still getting same issue.
Web.config
<configuration>
<system.webServer>
<modules>
<!-- Remove WebDAV module so that we can make DELETE requests -->
<remove name="WebDAVModule" />
</modules>
<handlers>
<!-- Remove WebDAV module so that we can make DELETE requests -->
<remove name="WebDAV" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule"
resourceType="Unspecified" />
</handlers>
<!-- When deploying on Azure, make sure that "dotnet" is installed and the
path to it is registered in the PATH environment variable or specify the
full path to it -->
<aspNetCore requestTimeout="23:00:00" processPath="%LAUNCHER_PATH%"
arguments="%LAUNCHER_ARGS%" forwardWindowsAuthToken="false"
stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" startupTimeLimit="3600"
/>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
%LAUNCHER_PATH% and %LAUNCHER_ARGS% did not get replaced, it should be something like
<aspNetCore requestTimeout="23:00:00" processPath="C:\Program Files (x86)\dotnet\dotnet.exe" arguments=".\Nop.Web.dll" forwardWindowsAuthToken="false" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" startupTimeLimit="3600" />

How do I solve HTTP Error 500.19, on External Host Server

I had this error on my local machine, and I was able to give the file permission, but how to solve this error on my host server
I tried to edit web.config, but I still have the same error
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
</system.webServer>
</configuration>
Your host probably didn't install HttpPlatformHandler yet. Talk to them and not here.
[Updated: For RC2 and above, a new module is required instead of HttpPlatformHandler, https://github.com/aspnet/Announcements/issues/164]

MVC5 routing error (404.0) error on IIS 7.5

An old story of everything works fine on the development machine but not on the host server.
HTTP Error 404.0 - Not Found
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Trying to produce the same error on the development machine by adding <remove name="UrlRoutingModule-4.0" /> to system.webServer - modules and resolving it when adding <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />, but that not works on the host. I've also try <modules runAllManagedModulesForAllRequests="true" /> but nothing changed.
And here is the handlers part:
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<remove name="WebDAV" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
Few more information:
MVC.Net 5.2.2.0
IIS 7.5 on Windows 2008
Integrated .Net 4.0 application pool.
Is there anything else that I should do?
Now, having the same problem in IIS8, any idea?
I had similar problem. It turns out to be discrepancy with Virtual folder name and the URL I was constructing to call Web API route:
var URLGetUserAccesses = "/api/Login/GetUserAccesses";
Vs.
var URLGetUserAccesses = "../api/Login/GetUserAccesses";

IIS default document not found

After I manually set up a virtual directory in IIS on an Umbraco website (that uses MVC), I get a 404 not found error when attempting to browse the URL:
mydomain/myvirtualdirectory/
I have the file index.html in the physical directory that the virtual directory points to and I configured IIS to look for index.html as the default document for the virtual directory.
Turns out that Umbraco was 'intefering'. I needed to add a web.config under the physical folder that the virtual directory points to (the 'ExtensionlessUrlHandler' bit is switching off functionality applied by Umbraco, which was the main problem). This can all be generated via the UI in IIS, or can just be added manually.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.html" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="iisstart.htm" />
<add value="default.aspx" />
</files>
</defaultDocument>
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
</handlers>
</system.webServer>
</configuration>

Mvc Mini Profiler requests for files with and without RouteBasePath

This is driving me crazy, I'm testing my app with both Firefox and IE, on Firefox works just fine, but on IE mini profiling is making these 5 requests
/Content/mvc-mini-profiler/mini-profiler-includes.css?v=1.9.0.0
/Content/mvc-mini-profiler/mini-profiler-includes.js?v=1.9.0.0
/Content/mvc-mini-profiler/mini-profiler-jquery.tmpl.beta1.js
/mini-profiler-includes.css?v=1.9.0.0
/mini-profiler-includes.js?v=1.9.0.0
I put the RouteBasePath to be ~/Content/mvc-mini-profiler but for some reason is also making requests without it.
Am I doing something wrong or is this some kind of bug?
Thanks.
For the last two
/mini-profiler-includes.css?v=1.9.0.0
/mini-profiler-includes.js?v=1.9.0.0
View the source and make sure you don't have any script or link elements with those urls in the src or href attributes. That would make a request to the server without your base url.
Did u added below code in you web config?? if not then add and try it
<system.webServer>
...
<handlers>
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>
and also you can try with
<system.webServer>
<handlers>
<add name="UrlRoutingModule1" path="mini-profiler*.js" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
<add name="UrlRoutingModule2" path="mini-profiler*.css" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
<add name="UrlRoutingModule3" path="mini-profiler*.tmpl" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
</handlers>
</system.webServer>

Resources