publishing fresh project on IIS - visual-studio-2017

I have created new project web.net core without doing any changes and use the created default files. I can successfully run this using the debug mode, but if I am going to publish it on IIS it will give me error: HTTP Error 500.19 - Internal Server Error and here is the error details:
The requested page cannot be accessed because the related configuration data for the page is invalid.
Error code:
0x8007000d
I already tried to modify the web.config to point the processPath to my dotnet location but it still have the same error result:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\WebApplication1.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: d4e1dda9-f8ba-4752-883d-43c86faa3c60-->
I am not yet sure if this one is related to my IIS setup configuration. Any suggestion/comments if encountered this. TIA

check that under which application pool identity your site is running.
to check you could follow the below steps:
1)open iis manager.
2)select application pools and select your application pool name from the middle pane.
3)select the advance setting from the action pane.
then assign permission to the site folder.
1)open iis manager, select your site.
2)right-click on-site and select Edit permission.
3)In properties, windows select the security tab-> edit.
4)one pop up window will open in that select add.
5)in select user or group windows type "iusr" in object name text box and click ok and assign full permission.
6)Repeat the above steps and add "iis_iusrs" and "IIS AppPool\" user permission.
7)After doing changes restart the iis server.
You need to install the “ASP.NET Core/.NET Core: Runtime & Hosting Bundle” on to the server.
you could also set load user profile to true in iis application pool advance setting.
please refer this below link for more detail:
ASP.Net Core Publish: HTTP Error 500.19 - Internal Server Error
500.19 error or 502.5 error when hosting asp.net core 2 application inside IIS

Related

Flask app IIS: Keep getting 404 when routing to other pages

I need help on how to make routing in my flask app hosted using IIS windows server 2012 possible. The home [starting page] works though also cannot load images but it works. The error I get is 404 whenever I click on links leading to other pages in the application. Is there anyone who can assist and tell me what I am doing wrong?
Error i get is
You can try to add the following to the web.config file:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" >
<remove name="UrlRoutingModule"/>
</modules>
</system.webServer>

Econnect Warning: Distributed Transaction was used

We just moved one of our apps which is a .net windows service to a new 2016 server in a different domain than the Microsoft GP database server is in.
We are using EConnect 14 (GP 2015).
We are getting 1000's of these warning in the application event log, which causes a problem because we use System Center and when it sees all those warnings it is spiking the CPU to process them. They don't stop until we restart our windows service.
Here is the warning.
Distributed Transaction was used
This could be caused by new connection strings used within each xml document, but reusing the base transaction scope.
Configuration Setting 'ReuseBaseTransaction' is by default FALSE. Remove this configuration setting, or set it to FALSE if this was not the expected behavior.
i've tried adding this into the econnect service config and my apps config, tried setting it to false, tried true as well and the warning persists.
<appSettings>
<add key="ReuseBaseTransaction" value="false"/>
</appSettings>
We are using the econnect windows service, we are not bypassing the proxy and going directly to the stored procs.
Do you have any idea how to prevent this warning. I really don't care if the transaction is distributed or not. I found this related article but it offers no solution.
https://dynamicsgpland.blogspot.com/2010/09/econnect-2010-fills-event-log-with.html
as well as this one.
https://community.dynamics.com/gp/b/gpdynland/archive/2010/09/23/econnect-2010-fills-event-log-with-warning-34-distributed-transaction-was-used-34
-Randy
There is a flag in the eConnect API that you can configure in your app.config in order to disable the logging of these promotions.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="LogDtcPromotions" value="false"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>

Azure flask <handler> scriptProcessor could not be found in <fastCGI> application configuration

I am trying to deploy Python Flask application in the Azure web app. I had create web app(Flask) and published my code. After publish, I am getting below error from the site.
The page cannot be displayed because an internal server error has
occurred.
When check the Log, i could see the below error.
But this was happening only in my subscription(free subscription got with MSDN). But working fine in the Organisation subscription.
The <fastCGI> settings must be in the applicationHost.config file (in the system.webServer section) of IIS. Just putting it into web.config does not work (confirmed by testing it on a local IIS, not in Azure). An example configuration may look like this:
<fastCgi>
<application
fullPath="D:\home\Python27\python.exe"
arguments="D:\home\Python27\wfastcgi.py"
maxInstances="16"
idleTimeout="21600"
instanceMaxRequests="10000000"
signalBeforeTerminateSeconds="60"
xdt:Transform="InsertIfMissing"
xdt:Locator="Match(fullPath)">
<environmentVariables>
<environmentVariable name="PYTHONHOME" value="D:\home\Python27" />
</environmentVariables>
</application>
</fastCgi>
You may want to adjust this configuration.
This should solve it for a local IIS where you can edit applicationHost.config. I'm not sure about Azure, but maybe you can find some hints here: https://github.com/Azure/azure-python-siteextensions/issues/2.

Webservice .Net 4.0 publishing problems in IIS7

