Skip to content

Publishing standalone app (C#) fails with C++/CLI dependency #12345

Open
@chrisbardon

Description

@chrisbardon

I'm trying to port a WPF app (C#) to core 3.1, but it has a dependency on a C++/CLI managed wrapper on an unmanaged DLL. The dependency works, and I can build/run and publish as Framework Dependent, but I get a failure when I try to publish self contained. The error that I get in VS 16.5.4 is:

Publish has encountered an error.
Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.

And the .tmp file it generates tells me:

4/21/2020 8:58:07 PM
System.AggregateException: One or more errors occurred. ---> System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. <---

System.Exception: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.

Which is not helpful... The publish output however, had this buried in it:

3>Task "NETSdkError" skipped, due to false condition; ('$(Language)' == 'C++' and $(EnableComHosting) == 'true') was evaluated as ('C++' == 'C++' and == 'true').
3>Using "NETSdkError" task from assembly "C:\Program Files\dotnet\sdk\3.1.201\Sdks\Microsoft.NET.Sdk\targets..\tools\net472/Microsoft.NET.Build.Tasks.dll".
3>C++/CLI projects targeting .NET Core cannot use SelfContained=true.
3>Building with tools version "Current".

That implies that there's no way to build this as a self contained application, which was part of the motivation for going to .net core with this app in the first place (zero dependency deployment). Is there a way to get this to work, or is it a bug?

Metadata

Metadata

Assignees

Labels

Area-NetSDKFor considerationUsed for items on the backlog to raise them to the top of that list for discussion

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions