2 years ago

#17197

test-img

Ganu

.Net core - Nuget restore with Runtime files

I have a C# project (.Net 6 class library) that loads powershell host and executes some powershell commands. The project has "runtimes" added as part of the other package references.

enter image description here

When I reference this Powershell project as a "Project Reference" in other projects, the "runtimes" content is getting copied as Modules in the bin folder and the application is working fine enter image description here

Issue: When I package the Powershell project as Nuget package and add the project, the "runtimes" content are NOT restored as part of build and the powershell script execution fails.

What do I need to do in order for the Nuget package to restore the "runtimes"?

I tried runtime in the reference project file as mention here Include Dependency Assets and it is not working.

c#

powershell

.net-core

nuget

nuget-package-restore

0 Answers

Your Answer

Accepted video resources