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

Hack 2 from StackOverflow #1

Open
UncleFirefox opened this issue Sep 19, 2017 · 7 comments
Open

Hack 2 from StackOverflow #1

UncleFirefox opened this issue Sep 19, 2017 · 7 comments

Comments

@UncleFirefox
Copy link

UncleFirefox commented Sep 19, 2017

Hi, I'm trying hack 2 from your answer on stack overflow using:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
    <PackageId>Aeron.Client</PackageId>
    <Version>1.4.1.0</Version>
    <Authors>Adaptive Financial Consulting Ltd.</Authors>
    <Company>Adaptive Financial Consulting Ltd.</Company>
    <Product>Aeron Client</Product>
    <Copyright>Copyright 2017</Copyright>
    <PackageLicenseUrl>https://github.com/AdaptiveConsulting/Aeron/blob/master/LICENSE</PackageLicenseUrl>
    <PackageProjectUrl>https://github.com/AdaptiveConsulting/Aeron/</PackageProjectUrl>
    <PackageIconUrl>https://raw.githubusercontent.com/AdaptiveConsulting/Aeron.NET/master/images/adaptive.png</PackageIconUrl>
    <Description>Efficient reliable UDP unicast, UDP multicast, and IPC transport protocol.</Description>
    <PackageTags>aeron client messaging networking transport udp ipc</PackageTags>
    <PackageReleaseNotes>https://github.com/real-logic/aeron/wiki/Change-Log</PackageReleaseNotes>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
  </PropertyGroup>
  
  <ItemGroup>
    <ProjectReference Include="..\Adaptive.Agrona\Adaptive.Agrona.csproj" PrivateAssets="All" />
  </ItemGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
    <_PackageFiles Include="$(OutputPath)\Adaptive.Agrona.dll">
      <BuildAction>None</BuildAction>
      <PackagePath>lib\net452\</PackagePath>
    </_PackageFiles>
  </ItemGroup>

  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
    <_PackageFiles Include="$(OutputPath)\Adaptive.Agrona.dll">
      <BuildAction>None</BuildAction>
      <PackagePath>lib\netstandard2.0\</PackagePath>
    </_PackageFiles>
  </ItemGroup>

</Project>

Project is very simple but it doesn't copy Adaptive.Agrona.dll into the pkg, any ideas on why it's failing?

@dasMulli
Copy link
Owner

dasMulli commented Sep 19, 2017

I think I can revise it to something much more simple for the 2.0.0 tooling:

<Project>
  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;netstandard1.6</TargetFrameworks>
    <TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);IncludeP2PAssets</TargetsForTfmSpecificBuildOutput>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\testprivatelib\testprivatelib.csproj" PrivateAssets="All" />
  </ItemGroup>

  <Target Name="IncludeP2PAssets">
    <ItemGroup>
      <BuildOutputInPackage Include="$(OutputPath)\testprivatelib.dll" />
    </ItemGroup>
  </Target>
</Project>

@dasMulli
Copy link
Owner

let me know if this works for you

@sonudavidson
Copy link

Hi,
I updated the target framework to frameworks like this way
netstandard1.4;net471
Added the same line in all the 3 projects,

While building the solution, I get the following error,

error NU5019: File not found: 'bin\Debug\LibA.dll'

Looks like a similar change, Couldn't figure out the reason.
Looking for some help.

Thanks!

@dasMulli
Copy link
Owner

dasMulli commented Oct 1, 2019

@sonudavidson did you start with one of the code snippets in this thread? if so, which?

@sonudavidson
Copy link

@dasMulli Thanks for the reply. It was my mistake. I was able to solve it. Although I have another issue, Sometimes, the values from .csproj file are not referenced properly in NuSpec. Do you also see this issue?

@dasMulli
Copy link
Owner

dasMulli commented Oct 2, 2019

There are two ways of packing a nuspec. packing the nuspec and referencing the nuspec from a csproj for dotnet pack. First one doesn't really work with .net core projects, second one also requires you to construct the set of variables for the nuspec inside the csproj.
I usually recommend not using either of them and maxing out what can be done with csproj alone. There are only a few things that cannot be done in csproj (e.g. reference groups for packages.config base projects)

@sonudavidson
Copy link

Yeah, I agree. I took off the part where the values must be referenced from .csproj. Nuspec now works.

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

No branches or pull requests

3 participants