I cant get my Webservice published, it should be simple:
I create the app in the IIS,
place it as a 4.0 Classic .Net
I publish it from .Net Solution within VS2012 Right click and publish
on the Webservice project.
The files are placed and it should show by itself on the browser on the URL of the server specified.
But I stumbled upon the following problems:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
So I've looked for It and found this two options:
Option 1:
http://www.banmanpro.com/support2/Requested_Content_Appears_to_be_Script.asp
This one says I should go to Integrated, instead of Classic App Pool. but it's like if I changed a problem for another because now it says:
HTTP Error 500.21 - Internal Server Error
Handler "WebServiceHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
When I go to the web config see what is this error talking about I see no handler tag!
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings />
<connectionStrings />
<system.web>
<compilation targetFramework="4.0" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
-->
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
</system.web>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
</configuration>
Should I add one? If so, how?
Option 2:
Script not served by static file handler on IIS7.5
Basically it says I shoud do a aspnet_regiis -i, but when I try
going to %windir%\Microsoft.NET\Framework\v4.0.30319
Even when the folder exists, There is no aspnet_regiis!!
I've only found the aspnet_regiis on the 2.0 Fwk =(
Is that normal?
The handler tag wasn't the answer, however, both options drove me to look for the missing aspnet_regiis of fwk 4.
There was no aspnet_regiis because the full fwk 4.0 wasn't actually installed on a first place.
I had installed on the server the Framework 4 Client Profile and the debugger, which isn't the full version. From now on, whenever I think I have fwk 4 installed, I'll check twice.
After installing it, on Framework 4.0 Classic Pipeline Mode (instead of Integrated) made it work just fine.
But Attention!
After installing the framework, IIS will change the default pipeline to 4.0, that means, if you had ongoing a web(site/service) on 2.0 it will automatically stop working. (It happened to me)

http-security-filter doesn't work in mule

I use Mule Server 3.3.0 CE, I generate this code:
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
xmlns:mule-ss="http://www.mulesoft.org/schema/mule/spring-security"
xmlns:ss="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.3/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.3/mule-http.xsd
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.3/mule-pattern.xsd
http://www.mulesoft.org/schema/mule/spring-security
http://www.mulesoft.org/schema/mule/spring-security/3.3/mule-spring-security.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<mule-ss:security-manager>
<mule-ss:delegate-security-provider
name="memory-dao" delegate-ref="authenticationManager" />
</mule-ss:security-manager>
<spring:beans>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider>
<ss:user-service id="userService">
<ss:user name="sepideh" password="16978413" authorities="ROLE_ADMIN" />
</ss:user-service>
</ss:authentication-provider>
</ss:authentication-manager>
</spring:beans>
<pattern:web-service-proxy name="myService"
wsdlLocation="http://ws.acme.com:6090/wsdl/weather-forecast">
<http:inbound-endpoint address="http://localhost:8090/service">
<mule-ss:http-security-filter realm="mule-realm" />
</http:inbound-endpoint>
<http:outbound-endpoint address="http://ws.acme.com:6090/weather-forecast" />
</pattern:web-service-proxy>
I run this project and I have below exception:
ERROR 2012-11-27 14:31:25,456 [[web_service].connector.http.mule.default.receiver.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint http://localhost:8090/service. Message payload is of type: String
Code : MULE_ERROR-54999
--------------------------------------------------------------------------------
Exception stack is:
1. Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint http://localhost:8090/service. Message payload is of type: String (org.mule.api.security.UnauthorisedException)
org.mule.transport.http.filters.HttpBasicAuthenticationFilter:160 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/security/UnauthorisedException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.security.UnauthorisedException: Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. Authentication denied on endpoint http://localhost:8090/sevice. Message payload is of type: String
at org.mule.transport.http.filters.HttpBasicAuthenticationFilter.authenticateInbound(HttpBasicAuthenticationFilter.java:160)
at org.mule.security.AbstractEndpointSecurityFilter.authenticate(AbstractEndpointSecurityFilter.java:58)
at org.mule.security.AbstractAuthenticationFilter.doFilter(AbstractAuthenticationFilter.java:56)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
New wsdl address show me but I can't use this address for create web service.
All of solution link to this page, but I don't know how to change SoapUI to true value.
What should I change in my configuration?
Posting this might helps some one. People who migrating the HTTP connectors from Mule lower version to 3.6+ or 3.7( Because, I faced this error when upgrading). Please follow the link https://docs.mulesoft.com/mule-user-guide/v/3.6/configuring-the-spring-security-manager( We cannt configure mule-realm inside HTTP listener as like in version 3.3). When you try to hit it from SOAP UI, you will find the above error Registered authentication is set to org.mule.module.spring.security.filters.http.HttpBasicAuthenticationFilter but there was no security context on the session. It is not the problem with Mule config file.Need to change SOAPUI settings
2 ways to resolve this error:
Go to SOAPUI->File->Preference->HTTP settings-> enable the option Authenticate Preemptively
or
When setting the basic Auth In SOAPUI
Authorization->Basic -> Pre-emptive auth -> enable Authenticate Pre-emptively.
By default it will be 'Use global preference' which needs to be changed to Authenticate Pre-emptively
Thanks.
Seems related and the error you are getting is a red herring. Are you getting back a success response even if this is being logged?
http://www.mulesoft.org/jira/browse/MULE-5607