Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

ASP .Net Core Runtime inclusion in the CLI #6460

Merged
merged 19 commits into from
May 3, 2017

Conversation

johnbeisner
Copy link

ASP .Net Core Runtime inclusion in the CLI

Enabling the download of ASP .Net Core Runtime blob storage: wixlibs and zip file to include with the CLI
ZIP file archive inclusion; wixlib still todo...

https://github.com/dotnet/cli/issues/6371
@dotnet/dotnet-cli

@johnbeisner johnbeisner added this to the 2.0.0 milestone Apr 28, 2017
@omajid
Copy link
Member

omajid commented Apr 28, 2017

cc'ing @ellismg since this might impact the source-build stuff

@livarcocc
Copy link

@ramarag @eerhardt can you guys help us understand the changes we need to make to get these tests passing again? I imagine they are failing because now we have the runtime store next to the SDK and dlls that were not supposed to be found are being found.

@eerhardt
Copy link
Member

public void AppFailsDueToMissingCache()
{
var testAppName = "NewtonSoftDependentProject";
var profileProjectName = "NewtonsoftProfile";
var targetManifestFileName = "NewtonsoftFilterProfile.xml";
var testInstance = TestAssets.Get(testAppName)
.CreateInstance()
.WithSourceFiles()
.UseCurrentRuntimeFrameworkVersion();
var testProjectDirectory = testInstance.Root.ToString();
var profileProjectPath = TestAssets.Get(profileProjectName).Root.FullName;
var profileFilter = Path.Combine(profileProjectPath, targetManifestFileName);
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should().Pass();
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
new PublishCommand()
.WithFramework(_tfm)
.WithWorkingDirectory(testProjectDirectory)
.WithTargetManifest(profileFilter)
.Execute()
.Should().Pass();
var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, _tfm, "publish", $"{testAppName}.dll");
new DotnetCommand()
.ExecuteWithCapturedOutput(outputDll)
.Should().Fail()
.And.HaveStdErrContaining($"Error: assembly specified in the dependencies manifest was not found probably due to missing runtime store associated with {targetManifestFileName} -- package: 'Newtonsoft.Json',");
}

The test tries to make a project that is dependent on Newtonsoft, and does a publish with excluding the Newtonsoft library. The idea being Newtonsoft should be available in a runtime store.

And then the test is testing what happens when Newtonsoft isn't in a runtime store - you should get a nice error message.

If ASP.NET is putting Newtonsoft in their store, the test is probably picking it up, and failing to fail correctly.

To fix this, one idea is to use a different assembly. Maybe a NuGet.Common.dll or something that isn't in the ASP.NET runtime store.

<Target Name="PublishAspNetRuntimePackageStore"
AfterTargets="CrossgenPublishDir">
<ItemGroup>
<AspNetRuntimePackageStore Remove="*" />

This comment was marked as spam.

<PropertyGroup>
<AspNetCoreRuntimeInstallerBlobRootUrl>$(CoreSetupBlobRootUrl)aspnetcore/store</AspNetCoreRuntimeInstallerBlobRootUrl>

<!-- Examples: Build.RS.linux.zip Build.RS.winx86.zip AspNetCorePackageStoreLibx64.wixlib -->

This comment was marked as spam.

This comment was marked as spam.

@livarcocc
Copy link

@ManishJayaswal @Pilchie for approval.

@ManishJayaswal
Copy link

@johnbeisner - sorry folks but I need to understand the customer scenario before approving. Just a few lines about what would happen if we do not take this fix and workaround if any.

@livarcocc
Copy link

@dotnet-bot Test OpenSUSE42.1 x64 Debug Build
@dotnet-bot Test Ubuntu x64 Release Build
@dotnet-bot Test Ubuntu16.04 x64 Debug Build

@livarcocc
Copy link

@ManishJayaswal This is not a bug fix. This is a feature. This is adding the ASP.NET Runtime Store to the CLI, so that the CLI carries it. This feature has been cooking for a while from the runtime all the way up to asp.net. Now they are producing the runtime store and we are consuming it.

@livarcocc livarcocc merged commit a551ae7 into dotnet:release/2.0.0 May 3, 2017
@livarcocc livarcocc deleted the NewAzurePackageStore branch May 3, 2017 04:29
@tmds
Copy link
Member

tmds commented May 3, 2017

@livarcocc @johnbeisner @ManishJayaswal I'd like to understand this a bit better.
What is the "ASP.NET Runtime Store" (-> what is in the wixlibs and zip file)?
Are these files included in the CLI installer? Or are they downloaded on first use?
Is this optional? Or does every CLI build need to include it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
9 participants