Closed vindicatorr closed 4 years ago
Hi - is this related to #41 / #26 ?
Given the age of those, and the report I linked showing to be recent as well as my case, I'd say it's something else.
A reinstall made no difference and it's version 0.3.5. As you can see, I'm using the .net 5.0 SDK (related? https://github.com/dotnet/sdk/blob/d6ac175f2ed2811ae6cf425d956d3aa870e885b9/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets#L76)
The vscode link I provided suggested it was an extension issue. I narrowed it to msbuild/tintoy, but could it be an issue in the SDK (dotnet msbuild)? I mean, they wouldn't just drop that method, no? What is tintoy doing/calling that is making that exception get thrown?
I don't use VS 2017/15.5, but rather vscode 1.46.0-insider, and I'd have no clue how to go about upgrading msbuild alone. There was no post about "VersionLessThan" in the msbuild Issues.
Also, the issue only shows when you're viewing the csproj file.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
Usually it’s because one of the .targets files has an expression that references a type or method that is only defined in a newer version of MSBuild.
I guess we’ll have to upgrade to a new version of MSBuild again. If it’s 5.x we may have to wait until they are stable enough that it doesn’t break stuff for anyone still previous versions :-/
IOW it’s probably the same issue but due to a different type or method (and with the same solution as last time, provided they haven’t broken backwards compatibility)...
(thanks for reporting it BTW, I’ll have a go at trying out the latest MSBuild packages tomorrow and see how that goes)
If I build a new extension package can you try it out for me?
I do believe so. I'm going to assume I just move out the current extension from ".vscode-insiders/extensions/" and extract your test one in the same place.
Slightly trickier unfortunately :)
You'll need to remove the existing extension:
Then install it from here:
msbuild-project-tools-0.3.6.zip
(can't upload .vsix directly unfortunately)
First time for me installing a vsix and it took longer than I expected. I was able to manually extract the vsix contents (not in the extensions folder) quickly, so I don't know what makes it take like a couple of minutes.
Anyway, sorry to say, but no-joy...
Result was "System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult, OmniSharp.Extensions.LanguageProtocol, Version=0.7.9.0, Culture=neutral, PublicKeyToken=null]]"
Response value was "OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult"
Finished: Routing Request (0) "initialize" in 34ms
Finding descriptor for "initialized"
Finding descriptor for "workspace/didChangeConfiguration"
Starting: Routing Notification "initialized"
Finished: Routing Notification "initialized" in 7ms
Starting: Routing Notification "workspace/didChangeConfiguration"
Converting params for Notification "workspace/didChangeConfiguration" to "MSBuildProjectTools.LanguageServer.CustomProtocol.DidChangeConfigurationObjectParams"
Finished: Routing Notification "workspace/didChangeConfiguration" in 39ms
Language server initialised by client.
Finding descriptor for "textDocument/didOpen"
Created attribute "xml::file:///<pathTo>.csproj"
Looking for handler for method ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]
Checking handler ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]:"MSBuildProjectTools.LanguageServer.Handlers.DocumentSyncHandler"
Registration options "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
Starting: Routing Notification "textDocument/didOpen"
Converting params for Notification "textDocument/didOpen" to "OmniSharp.Extensions.LanguageServer.Protocol.Models.DidOpenTextDocumentParams"
Finding descriptor for "textDocument/documentSymbol"
Found attributes 1, ["msbuild::file:///<pathTo>.csproj"]
Looking for handler for method ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]
Checking handler ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]:"MSBuildProjectTools.LanguageServer.Handlers.DocumentSymbolHandler"
Registration options "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
[Info - 3:08:51 AM] 1 package sources configured for project "/<pathTo>.csproj".
[Info - 3:08:51 AM] Locally-configured package source "nuget.org" (v3) => https://api.nuget.org/v3/index.json
[Error - 3:08:51 AM] Error configuring NuGet package sources for MSBuild project '"/<pathTo>.csproj"'.
NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://api.nuget.org/v3/index.json.
---> System.Net.Http.HttpRequestException: Name or service not known
---> System.Net.Sockets.SocketException (0xFFFDFFFF): Name or service not known
at async ValueTask<Stream> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at async ValueTask<Stream> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellationToken)
at TResult System.Threading.Tasks.ValueTask<TResult>.get_Result()
at TResult System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>+ConfiguredValueTaskAwaiter.GetResult()
at async ValueTask<ValueTuple<Socket, Stream, TransportContext, HttpResponseMessage>> System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, bool allowHttp2, CancellationToken cancellationToken)
at TResult System.Threading.Tasks.ValueTask<TResult>.get_Result()
at TResult System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>+ConfiguredValueTaskAwaiter.GetResult()
at async ValueTask<ValueTuple<HttpConnection, HttpResponseMessage>> System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at TResult System.Threading.Tasks.ValueTask<TResult>.get_Result()
at TResult System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>+ConfiguredValueTaskAwaiter.GetResult()
at async (ValueTuple<HttpConnectionBase, bool, HttpResponseMessage> connection) System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at TResult System.Threading.Tasks.ValueTask<TResult>.get_Result()
at TResult System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>+ConfiguredValueTaskAwaiter.GetResult()
at async Task<HttpResponseMessage> System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, bool doRequestAuth, CancellationToken cancellationToken)
at async Task<HttpResponseMessage> System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, bool preAuthenticate, bool isProxyAuth, bool doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
at async Task<HttpResponseMessage> System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at async Task<HttpResponseMessage> System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at async Task<HttpResponseMessage> NuGet.Protocol.HttpSourceAuthenticationHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at async Task<HttpResponseMessage> System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task<HttpResponseMessage> sendTask, HttpRequestMessage request, CancellationTokenSource cts, bool disposeCts)
at async Task<T> NuGet.Protocol.TimeoutUtility.StartWithTimeout<T>(Func<CancellationToken, Task<T>> getTask, TimeSpan timeout, string timeoutMessage, CancellationToken token)
at async Task<HttpResponseMessage> NuGet.Protocol.HttpRetryHandler.SendAsync(HttpRetryHandlerRequest request, ILogger log, CancellationToken cancellationToken)
at async Task<ThrottledResponse> NuGet.Protocol.HttpSource.GetThrottledResponse(Func<HttpRequestMessage> requestFactory, TimeSpan requestTimeout, TimeSpan downloadTimeout, int maxTries, ILogger log, CancellationToken cancellationToken)
at void NuGet.Protocol.HttpSource+<>c__DisplayClass12_0<T>+<<GetAsync>b__0>d.MoveNext()
at async Task<T> NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync<T>(string filePath, Func<CancellationToken, Task<T>> action, CancellationToken token)
at async Task<T> NuGet.Protocol.HttpSource.GetAsync<T>(HttpSourceCachedRequest request, Func<HttpSourceResult, Task<T>> processAsync, ILogger log, CancellationToken token)
at async Task<ServiceIndexResourceV3> NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
--- End of inner exception stack trace ---
at async Task<ServiceIndexResourceV3> NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
at async Task<Tuple<bool, INuGetResource>> NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
at async Task<T> NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync<T>(CancellationToken token)
at async Task<Tuple<bool, INuGetResource>> NuGet.Protocol.AutoCompleteResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
at async Task<T> NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync<T>(CancellationToken token)
at async Task<List<AutoCompleteResource>> MSBuildProjectTools.LanguageServer.Utilities.NuGetHelper.GetAutoCompleteResources(IEnumerable<PackageSource> packageSources, CancellationToken cancellationToken) in /<weirdPathTo>/C:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Common\Utilities\NuGetHelper.cs:line 105
at async Task<bool> MSBuildProjectTools.LanguageServer.Documents.ProjectDocument.ConfigurePackageSources(CancellationToken cancellationToken) in /<weirdPathTo>/C:\Development\github\tintoy\msbuild-project-tools-vscode\lib\server\src\LanguageServer.Engine\Documents\ProjectDocument.cs:line 392
Launching "dotnet --info"...
Launched "dotnet --info". Waiting for process 46482 to terminate...
"dotnet --info" terminated with exit code 0.
"dotnet --info" returned the following text on STDOUT / STDERR.
.NET SDK (reflecting any global.json):
Version: 5.0.100-preview.4.20258.7
Commit: 65f0fc2cad
Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /opt/dotnet/sdk/5.0.100-preview.4.20258.7/
Host (useful for support):
Version: 5.0.0-preview.4.20251.6
Commit: 47ec733ba7
.NET SDKs installed:
3.1.201 [/opt/dotnet/sdk]
5.0.100-preview.4.20258.7 [/opt/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.3 [/opt/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0-preview.4.20257.10 [/opt/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.3 [/opt/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-preview.4.20251.6 [/opt/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Requesting suggestions for NuGet package Ids matching prefix "Newtonsoft.Json" (include pre-release: False)...
Found 0 suggestions for NuGet package Ids matching prefix "Newtonsoft.Json" (include pre-release: False).
[Info - 3:08:52 AM] Successfully loaded project "/<pathTo>.csproj".
===========================
- Project uses package source "nuget.org" ("https://api.nuget.org/v3/index.json")
===========================
MSBuild project loaded (3 MSBuild objects).
MSBuildSdkImport: SdkImport "Microsoft.NET.Sdk" spanning "[1,10..1,33)"
MSBuildProperty: Property "TargetFramework" spanning "[3,5..3,46)"
MSBuildItemGroup: Item "PackageReference" spanning "[6,5..6,56)"
Finished: Routing Notification "textDocument/didOpen" in 2521ms
Starting: Routing Request (1) "textDocument/documentSymbol"
Converting params for Request (1) "textDocument/documentSymbol" to "OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolParams"
Result was "System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolInformationContainer, OmniSharp.Extensions.LanguageProtocol, Version=0.7.9.0, Culture=neutral, PublicKeyToken=null]]"
Response value was "OmniSharp.Extensions.LanguageServer.Protocol.Models.DocumentSymbolInformationContainer"
Finished: Routing Request (1) "textDocument/documentSymbol" in 11ms
Finding descriptor for "textDocument/hover"
Found attributes 1, ["msbuild::file:///<pathTo>.csproj"]
Looking for handler for method ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]
Checking handler ["OmniSharp.Extensions.LanguageServer.Server.HandlerDescriptor"]:"MSBuildProjectTools.LanguageServer.Handlers.HoverHandler"
Registration options "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentRegistrationOptions"
Document Selector "[msbuild, file, **/*.*], [xml, file, **/*.*proj], [xml, file, **/*.props], [xml, file, **/*.targets]"
Starting: Routing Request (2) "textDocument/hover"
Converting params for Request (2) "textDocument/hover" to "OmniSharp.Extensions.LanguageServer.Protocol.Models.TextDocumentPositionParams"
Examining location 3,26 -> [Element, Value, Text]:/Project/PropertyGroup/TargetFramework/#text ([3,22..3,28))...
Result was "System.Threading.Tasks.Task`1[[OmniSharp.Extensions.LanguageServer.Protocol.Models.Hover, OmniSharp.Extensions.LanguageProtocol, Version=0.7.9.0, Culture=neutral, PublicKeyToken=null]]"
Response value was "OmniSharp.Extensions.LanguageServer.Protocol.Models.Hover"
Finished: Routing Request (2) "textDocument/hover" in 59ms
Finding descriptor for "$/cancelRequest"
Starting: Routing Notification "$/cancelRequest"
Converting params for Notification "$/cancelRequest" to "OmniSharp.Extensions.LanguageServer.Protocol.Models.CancelParams"
Request 2 was not found to cancel
Finished: Routing Notification "$/cancelRequest" in 0ms
Never mind the last report. It's actually fine. I noticed the web connection issue, corrected it and tried it again with NO errors. Great job!
Awesome - thanks for reporting it 🙂
Linking what I found: https://github.com/microsoft/vscode/issues/96938