Skip to content
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

Add container publish pubxml #26506

Merged
merged 4 commits into from
Jul 12, 2022
Merged

Add container publish pubxml #26506

merged 4 commits into from
Jul 12, 2022

Conversation

benvillalobos
Copy link
Member

@benvillalobos benvillalobos commented Jul 11, 2022

Todo:

  • Build SDK locally and, in dogfood environment, build container repo with Container publish profile to verify that things hook up

@benvillalobos
Copy link
Member Author

I might be missing something with testing locally.

I run:

build.cmd
eng\dogfood.cmd
navigate to separate project
dotnet publish .\foo.csproj -p:PublishProfile=Container /bl
and no ...Sdk.Publish.Container.targets gets imported

The project is just some csproj that targets net7.0 and does nothing special, so I'm likely missing something

@vijayrkn
Copy link
Contributor

I might be missing something with testing locally.

I run:

build.cmd eng\dogfood.cmd navigate to separate project dotnet publish .\foo.csproj -p:PublishProfile=Container /bl and no ...Sdk.Publish.Container.targets gets imported

The project is just some csproj that targets net7.0 and does nothing special, so I'm likely missing something

Is the project a websdk project?

@rainersigwald
Copy link
Member

Is the project a websdk project?

I think that was it; I got it to "work" (read "break how I expect it to") with a webapi project:

dotnet publish -p:PublishProfile=DefaultContainer
MSBuild version 17.4.0-preview-22358-02+62b690b29 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
S:\sdk\artifacts\bin\redist\Debug\dotnet\sdk\7.0.100-dev\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(219,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [S:\play\webapi\webapi.csproj]
  webapi -> S:\play\webapi\bin\Debug\net7.0\webapi.dll
  webapi -> S:\play\webapi\bin\Debug\net7.0\publish\
S:\sdk\artifacts\bin\redist\Debug\dotnet\sdk\7.0.100-dev\Sdks\Microsoft.NET.Sdk.Publish\targets\DotNetCLIToolTargets\Microsoft.NET.Sdk.DotNetCLITool.targets(104,11): error MSB4057: The target "PublishContainer" does not exist in the project. [S:\play\webapi\webapi.csproj]

@benvillalobos
Copy link
Member Author

Is the project a websdk project?

It was not :) I got it to repro as well

PS C:\src\temp\webtargetsidk\idk2> dotnet publish -p:PublishProfile=DefaultContainer
...
C:\src\sdk\artifacts\bin\redist\Debug\dotnet\sdk\7.0.100-dev\Sdks\Microsoft.NET.Sdk.Publish\targets\DotNetCLIToolTarget
s\Microsoft.NET.Sdk.DotNetCLITool.targets(104,11): error MSB4057: The target "PublishContainer" does not exist in the p
roject. [C:\src\temp\webtargetsidk\idk2\idk2.csproj]

With the expected failure, PublishContainer will exist in the container targets here: https://github.com/rainersigwald/containers/pull/18/files#diff-2bd6ed960e3600bb0274b117cdb4e7bb858f1a20baeecefcdb9b6b45aefcf6b9R51

@marcpopMSFT marcpopMSFT merged commit c2186d2 into main Jul 12, 2022
@marcpopMSFT marcpopMSFT deleted the BenVillalobos-patch-3 branch July 12, 2022 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants