Skip to content

Fix publishing self-contained ASP.NET apps #3002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/restore-toolset.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function InitializeCustomSDKToolset {
InstallDotNetSharedFramework "1.0.5"
InstallDotNetSharedFramework "1.1.2"
InstallDotNetSharedFramework "2.1.0"
InstallDotNetSharedFramework "2.2.2"
InstallDotNetSharedFramework "2.2.3"

CreateBuildEnvScript
InstallNuget
Expand Down
2 changes: 1 addition & 1 deletion eng/restore-toolset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function InitializeCustomSDKToolset {
InstallDotNetSharedFramework "1.0.5"
InstallDotNetSharedFramework "1.1.2"
InstallDotNetSharedFramework "2.1.0"
InstallDotNetSharedFramework "2.2.2"
InstallDotNetSharedFramework "2.2.3"
}

# Installs additional shared frameworks for testing purposes
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tools": {
"dotnet": "3.0.100-preview3-010404",
"dotnet": "3.0.100-preview4-010564",
"vs-opt": {
"version": "15.9"
}
Expand Down
5 changes: 3 additions & 2 deletions src/Tasks/Microsoft.NET.Build.Tasks/ResolveAppHosts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,13 @@ private ITaskItem GetHostItem(string runtimeIdentifier,

packagesToDownload.Add(packageToDownload);

appHostItem.SetMetadata(MetadataKeys.RuntimeIdentifier, runtimeIdentifier);
appHostItem.SetMetadata(MetadataKeys.PackageName, hostPackName);
appHostItem.SetMetadata(MetadataKeys.PackageVersion, appHostPackVersion);
appHostItem.SetMetadata(MetadataKeys.RelativePath, hostRelativePathInPackage);
}

appHostItem.SetMetadata(MetadataKeys.RelativePath, hostRelativePathInPackage);
appHostItem.SetMetadata(MetadataKeys.RuntimeIdentifier, runtimeIdentifier);

return appHostItem;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void AddAsset(string assetPath, string assetType)
assetPath.EndsWith(".map", StringComparison.OrdinalIgnoreCase) ||
assetPath.EndsWith(".txt", StringComparison.OrdinalIgnoreCase) ||
assetPath.EndsWith(".xml", StringComparison.OrdinalIgnoreCase) ||
assetPath.EndsWith(".json", StringComparison.OrdinalIgnoreCase) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an include list instead of exclude list?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason it's not an include list is because native assets can have a variety of extensions and I'm not sure if we know what that list is.

Eventually we would like the runtime packs to include a manifest which lists the managed and native files in the pack explicitly, so we don't have to glob for them at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

native assets can have a variety of extensions and I'm not sure if we know what that list is.

Can't we look at the fixed set of runtime packs we have now? Is it not .dll,.exe,.so,.dylib?

Switching to include list until we have the manifests seems reasonable to me to err on the safer side.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I'm ok with this more targeted fix to unblock things with the least change given that we have an even safer medium term plan.

assetPath.EndsWith("._", StringComparison.Ordinal))
{
// Don't add assets for these files (shouldn't be necessary if/once we have a manifest in the runtime pack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@ Copyright (c) .NET Foundation. All rights reserved.

<Import Project="$(NETCoreSdkBundledVersionsProps)" Condition="Exists('$(NETCoreSdkBundledVersionsProps)')" />

<ItemGroup Condition="'$(UseRefTargetingPacks)' == 'true'">
<KnownFrameworkReference Update="Microsoft.NETCore.App"
TargetingPackName="Microsoft.NETCore.App.Ref"
TargetingPackVersion="3.0.0-preview-27406-5"
/>
<KnownFrameworkReference Update="Microsoft.AspNetCore.App"
TargetingPackName="Microsoft.AspNetCore.App.Ref"
TargetingPackVersion="3.0.0-preview-19108-04"
/>
</ItemGroup>

<PropertyGroup>
<!-- Disable web SDK implicit package versions for ASP.NET packages, since the .NET SDK now handles that -->
<EnableWebSdkImplicitPackageVersions>false</EnableWebSdkImplicitPackageVersions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ private ResolvedVersionInfo GetResolvedVersions(TestProject testProject,
testProject.IsSdkProject = true;
testProject.IsExe = true;
testProject.AdditionalProperties["DisableImplicitFrameworkReferences"] = "true";
testProject.AdditionalProperties["UseRefTargetingPacks"] = "true";
testProject.RuntimeIdentifier = EnvironmentInfo.GetCompatibleRid(testProject.TargetFrameworks);

var testAsset = _testAssetsManager.CreateTestProject(testProject, callingMethod, identifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ public void It_excludes_runtime_store_packages_from_the_refs_folder()
System.Resources.Writer.dll
System.Runtime.CompilerServices.VisualC.dll
System.Runtime.dll
System.Runtime.CompilerServices.Unsafe.dll
System.Runtime.Extensions.dll
System.Runtime.Handles.dll
System.Runtime.InteropServices.dll
Expand Down