jdtcn / BlazorDateRangePicker

A Blazor component for choosing date ranges and dates
MIT License
182 stars 35 forks source link

Visual Studio 2022 .NET 8 intellisense error #92

Closed kaniosm closed 9 months ago

kaniosm commented 9 months ago

When DateRangePicker tag is used in a component, Visual Studio Razor TagHelper Provider crashes with the below error: Screenshot 2023-11-27 153145

StreamJsonRpc.RemoteInvocationException: Specified argument was out of the range of valid values. at StreamJsonRpc.JsonRpc.d1511.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.ValueTask1.get_Result() at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection1.<TryInvokeAsync>d__181.MoveNext() RPC server exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. at Microsoft.AspNetCore.Razor.Utilities.Checksum.Builder.gAppendData|14_0(SHA256 hash, Byte[] buffer, String value) at Microsoft.AspNetCore.Razor.Utilities.Checksum.Builder.AppendStringValue(String value) at Microsoft.AspNetCore.Razor.Language.DocumentationObject.AppendToChecksum(Builder& builder) at Microsoft.AspNetCore.Razor.Language.BoundAttributeDescriptor.BuildChecksum(Builder& builder) at Microsoft.AspNetCore.Razor.Language.TagHelperObject1.ComputeChecksum() at Microsoft.AspNetCore.Razor.Language.TagHelperObject1.get_Checksum() at Microsoft.AspNetCore.Razor.Language.TagHelperObject1.GetHashCode() at System.Collections.Generic.HashSet1.AddIfNotPresent(T value, Int32& location) at System.Collections.Generic.HashSet1.Add(T item) at Microsoft.AspNetCore.Razor.PooledObjects.PooledHashSet1.Add(T item) at Microsoft.AspNetCore.Razor.Language.TagHelperObjectBuilderCollection2.ToImmutable() at Microsoft.AspNetCore.Razor.Language.TagHelperDescriptorBuilder.BuildCore(ImmutableArray1 diagnostics) at Microsoft.AspNetCore.Razor.Language.TagHelperObjectBuilder1.Build() at Microsoft.CodeAnalysis.Razor.ComponentTagHelperDescriptorProvider.Collector.CreateNameMatchingDescriptor(INamedTypeSymbol type, ImmutableArray1 properties, Boolean fullyQualified) at Microsoft.CodeAnalysis.Razor.ComponentTagHelperDescriptorProvider.Collector.CreateShortNameMatchingDescriptor(INamedTypeSymbol type, ImmutableArray1 properties) at Microsoft.CodeAnalysis.Razor.ComponentTagHelperDescriptorProvider.Collector.Collect(ISymbol symbol, ICollection1 results) at Microsoft.AspNetCore.Razor.Language.TagHelperCollector`1.Collect(TagHelperDescriptorProviderContext context) at Microsoft.CodeAnalysis.Razor.ComponentTagHelperDescriptorProvider.Execute(TagHelperDescriptorProviderContext context) at Microsoft.AspNetCore.Razor.CompilationTagHelperResolver.gExecuteProviders|2_1(ITagHelperDescriptorProvider[] providers, TagHelperDescriptorProviderContext context, ITelemetryReporter telemetryReporter) at Microsoft.AspNetCore.Razor.CompilationTagHelperResolver.GetTagHelpersAsync(Project workspaceProject, RazorProjectEngine projectEngine, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.Razor.RemoteTagHelperProviderService.GetTagHelpersDeltaCoreAsync(Solution solution, ProjectSnapshotHandle projectHandle, String factoryTypeName, Int32 lastResultId, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>cDisplayClass9_01.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteWorkspaceManager.RunServiceAsync[T](ServiceBrokerClient client, Checksum solutionChecksum, Func2 implementation, CancellationToken cancellationToken)

jdtcn commented 9 months ago

Hi, thanks for reporting the bug, please tell me what version of vs and net sdk it is, I will try to reproduce the problem

kaniosm commented 9 months ago

Hi, The error was visible in VS 2022 Preview (17.9.0 Preview 1), but this happens silently in 17.8.3 and 17.9.0 Preview 1.1 as well. You can identify the problem by opening the component containing DateRangePicker and notice that the tag is not bold like normal components and intellisense underlines in green the tag, notifying that the component is not recognised. The app still compiles since this is simply an intellisense issue. In 17.9.0 Preview 1.1 this breaks intellisense for the whole component (i.e. none of the rest of the components is identified). Intellisense information are cached in the .vs folder of your solution. If you delete the .vs folder VS will try to regenerate.

I hope this helps!

kaniosm commented 9 months ago

This is fixed in Visual Studio 2022 17.9.0 Preview 2.0! It seems this is a VS issue... I'm closing the issue here.