I’m relatively new to C# and Visual Studio, so I appreciate any guidance.
I have a solution with multiple projects, including:
A WPF project
An ASP.NET project
Several Class Library projects
Several WPF Class Library projects
Additionally, I have a JSON file in the solution that stores settings used across the projects.
The Problem
I updated the value of a setting in the JSON file, specifically the “server” setting from “localhost” to a new value. However, when I run the application, even in debug mode, it continues to read the old value “localhost”.
I’ve also encountered a similar issue with one of the Class Library projects that defines and implements an interface. I made changes to the interface and its implementation, but when the application loads, it seems to use an outdated version of the Class Library. This causes the application to crash, stating that the implementation no longer supports the interface correctly.
What I’ve Tried
Performed “Clean Solution” followed by “Rebuild Solution”.
Deleted all files in:
C:\Users\toto_\AppData\Local\Microsoft\VisualStudio\17.0_ae12b280\Designer\Cache
Verified there are no old versions of the JSON file or the Class Library in the solution directory.
Code Example
For context, here’s the code I use to validate and load the Class Library that implements the interface:
var assembly = Assembly.LoadFrom(pluginsPath + plugin_.Filename);
var types = assembly.GetTypes()
.Where(t => typeof(IPlugin).IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract);
foreach (var type in types)
{
// The application does not enter this loop
}
Question:
What steps can I take to ensure that the application reads the updated JSON file and uses the correct version of the Class Library? Could this be a caching issue, or is there something I’m missing in my build process?
Thank you in advance for your help!