简体   繁体   English

Package 依赖时依赖于 nuget 尚未

[英]Package dependency when dependency not on nuget yet

I have a Xamarin binding, and another one which depends on the first.我有一个 Xamarin 绑定,另一个取决于第一个绑定。 In the second binding the dependency to the first requires the dependency to be published on nuget.在第二个绑定中,与第一个绑定的依赖项需要在 nuget 上发布依赖项。 However, as both are updated together, it's not possible to build the second binding without publishing the first.但是,由于两者是一起更新的,所以如果不发布第一个绑定,就不可能构建第二个绑定。

Ideally what I'd like to do is depend on the first package locally when building, but in the package .nuspec depend on the nuget package. Ideally what I'd like to do is depend on the first package locally when building, but in the package .nuspec depend on the nuget package. As the first package will be published first, when the second package is published the dependency can be satisfied.由于第一个 package 将首先发布,当第二个 package 发布时,可以满足依赖关系。 Is this possible?这可能吗?

Do they need to live apart?他们需要分开住吗? Couldn't you have both projects live in the same solution?难道你不能让两个项目都生活在同一个解决方案中吗? This way you could build them together, then package these two libraries separately afterwards.这样你就可以一起构建它们,然后再分别构建 package 这两个库。

Alternatively, you could create a local repository, which is just a folder where you put in your dependencies, and you can simply point to that folder as a NuGet repository.或者,您可以创建一个本地存储库,它只是您放入依赖项的文件夹,您可以简单地将该文件夹指向为 NuGet 存储库。 You can configure that through VS, or you can create a NuGet.config in the root of the repository and add an entry looking something like:您可以通过 VS 进行配置,或者您可以在存储库的根目录中创建 NuGet.config 并添加一个类似于以下内容的条目:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="Local Packages" value="path/on/disk" />
    </packageSources>
</configuration>

This should automatically be picked up by NuGet and it will try to restore packages from here too.这应该由 NuGet 自动获取,它也会尝试从这里恢复包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM