Skip to content

[WIP NO MERGE]: Add support for RuntimeFrameworkName to add an additional implicit package ref for ASP.NET Core 2.1 projects #2404

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

Closed

Conversation

natemcmaster
Copy link
Contributor

@natemcmaster natemcmaster commented Jul 17, 2018

Part of dotnet/aspnetcore#3307

An alternative to #2394, which doesn't require changes to runtime packages and keeps the baseline for ASP.NET Core at 2.1.1 (which is the baseline in the 2.1.301 SDK).

Changes:

  • Introduce a new property, RuntimeFrameworkName, which defines an additional implicit package reference added when targeting .NET Core. The default platform package, Microsoft.NETCore.App, is still always referenced
  • Add information about the default implicit version to use for ASP.NET Core metapackages to use (when selected as the runtime framework)
  • Fail the build if an unrecognized value for RuntimeFrameworkName is specified in a .NET Core project.
  • Add a warning when the project contains an explicit PackageReference to AspNetCore.All/App

Nate McMaster added 2 commits July 17, 2018 09:10
When set by the project, this property adds an additional PackageReference to Microsoft.AspNetCore.App/All
which behaves like Microsoft.NETCore.App. It is the recommended replacement for the versionless PackageReference, which
only worked when using Microsoft.NET.Sdk.Web.

See dotnet/aspnetcore#3307
@natemcmaster
Copy link
Contributor Author

xlf regeneration appeared to mess up Strings.ru.xlf. Does this require manual fixup for some reason?

@nguerrera
Copy link
Contributor

No manual fixup of xlf should be required. That would be an xliff-tasks bug. I'll investigate.

@nguerrera
Copy link
Contributor

nguerrera commented Jul 17, 2018

Not sure what happened to strings.ru.xlf. I've never seen that before. It's behaving as though it didn't think the file already had content.

I'm not sure how to repro it either. I have a feeling the following would solve it, but then we'd lose our repro :(

  1. Revert 9bcb413
  2. git clean -fdx (careful!)
  3. build

Given a bunch of things under time pressure in parallel today, I think we should try that. Can you back up your bin/obj directory somewhere first, so that I can take a look for any clues left behind by the bad update.

Nate McMaster added 2 commits July 17, 2018 12:23
@natemcmaster
Copy link
Contributor Author

Ok, I think the xlf files are correct now.

When I ran build.cmd the first time while preparing this PR, UpdateXlf failed. I wondered if this might be related to corruption of Strings.ru.xlf, but the error said the issue was with Strings.es.xlf.

C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018: The "UpdateXlf" task failed unexpectedly. [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018: System.IO.IOException: The process cannot access the file 'C:\dev\dotnet\sdk\src\Tasks\Common\Resources\xlf\Strings.es.xlf' because it is being used by another process. [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018:    at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018:    at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018:    at XliffTasks.Model.Document.Load(String path) in /_/src/XliffTasks/Model/Document.cs:line 31 [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018:    at XliffTasks.Tasks.XlfTask.LoadXlfDocument(String path, String language, Boolean createIfNonExistent) in /_/src/XliffTasks/Tasks/XlfTask.cs:line 67 [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018:    at XliffTasks.Tasks.UpdateXlf.ExecuteCore() in /_/src/XliffTasks/Tasks/UpdateXlf.cs:line 37 [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018:    at XliffTasks.Tasks.XlfTask.Execute() in /_/src/XliffTasks/Tasks/XlfTask.cs:line 19 [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]
C:\Users\namc\.nuget\packages\xlifftasks\0.2.0-beta-62730-03\build\XliffTasks.targets(91,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [C:\dev\dotnet\sdk\src\Tests\Microsoft.NET.Publish.Tests\Microsoft.NET.Publish.Tests.csproj]

@nguerrera
Copy link
Contributor

I think that access issue is a bug that was fixed in xliff-tasks, I'll check if we're not on latest

Therefore, this uses the same property fro both implicit package references.
-->
<Choose>
<When Condition=" '$(RuntimeFrameworkName)' == 'Microsoft.AspNetCore.All' " >
Copy link
Contributor

@nguerrera nguerrera Jul 17, 2018

Choose a reason for hiding this comment

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

I understood the rationale for why we can have just one property is that we will align the versions of these shared frameworks. It makes me wonder why we have separate logic for setting the version of each of them here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Presumably because when we have the core shared framework, the baseline is still 2.1.0, but we've already set the precedent of a different baseline of 2.1.1 for ASP.NET?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, that's why. I only added the separate properties because aspnetcore's baseline is 2.1.1 (for now.)

@natemcmaster
Copy link
Contributor Author

Per conversation in person, we are no longer pursuing this fix in 2.1.4xx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants