Comments (3)
Some APIs that may be related here:
HttpContext.GetSection
HttpContext.GetGlobalResourceObject
HttpContext.GetLocalResourceObject
from systemweb-adapters.
While thinking about this some more, I realized an additional challenge. Users will most likely be using System.Configuration.ConfigurationManager.AppSettings
to grab the values throughout the code. This makes anything to use Microsoft.Extensions.Configuration
more work in the migration process and potentially difficult to update all the code.
In order to help, we may want to initially ensure that the values from web.config show up in AppSettings - this moves the migration for configuration after they have successfully moved to core. I have a prototype of this in https://github.com/dotnet/systemweb-adapters/tree/tasou/web-config that adds some msbuild logic. This is needed because web.config
as-is from a framework application will have configuration sections that are unknown to .NET Core which will cause a runtime exception. To mitigate this, the prototype does the following:
- When adding
Microsoft.AspNetCore.SystemWebAdapters.CoreServices
, some msbuild targets will be injected into their project - These tasks search for any web.config entries
- An XSL transformation is performed on the supplied web.config that will keep just the AppSettings/ConnectionStrings
- The final web.config is placed next to the output with the name of
[ProjectName].dll.config
so that the configuration manager will pick it up.
Some open questions:
ConfigurationManager
only appears to read the settings automatically if the name is[ProjectName].[exe|dll|.config
. If that's the case, we may need to merge with any existing config- We'd probably want to help people move off of it - maybe adding an analyzer that flags usage of
ConfigruationManager.[AppSettings|ConnectionStrings]
and pushes people to the optinos pattern
from systemweb-adapters.
We talked about this one today to see if it should be considered. It is unclear if a) this problem is common enough were we want to provide a solution, and b) if this is the right approach to addressing this as opposed to having aspnetcore be able to understand web.config. @twsouthwick will follow up on this.
from systemweb-adapters.
Related Issues (20)
- Remote Authentication to ASP.NET running in Azure App Services Does Not Appear to Work - User return is always not logged in, IsAuthenticated flag is False HOT 1
- [Test Issue] This is a test issue to verify the GitHub automation marks the issue as needing triage HOT 1
- 1.2.0 => 1.3.X `ISessionStateFeature` is not available HOT 2
- Some methods don't resolve on .NET Framework
- Upgrade System.Runtime.Caching to v8.0.0
- Switch to 1ES pipelines HOT 1
- Authentication Redirect Failing HOT 1
- add RequiresUniqueFilePathSuffix in the HttpCapabilitiesBase
- Help Needed: Blank Screen Issue with Microsoft Reverse Proxy in .NET Core HOT 5
- Session Values are set to Null if you dont map them
- error 500 (Internal Server Error) when I try to access the session HOT 3
- Roles are not converted to Claims on Login
- Confused about how to use Microsoft.AspNetCore.SystemWebAdapters while trying to port from old ASP.NET website to new ASP.NET Core web app HOT 1
- Add more functions to `HttpCachePolicy` HOT 2
- Unable to disable buffering once enabled HOT 5
- PreSendRequestHeaders and PreSendRequestContent should be fired when content is being sent HOT 3
- Net Core 8 Unable to resolve service for type 'Microsoft.AspNetCore.SystemWebAdapters.Authentication.IRemoteAppAuthenticationService' while trying to set up remote auth HOT 3
- When not buffering, flushing should cause `Response.End()` to be called HOT 4
- Remote authentication always invoked with .NET 8, regardless of whether needed or not (as opposed to how it worked with .NET 6). HOT 1
- Forwarded Requests from ASP.NET Core to ASP.NET MVC are throwing an InvalidOperationException looking for IHttpResponseBufferingFeature HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systemweb-adapters.