Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot implicitly convert type 'AdvancedSharpAdbClient.Models.Framebuffer' to 'System.Drawing.Image' #99

Open
luronumen opened this issue Mar 14, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@luronumen
Copy link

Describe the bug

It is not possible convert implicitly convert type 'AdvancedSharpAdbClient.Models.Framebuffer' to 'System.Drawing.Image' when build using .NET 8.0.

Steps to reproduce the bug

Try implicitly convert type 'AdvancedSharpAdbClient.Models.Framebuffer' to 'System.Drawing.Image' using 'AdvancedSharpAdbClient for .NET 8.0:

var deviceData = AdbClient.GetDevices().First(x => x.Serial == serial);
var adbClient = new AdbClient();
var image = (Image)adbClient.GetFrameBuffer(deviceData);

Expected behavior

It should be possible convert implicitly convert type 'AdvancedSharpAdbClient.Models.Framebuffer' to 'System.Drawing.Image' like it is possible to do when build using .NET Framework 4.8.1.

Screenshots

image

NuGet package version

3.1.10

.NET Platform

.NET 8

Platform type

Windows

System version

Windows 11 x64

IDE

Visual Studio 2022

Additional context

This issue is NOT reproducible when build using .NET Framework 4.8.1.

@luronumen luronumen added the bug Something isn't working label Mar 14, 2024
@wherewhere
Copy link
Member

Because it need System.Drawing.Common and I removed it because it only supports Windows since .NET 7. You can change target to net8.0-windows10.0.17763.0.

@luronumen
Copy link
Author

Hi @wherewhere

Thank you very much for your prompt reply!

I have replaced:

<TargetFramework>net8.0-windows</TargetFramework>

by:

<TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>

And this issue is not reproducible.

Is there any plan to remove System.Drawing.Common dependency once that it is now Windows Only?

Thanks in advanced,
Luciano

@wherewhere
Copy link
Member

But System.Drawing.Common is a part of desktop extension. .net-windows does not contains it...

@luronumen
Copy link
Author

But System.Drawing.Common is a part of desktop extension. .net-windows does not contains it...

If so, why not support the System.Drawing.Common for net8.0-windows fully instead of net8.0-windows10.0.17763.0 only if it is part of desktop extension?

@wherewhere
Copy link
Member

wherewhere commented Mar 14, 2024

@wherewhere
Copy link
Member

@wherewhere
Copy link
Member

https://gist.github.com/wherewhere/bcbab80a9460aad8fd14655c15c76cba

@luronumen
Copy link
Author

https://gist.github.com/wherewhere/bcbab80a9460aad8fd14655c15c76cba

Hi @wherewhere

Do you have any plan to add this implementation in the next AdvancedSharpAdbClient package to make it is possible to convert the Framebuffer to System.Drawing.Image on net8.0-windows?

Thanks in advance,
Luciano

@wherewhere
Copy link
Member

No

@luronumen
Copy link
Author

No

If so, could you please update the README documentation to say that this is not working when use the net8.0-windows as TargetFramework:

https://github.com/SharpAdb/AdvancedSharpAdbClient#getting-a-screenshot

@wherewhere
Copy link
Member

@wherewhere wherewhere pinned this issue Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants