Hi, I have 2 WPF projects in 1 solution. Every of those projects have different service references. First project it's a window to login, second is a main window with app. It must be in separated projects, don't ask why.
So, I do main window reference in login project and create main window object when login data is corect. Here sample of code:
try
{
if (Service1.Login(login, pass))
{
MainWindow w2 = new MainWindow();
w2.Show();
this.Close();
}
}
catch (Exception ex)
{
//...
}
My problem is error occured when main window is called. Main exception is like this:
"Cannot create instance of 'MainWindow' defined in assembly 'TestApp, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an
invocation. Error in markup file 'MainWindow.xaml' Line 1 Position 9."
Inner exception told me something like:
"Cannot found endpoint of service..."
But when I run just main window project as startup it works good. Is there any "proper" method to call other WPFs whit service references? Or I must to do something with references?