Turning off custom errors in Windows Service - app-config

I have a Windows Service that uses .NET Remoting (yes I know remoting has been replaced by WCF but this is a legacy application).
When I run the service I get this:
Exception Type: System.Runtime.Remoting.RemotingException Message:
Server encountered an internal error. For more information, turn off
customErrors in the server's .config file.
I have this in my application's config file:
<configuration>
<system.runtime.remoting>
<!-- other settings go here -->
<customErrors mode="Off" />
</system.runtime.remoting>
</configuration>
Oddly, I still get this exception. What am I doing wrong?

Related

DevExpress DLL's License Exception in visual studio windows application due to CAS Policy

Exception occurred creating type 'DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v8.2, Version=8.2.8.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1' System.TypeInitializationException: The type initializer for 'DevExpress.Utils.AppearanceObject' threw an exception. ---> System.NotSupportedException: This method explicitly uses CAS policy, which has been obsoleted by the .NET Framework. In order to enable CAS policy for compatibility reasons, please use the NetFx40_LegacySecurityPolicy configuration switch. Please see http://go.microsoft.com/fwlink/?LinkID=155570 for more information. ..\Properties\licenses.licx
Tried below configuration in app.config to resolve the issue but did not work:
`
<configuration>
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>
<startup>
<supportedRuntime version="v3.5.0000"/>
<!--<supportedRuntime version="v1.0.3705"/>-->
</startup>
`
Is there any extra configuration or setup required to resolve this issue?
Tried the steps given in the link below to resolve the issue:
https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/dd409253(v=vs.100)
https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/w4atty68(v=vs.100)

Error when running a .net core web app with React.js on IIS 10

I have a web app based on .net core v2.1 with a React.js front-end, which I'm trying to host on IIS 10. The app runs fine via Visual Studio (2017), however when I publish the app and host via IIS, I get the following error:
Error image
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Error Code 0x8007000d
The web.config file was generated during the publish; I have not modified it:
<?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="dotnet" arguments=".\SkillsMatrix.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: ea8a300c-5bb6-4a29-a8d2-d13dddbbac1d-->
This same error happens if I start a brand new project via VS, do not add any code, and publish it to IIS...
I have tried:
Giving access to the folder/file to the IIS_IUSRS user group
Removing app.UseHttpsRedirection(); in StartUp.cs
Does anyone have any suggestions for how I can clear this error and host my app?
You could try the below steps to resolve the issue:
1)Make sure you download and install the .net core hosting bundle and runtime.
https://dotnet.microsoft.com/download/dotnet-core/3.1
2)Make sure that the Application Pool > Process Model > Identity is set to ApplicationPoolIdentity or your custom identity has the correct permissions to access the application's deployment folder.
3)Set the application pool set the .NET CLR version to No Managed Code:
4)Confirm that you have enabled the proper server role. See IIS Configuration.
you could the below link for more detail:
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1

To share a local host for go gae?

we are two people and i want my friend can use my local host but it is giving error
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
needless to say
we are using python 2.7 and appcfg.py cmd to run app
In order to access your sites using local address, either use RemoteDeskTop, or remotedesktop shaing by chrome .
if your friend is in same network then he can browse your application using your LocalIp address.
http://192.168.10.20/YourApplication.aspx
If your Local Ip is not accessible in other computers of same network, then change your network to Home Network, and Add allow your IIS in Firewall.

Why does my app require the full .NET 4 Framework?

I have a WinForms app targeting the .NET 4 Client Profile. However, when I try to run it on a machine that has only the Client Profile (and not the full/extended profile), I get ".NET Framework Initialization Error" saying I need to install ".NETFramework,Version=v4.0":
I've double-checked the project file to make sure that it is indeed targeting the client profile, and it is:
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
As are all of the projects it references. I'm not even sure where else to look - what is going on here?
Check your app.configs and verify the supported runtime specified in the startup:
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
should be replaced with
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
</startup>

Calling WCF service with forms authentication

I have wpf application that calls wcf service with forms authentication.
I added Service Reference to my solution, and in service configuration checked Generate asynchronous operations.
In code behind I created client to that reference,
than I attached event to fire after async method is completed,
then username and pass is setted:
client.ClientCredentials.UserName.UserName = txtUser.Text;
client.ClientCredentials.UserName.Password = passbox.Password;
client.IsAuthenticatedAsync(txtUser.Text, passbox.Password);
client.Close();
in IsAuthenticatedCompletedEventArgs I get error:
"The communication object, System.ServiceModel.Channels.HttpsChannelFactory+HttpsRequestChannel, cannot be used for communication because it has been Aborted."
Does anyone knows why this happens?
Thanks in advance!
To be honest, I haven't had a chance to test your scenario, but that error is a general error stating something went wrong while communicating with the service (this answer is more of a comment, but it's extensive and can't fit). You could get more info by putting the following lines at the end of the <configuration> section in your web.config and app.config:
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="sdt"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData= "ServiceTestWCFTrace.svclog" />
</listeners>
</source>
</sources>
After you get the error use svc log viewer to view the log: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\SvcTraceViewer.exe
There you'll probably find the exact error that caused the Abort on the channel. Hope it helps.

Resources