.net-standard-2.0library-project

'Application' doesn't exist in System.Windows namespace (in library project)


I'm working on .net standard 2.0 library project for my solution.

It have to include this method:

public Task ShutdownAsync()
{
    Application.Current.Shutdown();
}

Problem is it gives me an error:

The name 'Application' does not exist in the current context

It also doesn't exist in System.Windows.

As answers to similar questions suggests I tried to add reference to PresentationFramework. But it isn't on the list.

Looks like it have something to do with the fact I'm doing it in a library project targeted at .net standard 2.0.

Is here any way to add proper reference to this project?


Solution

  • .Net standard 2.0 was the problem.

    This class is platform-specific so I should target .Net Platform instead.