VirtualDesktop icon indicating copy to clipboard operation
VirtualDesktop copied to clipboard

Application Manifest Not Taking Effect

Open danem opened this issue 7 years ago • 4 comments

I'm attempting to use this library on Windows 10 with Visual Studio Community 2017 Version 15.4.2. I installed VirtualDesktop through NuGet:

PM> Install-Package VirtualDesktop -Version 2.0.0-beta3

I've copied the app.manifest file from the example project, and have verified in the csproj file that it's looking at the correct manifest file. I run the application in release mode, yet I get the System.NotSupportedException.

Any idea what's wrong?

If I comment out the VirtualDesktopHelper.ThrowIfNotSupported() calls, things work as expected.

danem avatar Jan 24 '18 23:01 danem

I'm having the same Issue here. Interestingly the same issue occurs with the sample project included while using the NuGet Version. It works while referencing the source code directly. But removing the source code and adding the NuGet Version resulting in the same behaviour. There seems to be something different in the NuGet Version.

MrX13415 avatar Feb 14 '18 10:02 MrX13415

Ok I think this could be declared as "bug" because its very misleading. The actual issue is, that an exceptions is been raised about a missing STA-Thread. It should return another message then "not supported" because it's an implementation issue not an compatibility issue.

The solution to this is as following: Add "[STAThread]" to your main method like so:

    [STAThread]
    static void Main(string[] args)
    {
    ...
    }

MrX13415 avatar Feb 14 '18 14:02 MrX13415

I'm using PM> Install-Package VirtualDesktop -Version 4.0.0. It throws "You must target Windows 10 in your app.manifest and run without debugging.", I have checked app.manifest is correct.

I want to run this in DEBUG mode but at line number 100 (https://github.com/Grabacr07/VirtualDesktop/blob/f6f74589a210b20b324d36210aed03ed2efa981c/source/VirtualDesktop/VirtualDesktop.static.cs#L100) : It return false even my major version is 10.

I have checked Major version number by adding Environment.OSVersion.Version.Major in my local code and it returns 10. But while using Nudget package reference there is something wrong and returns false as per above link

Note: If I add VirtualDesktop as Project reference it works correctly with DEBUG mode.

nimeshvaghasiya avatar Jan 25 '21 03:01 nimeshvaghasiya

Same problem on Win10 20H2 with .NET 5, VS 2019. And adding [STAThread] doesn't help.

Chaoses-Ib avatar Mar 14 '21 08:03 Chaoses-Ib