2012-04-08 7 views
0

MVC3 WebアプリケーションでのLightSpeedの使用に関する質問があります。私はLightSpeedを使用したいREST APIプロジェクトを作成していますが、official configuration guidelinesは非常に曖昧です。公式ドキュメントは、以下の行がファイルweb.configファイルに追加する必要があると述べている:MVC3 Webプロジェクトで使用するLightspeedの設定

<configSections> 
    <section name="lightSpeedContexts" 
       type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection, Mindscape.LightSpeed" /> 
</configSections> 

<lightSpeedContexts> 
    <add name="Test" /> 
</lightSpeedContexts> 

<lightSpeedContexts> 
    <add name="Test" dataProvider="SQLite3" /> 
</lightSpeedContexts> 

私はルートにあるweb.configファイルに次の行を追加してみました:

<configSections> 
    <section name="lightSpeedContexts" 
       type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection, Mindscape.LightSpeed" /> 
    </configSections> 

    <lightSpeedContexts> 
    <add name="Default" connectionStringName="Prod" dataProvider="MySQL5" /> 
    </lightSpeedContexts> 

    <connectionStrings> 
    <add name="Prod" connectionString="server=localhost;User Id=production;password=xxx;Persist Security Info=True;database=CBS"/> 
    </connectionStrings> 

これはスローWebアプリケーションを起動すると例外が発生します。これは、configSectionsがアプリケーションで複数回指定されない可能性があることを示しています。ルートweb.configファイルには、デフォルトでこれらのいずれも指定されていません。

この設定をどこに配置するかわかりません。

答えて

0

問題を解決する方法を見つけました。

2つのサブweb.configファイル(各Viewsフォルダ内)にあったconfigSectionsを移動し、メインのweb.configファイルに内容を入れてから、web.configのlightSpeedContextsとconnectionStringsを追加しましたファイル。

関連する問題