自动添加 Xamarin Forms PCL 中的所有 dll [英] Automatically add all the dll in Xamarin Forms PCL

查看:30
本文介绍了自动添加 Xamarin Forms PCL 中的所有 dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建 Nuget 包 - 我按照以下步骤操作 https://developer.xamarin.com/guides/cross-platform/advanced/nuget/

I am trying to create a Nuget Package - I followed these steps https://developer.xamarin.com/guides/cross-platform/advanced/nuget/

有没有办法用任何可用的命令自动生成这个标签来创建 nuspec 文件

Is there a way to automatically generate this tag with any available command to create a nuspec file

谢谢

推荐答案

有命令nuget spec".它只是创建空模板.

There is the command "nuget spec". It just creates empty template.

您的 nuspec 文件可能如下所示:

Your nuspec file could look like this:

<?xml version="1.0"?>
<package >
  <metadata>
    <id>Your ID</id>
    <version>0.0.1</version>
    <authors>Whatever name</authors>
    <owners>Wahtever name</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Blah blah</description>
    <releaseNotes></releaseNotes>
    <copyright>Copyright 2017</copyright>
    <tags></tags>
    <dependencies>
      <group targetFramework="portable-net45+win+wpa81+wp80">
        <!-- Your nuget packages dependencies -->
      </group>
      <group targetFramework="MonoAndroid10">
        <!-- Your nuget packages dependencies -->
      </group>
      <group targetFramework="Xamarin.iOS10">
        <!-- Your nuget packages dependencies -->
      </group>
      <group targetFramework="uap">
        <!-- Your nuget packages dependencies -->
      </group>
    </dependencies>
  </metadata>
    <files>
     <!--Portable-->
     <file src="..\YourProjectName\Plugin.YourProjectName\bin\Release\Plugin.YourProjectName.*" target="lib\portable-net45+win+wpa81+wp80" />

     <!--Xamarin.Android-->
     <file src="..\YourProjectName\Plugin.YourProjectName.Android\bin\Release\Plugin.YourProjectName.*" target="lib\MonoAndroid10" />

     <!--Xamarin.iOS-->
     <file src="..\YourProjectName\Plugin.YourProjectName.iOS\bin\iPhone\Release\Plugin.YourProjectName.*" target="lib\Xamarin.iOS10" />

     <!--UWP-->
     <file src="..\YourProjectName\Plugin.YourProjectName.UWP\bin\Release\Plugin.YourProjectName.*" target="lib\UAP10" />
  </files>
</package>

有适用于 Visual Studio 2015 的模板此处.作为参考,您可以关注此项目.

There is template for Visual Studio 2015 here. As a reference you can follow this project.

如果您不需要为 iOS、Android 或 UWP 编写任何特定于平台的代码,请在 Visual Studio 2017 .NET 标准类库目标框架 .NET Standard 1.4 中创建.

In case that you don't need to write any platform specific code for iOS, Android or UWP create in Visual Studio 2017 .NET standard class library targeting framework .NET Standard 1.4.

打开项目属性并更改目标框架.然后在Package"选项卡中选中Generate Nuget package on build".

Open project properties and change target framework. Then in the tab "Package" check "Generate Nuget package on build".

这篇关于自动添加 Xamarin Forms PCL 中的所有 dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