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

Compile error: Line Suppression State Error CS0246 The type or namespace name 'Log' could not be found #20

Open
kiinoo opened this issue Jun 4, 2022 · 2 comments
Assignees

Comments

@kiinoo
Copy link

kiinoo commented Jun 4, 2022

Hello,

I tried to use the lib via nuget, but failed to find webclient assembly (search result it empty :-(

so i tried to build from source via visual studio 2022, but got the following compile error:

Severity	Code	Description	Project	File	Line	Suppression State Error	CS0246	
The type or namespace name 'Log' could not be found (are you missing a using directive or an assembly reference?)	Gripper.ChromeDevTools	c:\a\src\Gripper.ChromeDevTools\ChromeSession_Domains.cs	29	Active

any solutions?

thanks very much!

@tomaskrupka tomaskrupka self-assigned this Jun 4, 2022
@tomaskrupka
Copy link
Owner

Hi, thanks for raising the issue.

I see that the Log namespace directory is missing from the repo. I'll try to fix that today.

However, builds for both Gripper.WebClient and Gripper.WebClient.Cdtr are on Nuget.

https://www.nuget.org/packages/Gripper.WebClient/0.6.1-alpha
https://www.nuget.org/packages/Gripper.WebClient.Cdtr/0.0.10-alpha

Note that they are still alpha. Did you make sure to tick the 'include prerelease' box in the VS Nuget package manager when you were searching for them?

Screenshot 2022-06-04 141250

@kiinoo
Copy link
Author

kiinoo commented Jun 5, 2022

thanks for quick answers,

I found the webclient then :)

but no luck to make the example code run:

	using Gripper.WebClient;
	using Gripper.WebClient.Extensions;
	using Microsoft.Extensions.DependencyInjection;

	try
	{
			var serviceProvider = new ServiceCollection()
			.AddGripper() // Register all services + default settings.
			.AddLogging()
			.BuildServiceProvider();

			var webClient = serviceProvider.GetRequiredService<IWebClient>(); // Fresh window driver.

			var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));

			await webClient.NavigateAsync(
					"https://tomaskrupka.github.io/Gripper/about",
					PollSettings.FrameDetectionDefault,
					cts.Token);

			var linksCountResponse = await webClient.MainContext.ExecuteScriptAsync(
					"document.querySelectorAll('a').length",
					cts.Token);

			Console.WriteLine($"Found {linksCountResponse.Result.Value} hyperlinks.");
	}
	catch (AggregateException ex)
	{
			foreach (var exception in ex.InnerExceptions)
			{
					Console.WriteLine(exception.ToString());
			}
	}

it stucked at var webClient = serviceProvider.GetRequiredService<IWebClient>(); // Fresh window driver.

with an exception:

	Object reference not set to an instance of an object.
			at Gripper.ChromeDevTools.ChromeSession.<SendCommand>d__20.MoveNext()
			at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
			at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
			at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
			at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
			at Gripper.ChromeDevTools.ChromeSession.<SendCommand>d__19`2.MoveNext()
			at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
			at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
			at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
			at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
			at Gripper.ChromeDevTools.Network.NetworkAdapter.<Enable>d__15.MoveNext()
			at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
			at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
			at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
			at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
			at Gripper.WebClient.CdpAdapter.<SubscribeToRdpEventsAsync>d__5.MoveNext()
			at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
			at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
			at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
			at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
			at Gripper.WebClient.CdpAdapter.<BindAsync>d__13.MoveNext()

File list in my compile target folder:

	ConsoleApp2.deps.json
	ConsoleApp2.dll
	ConsoleApp2.exe
	ConsoleApp2.pdb
	ConsoleApp2.runtimeconfig.json
	Gripper.ChromeDevTools.dll
	Gripper.WebClient.dll
	GripperProfile_Default
	Microsoft.Extensions.Configuration.Abstractions.dll
	Microsoft.Extensions.Configuration.dll
	Microsoft.Extensions.DependencyInjection.Abstractions.dll
	Microsoft.Extensions.DependencyInjection.dll
	Microsoft.Extensions.Logging.Abstractions.dll
	Microsoft.Extensions.Logging.dll
	Microsoft.Extensions.Options.dll
	Microsoft.Extensions.Primitives.dll
	Newtonsoft.Json.dll
	SuperSocket.ClientEngine.dll
	WebSocket4Net.dll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants