从配置文件

时间:2015-06-22 20:42:48

标签: c# xml wpf caching oracle-coherence

我正在使用Coherence API for .NET。我有API运行所需的标准配置:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <configSections>
       <section name="coherence" type="Tangosol.Config.CoherenceConfigHandler,     Coherence"/>
   </configSections>
 <coherence>
    <cache-factory-config>coherence.xml</cache-factory-config>
    <cache-config>cache-config-client-dev1.xml</cache-config>
    <pof-config>pof-config.xml</pof-config>
  </coherence>
</configuration>

我的WPF有这个主要方法:

[STAThread]
    public static void Main()
    {

        INamedCache cache = null;
        try
        {
            cache = CacheFactory.GetCache("reference-data|corp-id-to-employee");
        }
        catch(Exception e)
        {
            e.ToString(); 
        }


        CacheBrowser1.App app = new CacheBrowser1.App();
        app.InitializeComponent();
        app.Run();

    }

然而,每次启动程序时,我都会遇到以下异常:

A first chance exception of type 'System.Xml.XmlException' occurred in Coherence.dll
A first chance exception of type 'System.Exception' occurred in Coherence.dll

我几乎可以肯定它与我在配置文件中为XML文件指定的路径有关。我一般不熟悉.NET配置文件。我的问题在这里是什么?如果它是一个路径问题,路径如何在配置文件中工作。我的XML文件位于

C:\LAS\CacheBrowserS\CacheBrowser1\CacheBrowser1\bin

1 个答案:

答案 0 :(得分:0)

请尝试删除属性名称中的短划线或使用引号和括号,例如[&#34;属性名称&#34;]

相关问题