i have 2 projects in my solution (main is A.WPF and secondary is B.WPF)
when i’m trying to access variables inside my App.xaml.cs in B.WPF:
filename = ((App)Application.Current).ErrorLogFileName;
i get the following error:
Unable to cast object of type 'A.App' to type 'B.App'.
i also tried the following:
filename = ((B.App)Application.Current).ErrorLogFileName;
but still the same error…
the definition in B.App is:
private string _errorLogFileName = "error log.xml";
public string ErrorLogFileName
{
get { return _errorLogFileName; }
}
please assist…
Looks like you need to do:
The error is saying the type is
A.App, yet in both cases you are trying to cast toB.App.There can only be one current application also.