I am trying to call api using Flurl and here is my request which only fails on my testserver but works on live server and localhost as well
PickUp responseAsPickUpPointServiceResponse = null;
try
{
responseAsPickUpPointServiceResponse =
await new Flurl.Url(_baseUrl + "/rest//v1/servicepoint/findByPostalCode.json")
.SetQueryParam("apikey", APIKEY_WEB1)
.SetQueryParam("countryCode", countrycode)
.SetQueryParam("postalCode", zipcode)
.WithHeader("Accept", "application/json;charset=UTF-8")
.GetJsonAsync<PickUp>();
}
BUt it fails with error
Method not found: 'System.Threading.Tasks.Task`1 Flurl.Http.GeneratedExtensions.GetJsonAsync(Flurl.Http.IFlurlRequest, System.Threading.CancellationToken, System.Net.Http.HttpCompletionOption)
Has anyone idea how to fix this?
Same here, I got the same error Method not found [...] GetJsonAsync when running my integration tests although it was working well with unit tests.
In my case, there were two projects where Flurl.Http versions mismatched :
main.csproj
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Flurl" Version="3.0.0" />
<PackageReference Include="Flurl.Http" Version="3.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\other\imported.csproj" />
</ItemGroup>
</Project>
imported.csproj
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Flurl" Version="2.8.2" />
<PackageReference Include="Flurl.Http" Version="2.4.2" />
</ItemGroup>
</Project>
The error was fixed by bumping Flurl version to 3.0.1 everywhere :
In both files :
<PackageReference Include="Flurl" Version="3.0.1" />
<PackageReference Include="Flurl.Http" Version="3.0.1" />
Related
I need to add a Unit Test in an existing Visual Studio solution with 100s of tests. I wrote a simple Unit Test only to check if it is working.
My test code is:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace Training.UnitTests
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
Assert.AreEqual(1, 1);
}
}
}
The projects used in the Visual Studio solution are of **SDK-Style**. Now when I try to run all the tests, I found that some of the tests run and some of test do not run as shown in the screenshot below (including my newly added sample test).
I do not understand why some tests are running and some tests do not run at all in Visual Studio's Test Explorer. All of these tests run fine in the Azure DevOps pipeline. I even tried to run my sample test individually in Visual Studio by pressing Ctrl + R + T but the test only builds not run. But if
Following are the sample project files of the UnitTest projects which run and those wo do not run.
.csproj of a running Project
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\_Solution\build.defaults.targets" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<OutputPath>$(SolutionDir)SystemTests\$(Configuration)</OutputPath>
<AssemblyTitle>SystemTest</AssemblyTitle>
<DebugType>full</DebugType>
<LangVersion>8</LangVersion>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>false</Optimize>
<DebugSymbols>true</DebugSymbols>
<AssemblyName>SystemTest.Bus</AssemblyName>
</PropertyGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<ItemGroup>
<Reference Include="PresentationCore" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="$(MSTestTestAdapterNugetVersion)" />
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestTestAdapterNugetVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkNugetVersion)" />
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsNugetVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\UnitTestSetups.csproj" />
<ProjectReference Include="..\..\Bus.Impl.csproj" />
</ItemGroup>
<Target Name="CopyCustomContent" AfterTargets="AfterBuild">
<Copy SourceFiles="..\..\..\..\_Solution\automation.runsettings" DestinationFolder="$(OutDir)" />
</Target>
</Project>
.csproj file of a NOT running project:
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="..\..\..\..\_Solution\build.defaults.targets" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<OutputPath>$(SolutionDir)\Tests\$(Configuration)</OutputPath>
<AssemblyTitle>Training.UnitTests</AssemblyTitle>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsNugetVersion)" />
<PackageReference Include="Moq" Version="$(MoqNugetVersion)" />
<PackageReference Include="MSTest.TestAdapter" Version="$(MSTestTestAdapterNugetVersion)" />
<PackageReference Include="MSTest.TestFramework" Version="$(MSTestTestAdapterNugetVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkNugetVersion)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Caliburn.Micro" Version="$(VcSimNugetVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Training.csproj" />
</ItemGroup>
</Project>
QUESTION: Why only some of the UnitTests are running in Visual Studio's Test Explorer? The test which do not run in VS run fine in Azure DevOps pipeline.
Comparing both csprojs, I noticed the one which contains the tests that are not running contains the following line:
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
I've checked a previous answer and I believed the above line was either in the wrong place or not being used, reason why I've first recommended removing it to validate my assumption. It turns out it was not being used and after removing, it solved your problem.
I am trying to get some values from the appsettings.json. But whatever I try with the AdditionalTextsProvider doesn't work. Here is my code
IncrementalValuesProvider<AdditionalText> textFiles = context.AdditionalTextsProvider.Where(static file => file.Path.Contains("appsettings.json")); // tried many things here, like EndsWith(".json") etc..
IncrementalValuesProvider<(string name, string content)> namesAndContents = textFiles.Select((text, cancellationToken) => (name: Path.GetFileNameWithoutExtension(text.Path), content: text.GetText(cancellationToken)!.ToString()));
context.RegisterSourceOutput(namesAndContents, (spc, nameAndContent) =>
{
nameAndContent.content; //always empty
nameAndContent.name; //always empty
});
From the other hand, when I implement the ISourceGenerator (same solution, same projects) this line of code just works!
var file = context.AdditionalFiles.FirstOrDefault(x => x.Path.Contains("appsettings.json"));
The project which is referencing the code generator:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Scrutor" Version="4.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\myproject\myproject.csproj" />
<ProjectReference Include="..\myproject.EFCore\myproject.EFCore.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="appsettings.json" />
</ItemGroup>
</Project>
Code generator project :
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <!-- Generates a package at build -->
<IncludeBuildOutput>false</IncludeBuildOutput> <!-- Do not include the generator as a lib dependency -->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<!-- Generator dependencies -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" GeneratePathProperty="true" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup> <GetTargetPathDependsOn>$(GetTargetPathDependsOn);GetDependencyTargetPaths</GetTargetPathDependsOn>
</PropertyGroup>
<Target Name="GetDependencyTargetPaths">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker Include="$(PKGNewtonsoft_Json)\lib\netstandard2.0\Newtonsoft.Json.dll" IncludeRuntimeDependency="false" />
</ItemGroup>
</Target>
<ItemGroup>
<!-- Package the generator in the analyzer directory of the nuget package -->
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<!-- Package the props file -->
</ItemGroup>
</Project>
If you combine the additional text provider with the compilation it works for me (inspired by this great post):
public void Initialize(IncrementalGeneratorInitializationContext context)
{
var files = context.AdditionalTextsProvider
.Where(a => a.Path.EndsWith("appsettings.json"))
.Select((a, c) => (Path.GetFileNameWithoutExtension(a.Path), a.GetText(c)!.ToString()));
var compilationAndFiles = context.CompilationProvider.Combine(files.Collect());
context.RegisterSourceOutput(compilationAndFiles, (productionContext, sourceContext) => Generate(productionContext, sourceContext));
}
void Generate(SourceProductionContext context, (Compilation compilation, ImmutableArray<(string, string)> files) compilationAndFiles)
{
//emit generated files...
}
Update:
Tested again with Visual Studio 17.4. and combination with compilation seems not to be necessary anymore. Generator is called as expected when appsettings.json changes with only AdditionalTextsProvider registered.
I have tried replicate but everything works for me.
I define my source generator as this
namespace ConsoleAppSourceGenerator
{
[Generator]
public class TxtGenerator : IIncrementalGenerator
{
private static int counter;
public void Initialize(IncrementalGeneratorInitializationContext initContext)
{
IncrementalValuesProvider<AdditionalText> textFiles = initContext.AdditionalTextsProvider
.Where(static file => file.Path.EndsWith(".txt"));
IncrementalValuesProvider<(string name, string content)> namesAndContents = textFiles
.Select((text, cancellationToken) => (name: Path.GetFileNameWithoutExtension(text.Path), content: text.GetText(cancellationToken)!.ToString()));
initContext.RegisterSourceOutput(namesAndContents, (spc, nameAndContent) =>
{
spc.AddSource($"TxtFile.{nameAndContent.name}.g.cs", $#"
// Counter {Interlocked.Increment(ref counter)}
public static partial class TxtFile
{{
public const string {nameAndContent.name} = ""{nameAndContent.content}"";
}}");
});
}
}
}
and source generator project as this
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>Latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" />
</ItemGroup>
</Project>
Then in another project, where I have made a dummy foo.txt file I have
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Remove="$(CompilerGeneratedFilesOutputPath)/**/*.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ConsoleAppSourceGenerator\ConsoleAppSourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="foo.txt"/>
</ItemGroup>
</Project>
If I through Visual Studio look at Dependencies->Analyzers->ConsoleAppSourceGenerator>TxtFile.foo.g.cs then it correctly increase the counter on every change I to in the file (see step 9).
I store generated files in path ConsoleApp/Generated/ConsoleAppSourceGenerator/ConsoleAppSourceGenerator.TxtGenerator and whenever I rebuild the project it correctly updates the files.
Have you remembered to add the [Generator] attribute to the IIncrementalGenerator?
Could you test this out and validates this doesn't either work for you?
"AdditionalFiles" in your consuming project file is the key to ensuring these files are captured by your source/incremental generator.
Found out that using a "<AdditionalFiles Include='...' />" is not necessary in some projects such as ASPNET Core projects for Source/IncrementalGenerators. The .cshtml files are included as additional files by default.
Also, file globbing patterns work with the "Include" parameter.
I got a pretty simple dot-net-core Project. This includes a little MockServerLibrary based on kestrel, that returns some simple REST-replies in unittests.
The complete setup works fine on dotnetCore2.2. Switching to dotnetCore3.0 produces an error in the startup of the Server:
Output stream: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Hosting.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. Das System kann die angegebene Datei nicht finden.
File name: 'Microsoft.Extensions.Hosting.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at ServerMock.RestMockStarter.RunServer(String[] args)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
but only, if this is done by the [OneTimeSetup] of the unit-test project. When I start the MockServer's main-Method stand alone, the server starts fine.
My Assumption is, that the Server-Start fails, because the ServerMock is a
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<LangVersion>8</LangVersion>
</PropertyGroup>
(...)
but the unitTestProject is
<Project Sdk="Microsoft.NET.Sdk">
(...)
<ItemGroup>
<PackageReference Include="nunit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
</ItemGroup>
(...)
This seems not to a problem in 2.2, because we needed a explicit reference to the packages in the ServerMock
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Xml" Version="2.2.0" />
</ItemGroup>
As far as I understand, these refereces aren't needed anymore (far more: the need to be removed with 3.0), but it seems that they can't be loaded automatically, when started from my unit tests.
Maybe the error is already, that the ServerMock is directy referenced by the unitTest-Project:
<ItemGroup>
<ProjectReference Include="..\ServerMock\ServerMock.csproj" />
and the ServerStart is pretty hard-wired in the [OneTimeSetup]:
await RestMockStarter.RunServer(null);
I already tried to change the type of the unitTest-Project to Microsoft.NET.Sdk.Web, but then it's not longer possile to start/see any unitTests (at least with Rider, so I think this is not the way I should try to fix the problem)
I was able to solve the problem:
(1) Changed the ServerMock-project's csproj-file to
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties" />
</ItemGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
From that point I assume it became a "usual" dot-net-core project, and with <FrameworkReference Include="Microsoft.AspNetCore.App" /> the references to the web-extensions are again explicit.
(2) Added
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
to the unit-test's csproj too.
(3) On that point it became al litte frustrating, because the error still occured, but deleting the bin/obj-folder then suddenly helped.
I'm using dotnet standard 2.0 (Visual Studio 2017) for gRPC. This is how my whole project looks like:
Messages.proto
syntax = "proto3";
package Messages;
message IdRequest{
int32 id = 1;
}
message NameResponse{
string name=1;
}
Name.proto
syntax = "proto3";
package Services;
import public "proto/messages.proto";
service NameService{
rpc GetNameById(Messages.IdRequest) returns (Messages.NameResponse);
}
Common.proj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="proto\messages.proto" />
<None Remove="proto\name.proto" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.10.1" />
<PackageReference Include="Grpc" Version="2.24.0" />
<PackageReference Include="Grpc.Core" Version="2.24.0" />
<PackageReference Include="Grpc.Tools" Version="2.24.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Protobuf Include="proto\messages.proto" />
<Protobuf Include="proto\name.proto" />
</ItemGroup>
</Project>
The project builds successfully however the final Common.dll has no Messages namespace and I cannot really reference IdRequest or NameResponse.
So where am I making the mistake that hides Messages namespace?
In your project file into the Protobuf-tag you need to add the GrpcServices attribute or else no code is created:
<ItemGroup>
<Protobuf Include="proto\messages.proto" GrpcServices="Server" />
<Protobuf Include="proto\name.proto" GrpcServices="Server" />
</ItemGroup>
I know this is so old, but in case it is helpful for someone else. The documentation for gRPC has greatly improved since the asking of this question.
Looking at the tags associated, but also from the discussions and screenshots from here, I'm going to make the assumption that the project was working with csharp, as this makes a difference. I believe the namespaces are not generated correctly because the option "csharp_namespace" is missing.
The service will also have its namespace changed because of this amendment.
Message.proto:
syntax = "proto3";
package Messages;
option csharp_namespace = "Messages";
message IdRequest{
int32 id = 1;
}
message NameResponse{
string name=1;
}
Name.proto:
syntax = "proto3";
package Services;
option csharp_namespace = "Messages";
import "proto/Messages.proto";
service NameService{
rpc GetNameById(Messages.IdRequest) returns (Messages.NameResponse);
}
deploying from VS version on the app service is: 2.1.403
and version on my local is: 2.1.403
here is a copy of the relevent section of the .csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
<UserSecretsId>952fa24f-1cbc-4017-8cdc-4b99e3671be7</UserSecretsId>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<RuntimeIdentifiers>win10-x64;</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<Compile Remove="NewFolder\**" />
<Content Remove="NewFolder\**" />
<EmbeddedResource Remove="NewFolder\**" />
<None Remove="NewFolder\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bogus" Version="24.3.0" />
<PackageReference Include="MediatR" Version="5.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="5.1.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.4" />
<PackageReference Include="Microsoft.AspNetCore.All"/>
<PackageReference Include="Microsoft.AspNetCore.App"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.5" />
</ItemGroup>
I've tried:
using a self-contained deployment
specifying the version of the packages to 2.1.5 (though i've read this is not necessary)
my runtime.config in the build artifacts looks good:
{
"runtimeOptions": {
"tfm": "netcoreapp2.1",
"framework": {
"name": "Microsoft.AspNetCore.All",
"version": "2.1.5"
},
"configProperties": {
"System.GC.Server": true
}
}
}
so what am I missing here?
This fixed the issue:
<PackageReference Include="Microsoft.AspNetCore.All Version="2.1.1"/>
Though it could be a red herring as I have no idea why specifying the app version would fix (I thought the point of the shared framework was to dynamically pull in the versions you need.)
Also if it helps anyone: 2.1.5 is the release number and NOT THE VERSION OF THE SDK (it corresponds to 2.1.403)