I'm implementing asp.net core project. I published my project into a package and set it on a main server, but, the database was set on another server. To do that, in the part of connection string of appsetting file, I just changed the server name and database name and when running the project I confront with the following error:
An error occurred while processing your request.
Request ID: |6baffbe3-48f1cf1e3a28ac47.
Swapping to Development environment will display more detailed information about the error that occurred.
The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app
I appreciate if anyone can suggest me a solution for it.
You are assuming a database connection error, the production system has hit an error but will not tell you about it because of security concerns - it could be any error, not necessarily the DB connection. You need to get more information about the error either from the logs or turn on development mode.
Never underestimate the power of human stupidity -
I'm old. I know stuff - JSOP
Part of learning .Net Core requires you to take a deep dive into how to setup the environment using the Program.cs and Startup.cs, and how to use environment variables. For my database setup, I ran a database on my workstation to develop on, and one on the production server, and used the appSettings file to switch between production and development. If you can contact the database server from your workstation, then all is good.
So using the development mode to run off the production database server would be a good way to figure out what's happening. Then maybe take a step back and setup your environment.
I need to display one image that is made up of multiple images with each a transparency.
So image one has a bike on the left and the rest of the image is transparent and the second image has a car on the right (again the rest is transparent), then I would need to display one image with a bike on the left and a car on the right.
How can I accomplish this in MVC Core 3.1?
As the user can select the images that build the total image I cannot prebuild this image.
I'm implementing an asp.net core project and I'm trying to authenticate the user login via ldap to active directory. I'm using the below link https://www.brechtbaekelandt.net/blog/post/authenticating-against-active-directory-with-aspnet-core-2-and-managing-users in order to implement the authentication against active directory with asp.net core. What I've tried in appsettings is like below:
Now my problem is after running the project and entering the user: koli-h and pass: asdq/1998 the system shows me invalid username or password. My real username and password in the server are koli-h and asdq/1998. However, if I change my user in the code to for example koli-ha (adding a character in order to make the usernam incorrect) after running the project, the system shows me "Invalid Credentials" error. I appreciate if anyone could suggest me what is the problem that I can't logging in to the system.
But can say like the article said, .Net Core is designed to run in many environments including Linux, Mac OS, and has no idea or really doesn't care what the environment is. With that being said, I really think using Active Directory to store credentials is a bad idea in the first place. You can fix and figure it out now, but the problem will come up again when you deploy it in a production environment.
Issues like this, is really dependent upon you setting up your development environment exactly like your production environment, so when you write code, it works. I develop on a Win10 computer, but I run my program on a Linux server running in a Docker Container. I had to write code to detect a Linux environment and make adjustments to it such as file names. Plus had to write code to detect that I'm running in a Docker Container as well.
The AppSettings file is a place to store parameters. So your logging level is just a parameter. Then you have to write code to detect the error, pickup the logging parameters, and then write code to log the error in the Windows Server logging system. But for this to work, you have to be running in Windows Server. I suggest focusing on the authentication first, and find another way to capture the error so you can examine it.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
We are using a group of third party webservice dlls in our apps.
I have been trying to develop a .Net Core version of an app, but as soon as it hits the non-core dll, it throws an error loading one of it's dependencies.
System.BadImageFormatException: 'Could not load file or assembly 'System.Web.Services, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (0x80131058)'
I have no control of the webservice source, so I can't develop a core library.
With all the push for Core, I find it hard to believe nobody has found a fix for this. There are a ton of third party libraries out there.
System.Web.Services predate even WCF, and WCF is now being deprecated in favor of .NET Core, gRPC and ASP.NET Core. Microsoft is no longer interested in maintaining legacy technology like Web Services, Web Forms, Web Pages, etc.
If you use one of them, at least maintain an instance of legacy code as a bridge between .NET Core and other frameworks.
I had to dump all that stuff from System.Web.Services and rewrite new ones in the Core format. Frustrating at first but now easy to understand how Core works now. No regrets, my new stuff is better and faster.
But I've manage to find a qualified NuGet package to replace some items like System.Drawing.Common, just took time for research and testing to qualify them which was time consuming. And I found better solutions in other packages.
If it ain't broke don't fix it
Discover my world at jkirkerx.com
Hellow my dears.
i use asp.net core and identity authorization in this.
my side menu is static and I want to create menu and sub menu.my problem is when i hide sub menus of a menu,menu show to user but i want it Do not display.can i use jaquery function to this?
my code is here:
I have an ASP.Net application which is working working fine if I have set up the Project URL as: http://localhost:58799/, but I want the project URL to be http://localhost:58799/IMS, it started throwing me error as in the below, how can I fix it? Any help please.
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Handler Not yet determined
Error Code 0x800700b7
Config Error Cannot add duplicate collection entry of type 'add' with unique key attribute 'name'set to 'Windows Login Handler'
Config File \\?\C:\GitSrsCodes\IMS\IMS.Web\web.config
Requested URL http://localhost:58799/IMS/
Physical Path C:\GitSrsCodes\IMS\IMS.Web\
Logon Method Not yet determined
Logon User Not yet determined
Request Tracing Directory C:\Users\aaleem\Documents\IISExpress\TraceLogFiles\IMS.WEB
72: <!--register windows login managed handler.-->
73: <add name="Windows Login Handler" path="Login" verb="POST" type="IMS.Web.WindowsLoginHandler" preCondition="integratedMode" />
74: <!--these handlers resolve .woff not showing problem-->
This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
If you see the text "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined", this error is because you are running a .NET Framework 3.5-based application in .NET Framework 4. If you are running WebMatrix, to resolve this problem, go to the Settings node to set the .NET Framework version to ".NET 2". You can also remove the extra sections from the web.config file.
Thank you Richard, under which section of web config should I put it my friend?
Just a Note: And thanks a lot Richard, it is going to be very help since the URL of my local machine and URL on the Server aren't matching, as we are planning to go for the automatic deployments I need to set the URL so that it will not break things because of the URL issues - thanks a lot my friend.
Hi, I've been working on a web portal using ASP.NET Core 3.1 and I keep running into weird errors between Identity and EF Core. I've gone through several complete rebuilds and tons of errors and problems. when I build little web apps or separate Identity and EF Core then everything works just dandy. But when I try to bring them all together in a rather large production web app all of a sudden weird bugs crop up.
I've read that the Identity and EF Core teams work separately and sometimes there are problems between their releases...So I am wondering:
Is ASP.NET Core 3.1 not yet ready for prime time for building web apps?
Is there anyone here that is actually using it successfully in a production environment?
And if so, are there some tricks/suggestions for doing so?
Or should I use Core 2.2? Is that stable enough for production apps?
I know that this is a general question without going specifically into the bugs I've encountered. The bugs are many and variable and the code is too large to summarize here. If no one answers this then that will be my answer. If some people do answer but cannot confirm that they are using it in production then that will be my answer as well. And if some people tell me that I should not be using it right now that will be my answer as well.
In the other case, if people tell me that this is a known problem then perhaps they will be able to point out a workaround. Else I will have to abandon Identity and EF Core and build my own implementations directly. I've been thinking that I should have done this from the beginning, perhaps using Dapper instead of EF Core.
Last Visit: 31-Dec-99 19:00 Last Update: 1-Dec-22 9:21