Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

@bamarsha
Copy link
Contributor

No description provided.

@filipw
Copy link
Contributor

filipw commented Jan 15, 2021

very nice

@bamarsha
Copy link
Contributor Author

Unfortunately it doesn't work. :(

 [Error]: MSBuild error in C:\hostedtoolcache\windows\dotnet\sdk\5.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(63,5): The "ProcessFrameworkReferences" task failed unexpectedly.
 System.MissingMethodException: Method not found: 'System.String NuGet.Frameworks.NuGetFramework.get_Platform()'.
    at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.KnownFrameworkReferenceAppliesToTargetFramework(NuGetFramework knownFrameworkReferenceTargetFramework)
    at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.<ExecuteCore>b__105_1(KnownFrameworkReference kfr)
    at System.Linq.Enumerable.WhereEnumerableIterator`1.ToList()
    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
    at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
    at Microsoft.NET.Build.Tasks.TaskBase.Execute()
    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
 [Error]: Failed to restore project 'D:\a\1\s\src\QsCompiler\Tests.LanguageServer\bin\Release\net5.0\TestProjects\test12\test12.csproj'.

@filipw
Copy link
Contributor

filipw commented Jan 15, 2021

did you try upgrading MSBuild packages to 16.8?

@bamarsha
Copy link
Contributor Author

Same error after updating the Microsoft.Build.* packages to 16.8.0. :(

@filipw
Copy link
Contributor

filipw commented Jan 15, 2021

does it fail locally too or only in CI?

I can see that there is a workaround ("hack") in place to load Nuget assemblies from the MSBuild locator https://github.com/microsoft/qsharp-compiler/blob/main/src/QsCompiler/LanguageServer/Program.cs#L106-L119

I guess the reason is to avoid taking an explicit dependency on Nuget packages? For example in OmniSharp we still directly reference NuGet packages and actually old ones (https://github.com/OmniSharp/omnisharp-roslyn/blob/master/build/Packages.props#L7) as they provide the lowest supported boundary.

On a separate note, I think in the future the workaround won't be needed once this ships microsoft/MSBuildLocator#115

@bamarsha
Copy link
Contributor Author

does it fail locally too or only in CI?

It was failing locally with the same error, too.

I guess the reason is to avoid taking an explicit dependency on Nuget packages? For example in OmniSharp we still directly reference NuGet packages and actually old ones (https://github.com/OmniSharp/omnisharp-roslyn/blob/master/build/Packages.props#L7) as they provide the lowest supported boundary.

Yeah, I think it was to avoid the explicit dependency, since the language server was breaking every time there was a .NET Core update until we updated our dependencies... It looks like adding an explicit dependency on NuGet.Frameworks 5.8.0 fixes the tests, though. Without the dependency, an older version (5.0.0 or 5.1.0 I think) was getting pulled in from somewhere (not sure why).

On a separate note, I think in the future the workaround won't be needed once this ships microsoft/MSBuildLocator#115

👍

@bamarsha
Copy link
Contributor Author

bamarsha commented Mar 2, 2021

This is blocked until the QDK build pipeline has .NET 5. I don't know when that will be, so I'll close this for now.

@bamarsha bamarsha closed this Mar 2, 2021
@bamarsha bamarsha deleted the samarsha/ls-net5 branch March 2, 2021 23:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants