web-config

Having classic ASP read in a key from appsettings in a web.config file

拜拜、爱过 提交于 2021-02-07 08:42:06
问题 OK so here's the situation. I've got a classic ASP website running inside an MVC 4 application. I need the classic ASP website to be able to get a key from the appsettings section of the web.config file. Here is the function I've got: ' Imports a site string from an xml file (usually web.config) Function ImportMySite(webConfig, attrName, reformatMSN) Dim oXML, oNode, oChild, oAttr, dsn Set oXML=Server.CreateObject("Microsoft.XMLDOM") oXML.Async = "false" oXML.Load(Server.MapPath(webConfig))

Securing Connection String In Asp.net MVC

不羁的心 提交于 2021-02-07 04:32:25
问题 I have An Asp.net MVC Application With VS.Net2013 in my webconfige file i have connection string Section like this: <connectionStrings> <add name="ConnectStrNL" connectionString="server=192.168.0.71\ins1;database=FNHProvider;MultipleActiveResultSets=true;persist security info=True;User ID=general;Password=123;" /> <add name="connectionStringGeneral" connectionString="server=192.168.0.254;database=NFS;MultipleActiveResultSets=true;persist security info=True;User ID=General;Password=*******;" /

Am confused about web.config in .NET Core

时光总嘲笑我的痴心妄想 提交于 2021-02-06 15:12:08
问题 There are a bunch of contradictory statements about web.config and .NET Core. Places saying it's gone. https://dotnetcore.show/episode-10-configuration-in-net-core/ Places saying it was gone but now it's back. https://stackoverflow.com/a/46771737/1662268 Places saying that it's no longer necessary, but you can create one manually: https://stackoverflow.com/a/43890405/1662268 https://stackoverflow.com/a/53731666/1662268 Additionally, I've just deployed a mostly-fresh-out-of-the-box .NET Core

web.config and app.config machine-specific settings in git

女生的网名这么多〃 提交于 2021-02-05 12:55:30
问题 We have multiple teams of developers in different offices, and they need different values for a number of configuration setting in our projects' web.config and app.config files. We like to keep these configuration files checked in with a sensible set of default values, so that by checking out the trunk/master branch you have something working without needing to dig around for configuration files. Historically we've used Subversion, and specifically TortoiseSVN, and this provided an easy way

web.config and quotes in connectionStrings

瘦欲@ 提交于 2021-02-05 05:00:45
问题 I have the following connection string, and you will notice "Provider's.Tests", notice the single quote, how do I enter this in to the web.config to make it valid? <connectionStrings> <clear/> <add name="Provider" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Projects\Provider's.Tests\app_data\db.mdf";Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings> 回答1: I don't think its the Provider's that is the problem, It is the

IIS web.config redirect rule for specific URL but not others

懵懂的女人 提交于 2021-01-29 03:01:01
问题 I want to add a redirect rule to the web.config file http://myurl.com/path/to/old to http://myurl.com/path/to/new but http://myurl.com/fr/path/to/old http://myurl.com/cn/path/to/old should stay the same. how can i achieve that with match/rule? 回答1: Add this to your web.config: <rewrite> <rules> <rule name="Redirect old to new" stopProcessing="true"> <match url="^path/to/old" ignoreCase="false" /> <conditions> <add input="{URL}" pattern="^fr/.*" ignoreCase="false" negate="true" /> <add input="

aspnet_regiis web.config encryption [Error message from the provider: Bad Data.]

ぐ巨炮叔叔 提交于 2021-01-29 02:00:08
问题 I'm trying to encrypt a web app's web.config, but this application exists on 2 different environments (stage, production), each of which should use a different key container. So I'm using this encryption header on my stage config: <configProtectedData defaultProvider="ApplicationProvider"> <providers> <add name="ApplicationProvider" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,

aspnet_regiis web.config encryption [Error message from the provider: Bad Data.]

前提是你 提交于 2021-01-29 01:57:57
问题 I'm trying to encrypt a web app's web.config, but this application exists on 2 different environments (stage, production), each of which should use a different key container. So I'm using this encryption header on my stage config: <configProtectedData defaultProvider="ApplicationProvider"> <providers> <add name="ApplicationProvider" type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,

Put Assembly Version from AssemblyInfo.cs in Web.config

孤街浪徒 提交于 2021-01-27 14:41:22
问题 I have this scenario, where I have the project's Assembly Version from AssemblyInfo.cs, for example 2.0.0 as below: [assembly: AssemblyVersion("2.0.0")] In addition, I would like to retrieve this AssemblyVersion and set it as part of the parameters in my web.config dynamically, such as below, for example: <my.config.group> <version versionNumber="2.0.0" /> </my.config.group> I need to set the version number above, as the version number of my Assembly dynamically, to avoid having to modify it

How to use environment variables set in Azure Pipeline in the web.config file of ASP.NET server?

故事扮演 提交于 2021-01-27 12:40:24
问题 I intend to use the following env variables from Azure Pipeline in ASP.NET's web.config file: <connectionStrings> <add name="ApplicationDbContext" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=tcp:app-$(DeploymentEnvironment).database.windows.net,1433;Initial Catalog=app-db;Persist Security Info=False;User ID=$(DeploymentDBUserName);Password=$(DeploymentDBPassword);Encrypt=True