This project has moved. For the latest updates, please go here.

Cannot load the type

Aug 28, 2012 at 7:07 AM
Edited Aug 28, 2012 at 7:15 AM

Hi,

I got all the files generated, and inserted the what I thought was the correct contents into app.config. But then when I run the project, I get this error:

Could not load type 'AppInstanceConfig.AppInstances' from assembly 'MultipleAppInstances'.

My app.config looks like this:

<configuration>
    <configSections>
    ...
        <section name="appInstances" type="AppInstanceConfig.AppInstances, MultipleAppInstances"/>
    </configSections>
    ...

    <appInstances xmlns="appInstanceConfig">
        <config>
            <appInstanceConfiguration id="1" left="20"/>
        </config>
    </appInstances>
</configuration>

And the code, which fails, is: 

Imports ConfigProject.AppInstanceConfig
Public Sub New()
    InitializeComponent()

    ' THIS LINE RAISES THE ERROR
    Dim section = CType(ConfigurationManager.GetSection("appInstances"), AppInstances)

    Dim config = (From el In section.Config.OfType(Of AppInstanceConfiguration)() Where el.Id = AppId).FirstOrDefault()

 

The configuration project "ConfigProject" is a part of a solution "MultipleAppInstances" with yet another project "MultipleAppInstances".

What is wrong?