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

error when build native aot with selenium dotnet 7 #86202

Closed
NCLnclNCL opened this issue May 13, 2023 · 15 comments
Closed

error when build native aot with selenium dotnet 7 #86202

NCLnclNCL opened this issue May 13, 2023 · 15 comments

Comments

@NCLnclNCL
Copy link

Description

error when i run it

Reproduction Steps

build native aot

Expected behavior

running succesfully

Actual behavior

error
Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Reflection.Assembly.GetCallingAssembly() + 0x5b
at OpenQA.Selenium.Internal.ResourceUtilities.get_AssemblyVersion() + 0x40
at OpenQA.Selenium.Remote.HttpCommandExecutor..ctor(Uri, TimeSpan, Boolean) + 0xbc
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor..ctor(DriverService, TimeSpan, Boolean) + 0x4d
at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService, ChromiumOptions, TimeSpan) + 0x44
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService, ChromeOptions) + 0x26

Regression?

No response

Known Workarounds

no

Configuration

.net 7
win 10
x64

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label May 13, 2023
@ghost
Copy link

ghost commented May 13, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

error when i run it

Reproduction Steps

build native aot

Expected behavior

running succesfully

Actual behavior

error
Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Reflection.Assembly.GetCallingAssembly() + 0x5b
at OpenQA.Selenium.Internal.ResourceUtilities.get_AssemblyVersion() + 0x40
at OpenQA.Selenium.Remote.HttpCommandExecutor..ctor(Uri, TimeSpan, Boolean) + 0xbc
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor..ctor(DriverService, TimeSpan, Boolean) + 0x4d
at OpenQA.Selenium.Chromium.ChromiumDriver..ctor(ChromiumDriverService, ChromiumOptions, TimeSpan) + 0x44
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService, ChromeOptions) + 0x26

Regression?

No response

Known Workarounds

no

Configuration

.net 7
win 10
x64

Other information

No response

Author: NCLnclNCL
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@am11
Copy link
Member

am11 commented May 13, 2023

NativeAOT does not support GetCallingAssembly. Either its support will be added as part of #69919 or this API will be obsoleted altogether in favor of Roslyn feature: dotnet/csharplang#4984.

@NCLnclNCL
Copy link
Author

NCLnclNCL commented May 13, 2023

NativeAOT does not support GetCallingAssembly. Either its support will be added as part of #69919 or this API will be obsoleted altogether in favor of Roslyn feature: dotnet/csharplang#4984.

I don't know how to actually use that function

@am11
Copy link
Member

am11 commented May 13, 2023

@NCLnclNCL
Copy link
Author

Selenium is calling GetCallingAssembly here: https://github.com/SeleniumHQ/selenium/blob/632df3ecab85f7ca6ce268573997a63983c47797/dotnet/src/webdriver/Internal/ResourceUtilities.cs#L46

How to fix sir, do i need to fix selenium source?

@am11
Copy link
Member

am11 commented May 13, 2023

do i need to fix selenium source?

Yes, making Selenium NativeAOT compatible is the way to go.

@NCLnclNCL
Copy link
Author

do i need to fix selenium source?

Yes, making Selenium NativeAOT compatible is the way to go.

How to making bro,do you can help me

@am11
Copy link
Member

am11 commented May 13, 2023

You can create an issue at https://github.com/SeleniumHQ/selenium/issues for NativeAOT compatibility or reply to this closed issue SeleniumHQ/selenium#8549 with your steps to repro. Someone in their community might be able to help.

The version of bazel they are using (rules_dotnet) doesn't support .NET 7 and I'm not familiar with bazel enough to know how to upgrade its rules. It was giving me "key net7.0 not found in dictionary" when I updated TargetFramework to net7.0 in webdriver's csrpoj file and built.

@MichalStrehovsky
Copy link
Member

I've submitted a PR to Selenium as SeleniumHQ/selenium#12038 but it looks like it's going to require a CLA signature and I'm not going to authorize a random github app to access my github account to do that. If the PR doesn't go through because they'll insist on the CLA on a de minims change that is not even copyrightable, @NCLnclNCL feel free to submit the same change yourself. I don't care about Selenium, I just wanted to fix this bug.

Going to close this as external/dup of #69919.

@MichalStrehovsky MichalStrehovsky closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label May 15, 2023
@am11
Copy link
Member

am11 commented May 15, 2023

@MichalStrehovsky, there are other places using PNSE-throwing APIs. Their build requires bazel in pre-build step to generate code needed by the main build. Without building it locally, it isn't worth pursuing.

@MichalStrehovsky
Copy link
Member

@MichalStrehovsky, there are other places using PNSE-throwing APIs. Their build requires bazel in pre-build step to generate code needed by the main build. Without building it locally, it isn't worth pursuing.

Ah, thanks! I'll just close the PR then. This one looked "obviously wrong" enough that I gave it a go but don't really want to spend time on it.

@NCLnclNCL
Copy link
Author

@MichalStrehovsky, there are other places using PNSE-throwing APIs. Their build requires bazel in pre-build step to generate code needed by the main build. Without building it locally, it isn't worth pursuing.

Ah, thanks! I'll just close the PR then. This one looked "obviously wrong" enough that I gave it a go but don't really want to spend time on it.

You still yet help me

@NCLnclNCL
Copy link
Author

Help me

@MichalStrehovsky
Copy link
Member

@NCLnclNCL you need to raise this with Selenium. Assembly.GetCallingAssembly is not supported with NativeAOT and we have no plans to add it.

@Perksey
Copy link
Member

Perksey commented Jun 3, 2023

It looks like Selenium fixed this 3 weeks ago: SeleniumHQ/selenium#12045

@ghost ghost locked as resolved and limited conversation to collaborators Jul 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants