私はカスタム設定セクションを持つWebアプリケーションを持っています。そのセクションには、私が暗号化するような情報が含まれています(自分ではなくASPNet_RegIISを使用したいと考えていました)。ASPNet_Regiisを使用してカスタム設定セクションを暗号化する - できますか?
のWeb.Config:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<section name="MyCustomSection"
type="MyNamespace.MyCustomSectionHandler, MyAssembly"/>
</configSections>
<configProtectedData>
<providers>
<clear />
<add name="DataProtectionConfigurationProvider"
type="System.Configuration.RsaProtectedConfigurationProvider, System.Configuration, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL"
keyContainerName="MyKeyContainer"
useMachineContainer="true" />
</providers>
</configProtectedData>
<MyCustomSection>
<blah name="blah1">
<blahChild name="blah1Child1" />
</blah>
</MyCustomSection>
設定ハンドラは、それを暗号化しようとする前に、素晴らしい作品。私はそれを暗号化しようとすると:
aspnet_regiis -pef "MyCustomSection" c:\inetpub\wwwroot\MyWebsite -prov DataProtectionConfigurationProvider
私はエラーを取得する:
Encrypting configuration section... An error occurred creating the configuration section handler for MyCustomSection: Could not load file or assembly 'MyAssembly' or one of its dependencies. The system cannot find the file specified. (c:\inetpub\wwwroot\MyWebsite\web.config line 5)
私が設定され、プロバイダなし/で試してみました。セクショングループあり/なし。手に入る前にウェブサイトを起動している/していない。私は一時的に私の議会をGACに登録して登録しようとしました。私はまた私のlog4netセクションだけで運がない私のものではなかったものを試してみました。私は管理者としてコマンドプロンプトを実行しました。何か案は?または、ASPNet_RegIISはカスタムセクションでは使用できませんか?
MSDNは、IConfigurationSectionHandlerを実装するのではなく、ConfigurationSectionから継承するようにハンドラーを変更していました。技術的には2.0で廃止されていました(aspnet_regiisバージョンに関する)。そこにも運はない。
私にはどんなアイデアも教えてください。ありがとう!
私は同じ問題を抱えています。私は、下の答えでgacやハックのアセンブリを入れないでこれを動作させる方法があるとは思わない? –
私はそれをしつこに疲れていたので、私はちょうどガックの中にアセンブリを一時的に入れて行った。 –