自动添加 Xamarin Forms PCL 中的所有 dll

编程入门 行业动态 更新时间:2024-10-19 22:24:56
本文介绍了自动添加 Xamarin Forms PCL 中的所有 dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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

I am trying to create a Nuget Package - I followed these steps https://developer.xamarin/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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-24 17:35:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1068502.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Forms   Xamarin   dll   PCL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!