Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

nuget content/contentfiles are duplicated in nested nuget package

$
0
0

I have 3 projects which are nested in each other.

  1. HtAlarms.Common

    • Has a configuration file HtAlarms.config
    • A nuget package is created from this: HtAlarms.Common.nuget
  2. HtOpc.Alarms

    • Contains the HtAlarms.Common.nuget package
    • A nuget package is created from this: HtOpc.Alarms.nuget
      • HtAlarms.config is wrongly included in the nuget-package!
  3. HtServer.ServerTemplate
    • Contains the HtOpc.Alarms.nuget package

      - HtAlarms.config is wrongly included in the root directory!

HtAlarms.Common has the following directory structure:

+-- Config
|   +-- NLog
|   |   +-- HtAlarms.config

enter image description here

enter image description here

HtAlarms.Common.csproj

...
  <ItemGroup>
    <Content Include="Config\NLog\HtAlarms.config">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
...

HtOPC.Alarms has the following directory structure:

+-- Config
|   +-- NLog
|   |   +-- HtAlarms.config

enter image description here

enter image description here

HtOPC.Alarms.csproj

...
  <ItemGroup>
    <PackageReference Include="HtAlarms.Common" Version="6.0.0-fix-htalarms-config.68" />
  </ItemGroup>
...

But the nuget package has already a duplicate!?

enter image description here


HtServer.ServerTemplate has the following directory structure:

+-- Config
|   +-- NLog
|   |   +-- HtAlarms.config
+-- HtAlarms.config

enter image description here

enter image description here

HtAlarms.Common.nuget installs Config/NLog/HtAlarms.config - Right

HtOPC.Alarms.nuget installs HtAlarms.config - Wrong

Also CopyToOutputDirectory is false. Should be true.

Someone can tell me what's wrong here? Thanks!!


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>