NetMF Nuget Package

I try use nuget package to manage libraries I done for netmf.
When I try to create package I must put pe file in /le/le (note double le) directory. Is a way to put it simply on /le ?

Here Is my nuspec file:


<?xml version="1.0"?>
<package >
  <metadata>
    <id>Bauland.NetMF.I2CScanner</id>
    <version>4.3.8.1</version>
    <title>I2CScanner</title>
    <authors>Nicolas Bauland</authors>
    <owners>Nicolas Bauland</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Function to scan i2c bus</description>
    <releaseNotes>Initial release of the package.</releaseNotes>
    <copyright>Copyright 2017</copyright>
    <tags>I2C NETMF</tags>
  </metadata>
  <files>
  <file src="bin\debug\I2CScanner.dll" target="lib\netmf43\I2CScanner.dll"/>
  <file src="bin\debug\le\I2CScanner.dll" target="lib\netmf43\le\I2CScanner.dll"/>
  <file src="bin\debug\be\I2CScanner.dll" target="lib\netmf43\be\I2CScanner.dll"/>
  <file src="bin\debug\le\I2CScanner.pe" target="lib\netmf43\le\le\I2CScanner.pe"/>
  <file src="bin\debug\le\I2CScanner.pdb" target="lib\netmf43\le\le\I2CScanner.pdb"/>
  <file src="bin\debug\le\I2CScanner.pdbx" target="lib\netmf43\le\le\I2CScanner.pdbx"/>
  <file src="bin\debug\be\I2CScanner.pdb" target="lib\netmf43\le\be\I2CScanner.pdb"/>
  <file src="bin\debug\be\I2CScanner.pdbx" target="lib\netmf43\le\be\I2CScanner.pdbx"/>
  <file src="bin\debug\be\I2CScanner.pe" target="lib\netmf43\le\be\I2CScanner.pe"/>
  </files>
</package>

It’s the first for me I create a nuget package (I hope not the last !)

2 Likes

@ Bauland - When you add a reference to the NuGet package, where is Visual Studio taking the reference from? “lib\netmf43\I2CScanner.dll” or “lib\netmf43\le\I2CScanner.dll”? If it’s the latter, that is why you need the second le folder.

You do not need to include the dlls under le and be. The below should be enough. You also don’t need to include the pdb in your nuget package. If you want to enable debugging, take a look at Creating legacy symbol packages (.symbols.nupkg) | Microsoft Learn


<file src="bin\debug\I2CScanner.dll" target="lib\netmf43\I2CScanner.dll" />
<file src="bin\debug\le\I2CScanner.pe" target="lib\netmf43\le\I2CScanner.pe" />
<file src="bin\debug\le\I2CScanner.pdbx" target="lib\netmf43\le\I2CScanner.pdbx" />
<file src="bin\debug\be\I2CScanner.pe" target="lib\netmf43\be\I2CScanner.pe" />
<file src="bin\debug\be\I2CScanner.pdbx" target="lib\netmf43\be\I2CScanner.pdbx" />

3 Likes

Yes, it is enough, thanks you !!! And it’s smaller.

:clap: :clap: :clap:

There is a good tool to create Nuget.
Nuget Package Explorer
https://github.com/NuGetPackageExplorer/NuGetPackageExplorer
I use it for my MicroToolsKit library.
NuGet Gallery | WEBGE.Microtoolskit 1.4.5.2