I have custom sections in my project. The following line works for my Web API project from the web.config:
...
<sectionGroup name="Project.Models">
<section name="product" type="Project.Models.Configuration.ProductSettings" />
</sectionGroup>
</configSections>
<Project.Models>
<product id="1" />
</Project.Models>
When I run my unit tests, I get the following error:
System.Configuration.ConfigurationErrorsException : An error occurred creating the configuration section handler for Project.Models/product: Could not load type 'Project.Models.Configuration.ProductSettings' from assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not load type 'Project.Models.Configuration.ProductSettings' from assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Why do I have to specify the assembly name when referencing this from my unit tests app.config? This resolved the issue, but not sure why it's needed.
<section name="product" type="Project.Models.Configuration.ProductSettings, Project.Models" />