I have a large solution of ~90 projects. NodaTime is used in many of the projects and each project that uses it uses version 2.2.0.
Project A uses NodaTime 2.2.0 and references a new project I added (project B) which uses NodaTime 2.2.3. If this reference is added and project A calls code in project B in any way, I get the page "The application is in break mode" when debugging. I get this even if I start the application with F11, prior to entering Main. Removing the usage of project B from project A (even keeping the reference) and running using F11 leaves me at the first brace in Main.
The call stack is empty and the Event window in the debug panel shows an exception, but no further info.
Using FUSLOGVW.exe I get the following output:
*** Assembly Binder Log Entry (19/12/2017 @ 13:59:44) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
...
LOG: DisplayName = NodaTime, Version=2.2.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1
...
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: NodaTime, Version=2.2.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/home/*****/Serialisation/Serialisation/BootstrapperStartupSerialisation/bin/Debug/NodaTime.DLL.
LOG: Attempting download of new URL file:///C:/home/*****/Serialisation/Serialisation/BootstrapperStartupSerialisation/bin/Debug/NodaTime/NodaTime.DLL.
LOG: Attempting download of new URL file:///C:/home/*****/Serialisation/Serialisation/BootstrapperStartupSerialisation/bin/Debug/NodaTime.EXE.
LOG: Attempting download of new URL file:///C:/home/*****/Serialisation/Serialisation/BootstrapperStartupSerialisation/bin/Debug/NodaTime/NodaTime.EXE.
LOG: All probing URLs attempted and failed.
Now I attempted to recreate the issue with a test application but I don't get the same result. Instead I get a System.IO.FileLoadException
runtime error like this:
Minimal example is a console App with Noda Time 2.2.0 with this code:
namespace OlderRef
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(SystemClock.Instance.GetCurrentInstant());
Console.WriteLine(Class1.GetTime());
Console.ReadLine();
}
}
}
Referencing a class library that uses Noda Time 2.2.3 with this code:
namespace NewerRef
{
public class Class1
{
public static string GetTime()
{
return SystemClock.Instance.GetCurrentInstant().ToString();
}
}
}
Why does my production application enter break mode prior to main where as the test app throws an exception at the point the assembly is used?
Additional information:
Binding redirect done like this did not work:
<assemblyIdentity name="NodaTime" publicKeyToken="4226afe0d9b296d1" culture="neutral" />
<bindingRedirect oldVersion="2.2.0" newVersion="2.2.3"/>
Application is a WPF app in .NET framework 4.7
User contributions licensed under CC BY-SA 3.0