web-config

MSDeploy automatic encryption of connection strings, key not found in dictionary

杀马特。学长 韩版系。学妹 提交于 2019-12-23 07:33:15
问题 Since Web Deploy 3.5 automatic encryption of connection strings is supported using the flag: –EnableRule:EncryptWebConfig . However, upon running it with: "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='C:\[...]\MyApp.WebDeployPackage.zip' -dest:auto,includeAcls="False" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\[...]\MyApp.SetParameters.xml" -EnableRule:EncryptWebConfig -verbose I get

xdt:Transform=“Insert” not working for <rewrite> in <system.webServer>

走远了吗. 提交于 2019-12-23 07:05:03
问题 I have the following transform written in the live config of my web.config. <system.webServer> <rewrite xdt:Transform="Insert"> <rules> <rule name="httpsrewrite"> <match url=".*" /> <serverVariables> <set name="SERVER_PORT" value="443" /> <set name="HTTPS" value="on" /> </serverVariables> <action type="None" /> </rule> </rules> </rewrite> </system.webServer> There is no element in my web.config. The transform just does not work. All my other transform (replace for elmah and connection string)

Assemblies in Web.config

不羁的心 提交于 2019-12-23 06:48:28
问题 I've been doing .NET development for about a year, but I still don't know what the purpose of the <assemblies> section is. What is the section's purpose? Can I delete the assemblies specified in there? I asked some senior developers in my team but they just told me to ignore it. Can someone give me a good explanation on it? 回答1: What is the purpose of the assemblies section? The <assemblies> element in an ASP.NET application defines the assemblies that are used during compilation of an

ESB Toolkit and Enterprise Library collision

蹲街弑〆低调 提交于 2019-12-23 05:50:53
问题 Hi i need to use enterprise library 5 to maintain consistency across the board in the enterprise environment. Unfortunately we have got biz talk installed in our machines. It seems that enterprise library collides with ESB Toolkit. ESB Toolkit creates a section in machine.config for enterprise library which is version 4.1. Every time i run my application it reads the config from machine.config and the application catches the exception. To solve this i included <section name="enterpriseLibrary

Store Paypal Payments Pro account information outside of Web.config

纵然是瞬间 提交于 2019-12-23 04:54:21
问题 I am using the .NET SDK for Paypal Payments Pro. The sample application stores the API account credentials in the website's Web.config file. I'd like to be able to pull these credentials from the database, instead. Some searching turned up this entry, which asks the same question: Edit Settings in web.config. Unfortunately, the accepted answer didn't address how to store the credentials elsewhere; instead, it showed how to programmatically modify the Web.config file. Is there any way to

Yandex smtp settings with ssl

…衆ロ難τιáo~ 提交于 2019-12-23 03:57:13
问题 I can send emails via enableSsl="false" and 25 port. But it is not enought in case with own domain. What is wrong or missing in this settings? <system.net> <mailSettings> <smtp deliveryMethod="Network" from="Name"> <network host="smtp.yandex.ru" port= "465 " enableSsl="true" userName="noreply@domain.com" password="***" /> </smtp> </mailSettings> </system.net> 回答1: using (MailMessage mm = new MailMessage("Name <from@yandex.ru>", "to@site.com")){ mm.Subject = "Mail Subject"; mm.Body = "Mail

How to encrypt Connectionstring written in web.config from codebehind?

筅森魡賤 提交于 2019-12-23 02:01:37
问题 I need to encrypt connectionstring and some appsettings keys value in web.config from code behind. Please help. 回答1: Check these url - use aspnet_regiis.exe http://msdn.microsoft.com/en-us/library/zhhddkxy.aspx http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.protectsection.aspx 回答2: try this private void ProtectSection(string sectionName, string provider) { Configuration config = WebConfigurationManager. OpenWebConfiguration(Request.ApplicationPath);

How to encrypt Connectionstring written in web.config from codebehind?

南楼画角 提交于 2019-12-23 02:01:10
问题 I need to encrypt connectionstring and some appsettings keys value in web.config from code behind. Please help. 回答1: Check these url - use aspnet_regiis.exe http://msdn.microsoft.com/en-us/library/zhhddkxy.aspx http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.protectsection.aspx 回答2: try this private void ProtectSection(string sectionName, string provider) { Configuration config = WebConfigurationManager. OpenWebConfiguration(Request.ApplicationPath);

Access section 'applicationSettings' (not 'appSettings') in config file from setup

徘徊边缘 提交于 2019-12-22 18:44:09
问题 I am in the process of creating a setup for a web application we build. No I have a configuration file, which looks something like like this, which contains a section 'appSettings', and a section 'applicationSettings': <configuration> <appSettings> <add key="Password" value="dummy"/> <add key="Username" value="dummy"/> <add key="DB" value="dummy"/> <add key="DBServer" value="dummy"/> <add key="LogStoredProcedure" value="dummy"/> <add key="ErrorStoredProcedure" value="dummy"/> <add key=

Login Membership .NET

£可爱£侵袭症+ 提交于 2019-12-22 16:40:12
问题 Hi I was wondering what is the best way to force the user to login when arriving at a website, in .net. I have set up the Membership features and I was wondering what is the best way to ensure that no matter what address the user arrives at, they must first get authenticated before proceding to the page they requested. Any resources will be great, thanks. 回答1: Alter Web.config in application root to read: <authentication mode="forms"> <forms loginUrl="Login.aspx" defaultUrl="/" /> <