Skip to content

Build should not show the "Does not support publish of C++/CLI projec… #12333

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 1 commit into from
Apr 7, 2023

Conversation

zgabi
Copy link
Contributor

@zgabi zgabi commented Jul 3, 2020

…t targeting dotnet core" error message when IsPublishable is false

When building & publishing a whole solution which contains a C++/CLI project, the publish shows the following error message:
C:\Program Files\dotnet\sdk\3.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(1048,5): error NETSDK1117: Does not support publish of C++/CLI project targeting dotnet core. [C:\XXX\YYY.vcxproj]

If you set the IsPublishable property to false, the error is still shown.

In my opinion this should be checked only when the project will be published here:

<Target Name="Publish"
Condition="$(IsPublishable) == 'true'"
DependsOnTargets="_PublishBuildAlternative;_PublishNoBuildAlternative" >

…t targeting dotnet core" error message when IsPublishable is false

When building & publishing a whole solution which contains a C++/CLI project, the publish shows the following error message:
C:\Program Files\dotnet\sdk\3.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(1048,5): error NETSDK1117: Does not support publish of C++/CLI project targeting dotnet core. [C:\XXX\YYY.vcxproj]

If you set the IsPublishable property to false, the error is still shown.

In my opinion this should be checked only when the project will be published here:
https://github.com/dotnet/sdk/blob/d9186282b30574e1de24939aa32b615e19c084a7/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets#L63-L65
@marcpopMSFT marcpopMSFT requested a review from wli3 July 15, 2020 21:43
@wli3
Copy link

wli3 commented Jul 16, 2020

@zgabi could you add tests?

@zgabi
Copy link
Contributor Author

zgabi commented Jul 16, 2020

Sorry, I don't know how to do that.

@marcpopMSFT
Copy link
Member

We're heads down at the moment on the .NET 5 release. @wli3 will get back to you later with details on writing a test.

@marcpopMSFT
Copy link
Member

@wli3 reminder to take a look as we're close to finishing up 5.0

@wli3
Copy link

wli3 commented Oct 14, 2020

I realize this PR is blocked by #11008

currently we disabled C++/CLI tests. But before we adding new features, we should re-enable them

@zgabi
Copy link
Contributor Author

zgabi commented Oct 18, 2020

Ok, but as you can see this is a quite trivial, very simple change. And very logical... do not show an error message about a not supported publishing when the project won't be published anyway. (The same IsPublishable variable is checked in the Publish target)

I already found a workaround for this bug, so for me it is not so important to fix it, howerver I'd be happy if you could include this fix in one of the next releases, so I could remove my workaround from our project.

Base automatically changed from master to main March 18, 2021 21:05
@marcpopMSFT
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@marcpopMSFT
Copy link
Member

We're starting to do a pass over old PRs (time permitting). For this change, it is not possible to have a test for it as any cppcli project that enables PackageReference support would not show the original error and we can't test non-PackageReference cppcli projects as they would fail once the installed runtime and implicit runtime don't match (because the targeting pack automatic download is enabled through that mechanism). Sorry for the long delay and thanks for the contribution. I tested the change locally and it works as expected.

@marcpopMSFT marcpopMSFT enabled auto-merge March 23, 2023 20:37
@marcpopMSFT
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@marcpopMSFT marcpopMSFT merged commit 15dd3db into dotnet:main Apr 7, 2023
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.

3 participants