Question: I am trying to get the main Window of an application written C#.
Application.MainWindow Property does not work :(

uses: 

```
using System;
using System.Windows;

using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using System.Collections.Generic;

using My;
using MyDialogs;

using System.Xml.Serialization;
using System.Runtime.InteropServices;

using System.Windows.Input;
using System.Windows.Media;
using System.Threading;
using System.Windows.Interop;

```

Answer: 
Sorry, it was my fault. I registered area routes calling `context.Routes.MapRoute()` instead of `context.MapRoute()` method.
Searches tend to take people here, so I'd like to shard another related item.

I've had issues where the **view won't be returned** due to an **unexpected miss-match of the overloaded method** I meant to be calling, and the actual **method signature match**.

For example, if you have Id as a string, then View("Something",id) will match the overload expecting a string ViewName and a string MasterName...

**Not:**

```
return View("Something",id);

```

My recommendation here is that it can be more clear, and fix this problem, if you provide the parameter names

**But Instead:**

```
return View(viewName:"Something", model: id);

```

These types of problems can happen also in HTML Helper methods, where you often just expect to be able to pass in your model, but if you model is just a string, you might be matching some other overload method signature. (For example, the Action link html helpers.)

Because of this, I recommend just specifying the parameter name, and avoiding the unexpected. Heck, it might even make the expectation of your code just a little more clear.