I'm trying to divide up my web.config into multiple config files so that when I import the DLL to other projects, the .config files will also be imported.
Issue is with SubSonicService:
I've defined:
configSections
*section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/*
/**configsections**
But this doesn't allow me to use the configFile attribute later on in my web.config.
The error I get in the web.config is:
The element 'SubSonicService' has incomplete content. List of possible elements expected: 'providers'.
Any tips?
Thanks.
I have this and it works.
web.config
<configuration>
<configSections>
<section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/>
<!--Other Sections-->
</configSections>
<SubSonicService configSource="SubSonic.config"/>
<!--Other Stuff-->
</configuration>
SubSonic.config
<SubSonicService defaultProvider="yadayada">
<providers>
<!--List Providers Hers-->
</providers>
</SubSonicService>
I remember reading something about making sure SubSonicService was the first section in the configSections.
Related
I'm trying to use the Certify SSL Manager to configure SSL certificates from Let's Encrypt on my IIS server, but it fails during the check.
https://dev.mywebsite.com/.well-known/acme-challenge/configcheck/
This works:
https://dev.mywebsite.com/well-known/acme-challenge/configcheck
https://dev.mywebsite.com/.well-known/acme-challenge/test.txt
So I assumed it's the . before well-known. But the fact that test.txt works confuses me.
I've already configured the directory according to this discussion:
https://github.com/ebekker/ACMESharp/issues/15
I have a bunch of rewrite stuff in my web.config, but even if I remove that section completely, it still fails.
Perhaps check if the acme-challenge web.config contains a conflict within the handler section. Do so by opening IIS manager, find the acme-challenge folder en double click the handler mapping icon. In my case, this resulted in an error.
The problem I ran into with the default web.config in the acme-challenge folder was that the applicationhost.config contained:
<section name="handlers" overrideModeDefault="Deny" />
The handlers section in the acme-challenge web.config therefore was not allowed with the result that the challenge failed. In this case the solutions were:
Change applicationhost.config line to:
<section name="handlers" overrideModeDefault="Allow" />
Or ...
Remove the handlers setting from the web.config in acme-challenge folder.
The applicationhost.config can be found here: c:\windows\system32\inetsrv\config
The configcheck url is a file, not a directory. Make sure that file exists on disk (i.e. C:\inetpub\wwwroot\.well-known\acme-challenge\configcheck) in your webroot. Then try to load your links with this barebones web.config in your website root directory (if using ASP.NET):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="." mimeType="application/unknown" />
</staticContent>
</system.webServer>
</configuration>
If that works, try slowly adding back in your web.config sections including routes/rewrite until you figure out what's causing the problem.
If using ASP.NET Core with a wwwroot folder hosting your static files, you'll have to modify your config in Startup.cs instead:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
string filepath = Path.Combine(Directory.GetCurrentDirectory(), #"wwwroot/.well-known");
app.UseStaticFiles(new StaticFileOptions()
{
FileProvider = new PhysicalFileProvider(filepath),
RequestPath = new PathString("/.well-known"),
ServeUnknownFileTypes = true
});
// ... your other startup code here
}
I had to modify the web.config as follow to fix the error:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="*" mimeType="text/plain" />
</staticContent>
<handlers>
<clear />
<add name="StaticFile" path="*" verb="*" type=""
modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule"
scriptProcessor="" resourceType="Either" requireAccess="Read"
allowPathInfo="true" preCondition="" responseBufferLimit="4194304" />
</handlers>
</system.webServer>
</configuration>
I am trying to migrate an ASP.NET application to MVC 5. The final piece to migrate is the membership provider. I am unable to configure the application to access the existing membership provider.
I started by looking at the documentation at MSDN's Sample Membership Provider Implementation. This leads me to enter the following in my Web.config:
<membership defaultProvider="MyMembershipProvider">
<providers>
<clear />
<add
name="MyMembershipProvider"
type="my.namespace.MyMembershipProvider, my.package.name"
connectionStringName="MyServiceContext"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
writeExceptionsToEventLog="true"
/>
</providers>
</membership>
<roleManager defaultProvider="MyRoleProvider">
<providers>
<clear />
<add
name="MyRoleProvider"
type="my.namespace.MyRoleProvider, my.package.name"
/>
</providers>
</roleManager>
When I try to run the application, I get the following error:
The configuration section 'membership' cannot be read because it is missing a section declaration
What might I be doing wrong?
D'oh!
Turns out I had put the <membership> tag inside the top-level <configuration> section, but it belongs inside <system.web>:
<configuration>
... stuff ...
<system.web>
<membership ...>
... stuff from question description ...
</membership>
<roleManager ...>
... stuff from question description ...
</roleManager>
</system.web>
</configuration>
Changing the location in the file fixed the error.
Stuck on this for a long now :( I am trying to override a core template file
app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml
using custom module which I have successfully activated and the config file for my new module is located at
app/code/local/CustomCheckout/Checkout/etc/config.xml.
Below are the content
<config>
<modules>
<CustomCheckout_Checkout>
<version>1.0.0</version>
</CustomCheckout_Checkout>
</modules>
<frontend>
<routers>
<checkout>
<args>
<modules>
<CustomCheckout_Checkout before="Mage_Checkout">CustomCheckout_Checkout</CustomCheckout_Checkout>
</modules>
</args>
</checkout>
</routers>
<layout>
<updates>
<checkout>
<file>persistent.xml</file>
</checkout>
</updates>
</layout>
</frontend>
</config>
I am trying to override the persistent.xml layout which in turn calls the said billing.phtml file. I placed the new layout file at following location
app/design/frontend/default/CustomCheckout/layout/persistent.xml.
Below are the content
<layout version="0.1.0">
<checkout_onepage_index>
<reference name="checkout.onepage.billing">
<action method="setTemplate">
<template>checkout/onepage/billing.phtml</template>
</action>
</reference>
</checkout_onepage_index>
</layout>
I have placed my modified billing.phtml file under
app/design/frontend/default/CustomCheckout/template/checkout/onepage/billing.phtml
but it is not being picked up. I am scratching my head...any help is appreciated.
Hopefully you've found an answer by now, but for posterity...
The issue here is that the "Persistent" module is already overriding that template. If you look in the persistent.xml layout file you see the following:
<reference name="checkout.onepage.billing">
<action method="setTemplate"><template>persistent/checkout/onepage/billing.phtml</template></action>
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
<block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
</reference>
Magento's default loading order is alphabetical. So, since the Persistent module is "Mage_Persistent" and your module is "CustomCheckout_Checkout", the Persistent module is loaded last, and it's override is the one that sticks.
There are several solutions. One is to rename your module so that it's after Mage_Persistent in the alphabet.
A better solution is to use Magento's dependency functionality. In your module declaration file (app/etc/modules/CustomCheckout_Checkout.xml), you probably have something like this:
<?xml version="1.0"?>
<config>
<modules>
<CustomCheckout_Checkout>
<active>true</active>
<codePool>local</codePool>
</CustomCheckout_Checkout>
</modules>
</config>
Modify this as shown here:
<?xml version="1.0"?>
<config>
<modules>
<CustomCheckout_Checkout>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Persistent />
</depends>
</CustomCheckout_Checkout>
</modules>
</config>
This indicates to Magento that your module "depends" on Mage_Persistent and should therefore be loaded after it.
If that does not work for you, another technique would be to use a "remove" node in your layout xml to get rid of the original billing block:
<remove name="checkout.onepage.billing" />
Then re-add it with a different name, as it is in checkout.xml. Make sure to add all necessary blocks and actions underneath it from various layout files and use the same alias (as="billing").
Finally, if this module is not intended for re-use (the change is just for your current install) you could simply copy the phtml file into the same path in your custom package/theme folder.
I am magento developer. I did implement your problem at localhost & find solution. I just create kinex/links (namespace/module). In this module layout file contain the following code:
<checkout_onepage_index>
<reference name="checkout.onepage.billing">
<action method="setTemplate">
<template>kinex/links/billing.phtml</template>
</action>
</reference>
</checkout_onepage_index>
This is very Simple, You can simply write the xml as:
<checkout_onepage_index>
<reference name="checkout.onepage.billing">
<action method="setTemplate">
<template>your-module/checkout/onepage/billing.phtml</template>
</action>
<block type="persistent/form_remember" name="persistent.remember.me" template="persistent/remember_me.phtml" />
<block type="core/template" name="persistent.remember.me.tooltip" template="persistent/remember_me_tooltip.phtml" />
</reference>
</checkout_onepage_index>
If there is some error in checkout page, then it means billing or shipping.phtml file is missing.
Following the steps in this tutorial, the first item of "Setting up with IIS 7.5" after clicking on "Modules" in inetmgr, the following error occurs:
Full image: http://i.stack.imgur.com/QCM4s.png
Web.config in RavenDB
<configuration>
<appSettings>
<add key="Raven/DataDir" value="~\Data"/>
<add key="Raven/AnonymousAccess" value="Get"/>
</appSettings>
<system.webServer>
<handlers>
<add name="All" path="*" verb="*" type="Raven.Web.ForwardToRavenRespondersFactory, Raven.Web"/>
</handlers>
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
</system.webServer>
<runtime>
<loadFromRemoteSources enabled="true"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Analyzers"/>
</assemblyBinding>
</runtime>
</configuration>
applicationHost.config
http://pastebin.com/UJTJfB9f
Try
For a few attempts, I tried to change
this..
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny" />
to this..
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
Results
When trying to access "in inetmgr Modules worked!"
However RavenDB Studio does not work.
The following image:
Config Error
This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
Config File
\\?\C:\Users\Riderman\RavenDB-Build-960\Web\web.config
Check your server web.config and change overrideModeDefault from Deny to Allow.
<configSections>
<sectionGroup name="system.webServer">
<section name="handlers" overrideModeDefault="Deny" />
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny" />
You can also manage sections on web server level (just select the Server in the left pane) in your IIS management console and then select "Feature Delegation":
As you see in the picture above all the features are Read/Write. Currently on my machine the Modules feature is Read Only, so I'd need to change it to Read/Write - in the right hand pane in Set Feature Delegation just click on Read/Write...
I'm trying to setup configSection for a .net 4.0 project.
<configuration>
<configSections>
<section name="MonitorFldrSection"
type="System.Configuration.NameValueFileSectionHandler, System, Version=4.0.0.0"
allowLocation="true"
allowDefinition="Everywhere"/>
</configSections>
<MonitorFldrSection>
<add name="fldr1" value="C:\Temp" />
<add name="fldr2" value="C:\Projects" />
</MonitorFldrSection>
<connectionStrings>
</connectionStrings>
<appSettings>
</appSettings>
</configuration>
However, when I try to add a key, all I get for prompts are
comment or CDATA prompts
When I try to access in code
object obj = ConfigurationManager.GetSection("MonitorFldrSection");
I get this error: {"An error occurred creating the configuration section handler for MonitorFldrSection: Could not load file or assembly 'System, Version=4.0.0.0' or one of its dependencies. The system cannot find the file specified. (C:\Projects_4.0\NasImageIndexer\TestForm\bin\Debug\TestForm.exe.Config line 5)"}
Along with NameValueFileSectionHandler, I've also tried AppSettingsSection and DictionarySectionHandler.
What am I doing wrong?
Can you find this file in the location C:\Projects_4.0\NasImageIndexer\TestForm\bin\Debug\TestForm.exe.Config?
If not change the property for the config file
Build Action - Content
Copy to Output Directory - Copy Always
Edited:
This worked for me after adding public key token and change the name to key instead
<configuration>
<configSections>
<section name="MonitorFldrSection"
type="System.Configuration.NameValueFileSectionHandler, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowLocation="true"
allowDefinition="Everywhere"/>
</configSections>
<MonitorFldrSection>
<add key="fldr1" value="C:\Temp" />
<add key="fldr2" value="C:\Projects" />
</MonitorFldrSection>
<connectionStrings>
</connectionStrings>
<appSettings>
</appSettings>
</configuration>