Невозможно упаковать мое основное приложение .net с помощью пакета nuget
Я пытаюсь скомпилировать основное приложение .net и преобразовать его в собственное приложение. Я пытаюсь скопировать выходные файлы в пакет nuget.
Я вижу следующую ошибку
NU5128: Некоторые целевые платформы, объявленные в группе зависимостей nuspec и в папке lib / ref, не имеют точных совпадений в другом месте. См. Список действий ниже:
Команда для сборки этого проекта
rem Initialize the developer environment just like a developer box. Note that 'call' keyword that ensures that the script does not exist after
rem calling the other batch file.
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64
rem Save working directory so that we can restore it back after building everything. This will make developers happy and then
rem switch to the folder this script resides in. Don't assume absolute paths because on the build host and on the dev host the locations may be different.
pushd "%~dp0"
dotnet build "%~dp0src\WindowsAuditSetting\SetACLNative.csproj" -c Release
rem Save exit code for dotnet restore.
set EX=%ERRORLEVEL%
rem Check exit code and exit with non-zero exit code so that build will fail.
if "%EX%" neq "0" (
popd
echo "Failed to build .NET Core sample correctly."
exit /b %EX%
)
dotnet publish "%~dp0src \WindowsAuditSetting\SetACLNative.csproj" -c Release --no-restore Команда, которую я выполнил, чтобы упаковать это
nuget pack -Properties Configuration=Release
Мой файл nuspec
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<title>$title$</title>
<authors>ASMDevops</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<description>$description$</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>$copyright$</copyright>
</metadata>
</package>
Мой файл csproj
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<runtimeidentifier>win-x64</runtimeidentifier>
<!-- <GeneratePackageOnBuild>true</GeneratePackageOnBuild> -->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-29408-02" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.4.0" />
</ItemGroup>
<PropertyGroup>
<PackageId>AsmScannersUtilities</PackageId>
<Version>1.0.0</Version>
<Authors>ASMDevops</Authors>
<Company>your_company</Company>
<Description>Client side scanning from Azure Security Monitoring. This package is consumed by AzSecPack</Description>
</PropertyGroup>
<Target Name="CopyPackage" AfterTargets="Publish">
<Copy SourceFiles="$(OutputPath)publish\SetACLNative.exe" DestinationFolder="$(OutputPath)..\..\AsmScanners" />
<Copy SourceFiles="$(OutputPath)publish\SetACLNative.deps.json" DestinationFolder="$(OutputPath)..\..\AsmScanners" />
<Copy SourceFiles="$(OutputPath)publish\SetACLNative.pdb" DestinationFolder="$(OutputPath)..\..\AsmScanners" />
<Copy SourceFiles="$(OutputPath)publish\SetACLNative.runtimeconfig.json" DestinationFolder="$(OutputPath)..\..\AsmScanners" />
</Target>