首页 \ 问答 \ 如何管理多次使用的Nuget包(How to manage Nuget Packages used more than once)

如何管理多次使用的Nuget包(How to manage Nuget Packages used more than once)

我是一个恐龙开发者,所以NuGet对我来说比较新,我习惯于管理第三方开源库,只有一个项目包含代码或二进制文件,我会在必要时不断更新,这个项目发布了dll(s )在一个公共文件夹上,我在所有项目中引用库。 这样可以很容易地维护第三方库,在我的项目中,我只需要在更新库时重建,一切顺利。 现在很多开源项目都在NuGet上发布它们的库,很容易在项目中引用它们,但我担心我必须为我使用它的每个项目下载一个库的副本,在我看来是可以导致混乱的东西。 特别是如果我有两个构建dll的项目最终使用相同软件包的2个不同版本,并且在具有问题和冲突的应用程序中使用。 所以我对那些长时间使用NuGet的人的问题是:我可以像其他库一样继续使用NuGet包并创建一个引用它们的项目,使用它在单个文件夹中发布dll然后引用包的dll从我的dll和已发布文件夹上的应用程序。

我希望我已经清楚了。 感谢您对Sabrina这个话题的任何想法


I am a dinosaur developer, so NuGet is relatively new to me, I am used to manage third parties open source libraries having a single project with the code or the binaries, that I will keep updated when necessary and this project publishes the dll(s) on a common folder from where I reference the libraries in all my projects. This makes easy to maintain the third party libraries and in my projects I just need to rebuild when I update the library and all goes OK. Now many open source projects publish their libraries on NuGet and it is easy to reference them in the projects, but I dread the fact that I have to download a copy of the library for each project in which I use it, this, in my opinion is something that can lead to chaos. Especially if I have 2 projects that build dlls that end up using 2 different versions of the same packages and are used both in an application with problems and conflicts. So my question to those who use NuGet from a longer time is: Can I proceed with NuGet packages as with other libraries and create a project that references them, use it to publish the dlls in a single folder and then reference the dlls of the packages from my dlls and applications on the published folder.

I hope I've been clear. Thanks for any thoughts you can share on this topic Sabrina


原文:https://stackoverflow.com/questions/40504047
更新时间:2023-09-07 17:09

最满意答案

好,我知道了:

var myData [][]interface{} = make([][]interface{}, len(resp[0].Series[0].Values))
            for i, d := range resp[0].Series[0].Values {
                myData[i] = d
            }

fmt.Println("", myData[0]) //first element in slice
fmt.Println("", myData[0][0])
fmt.Println("", myData[0][1])

输出:

[2016-10-24T00:12:12.123456Z 192.168.123.107]
2016-10-24T00:12:12.123456Z
192.168.123.107

Ok, I got it:

var myData [][]interface{} = make([][]interface{}, len(resp[0].Series[0].Values))
            for i, d := range resp[0].Series[0].Values {
                myData[i] = d
            }

fmt.Println("", myData[0]) //first element in slice
fmt.Println("", myData[0][0])
fmt.Println("", myData[0][1])

output:

[2016-10-24T00:12:12.123456Z 192.168.123.107]
2016-10-24T00:12:12.123456Z
192.168.123.107

相关问答

更多
  • 首先,我必须说:首先是配置文件。 这真的是你的代码中的瓶颈吗? 如果是这样,你有几个选择。 1)禁用边界检查。 我认为有一个没有记录的编译器标志可以检测切片边界。 尽管目前我找不到它。 (编辑: -B根据OP)。 2)用C语言(或汇编语言)编写例程,你可以为[586] c写入C并链接到你的包中(你需要包含一些来自$GOROOT/src/pkg/runtime头文件),如下所示: #include "runtime.h" mypackage·swapslice(Slice s) { int i, j; ...
  • 要确保Go不将基础字符串保留在内存中,您必须将其显式复制到新位置: func unslice(old string) string { new := make([]byte,len(old)) copy(new,old) return string(old) } SmallString := unslice(BigString[0:7]) To ensure that Go doesn't keep the underlying string in memory you will ...
  • 对你有用的不是类型断言 - 它是操作顺序。 问题的根源在于索引在指针解除引用之前。 一旦你在指针解除引用周围放置大括号,它一切正常,因为索引应用于现在解除引用的PriorityQueue实例。 您不需要为数组指针执行此操作,因为它们会自动解除引用 - 索引数组和切片之间的细微差别在此解释: Go编程语言规范 - 索引表达式 对于阵列类型A : 常量索引必须在范围内 如果x在运行时超出范围,则会发生运行时混乱 a[x]是索引x处的数组元素,而a[x]的类型是A的元素类型 对于指向数组类型的指针: a[x]是( ...
  • 这样做并不是一种“更好”的方式。 要转换切片,您必须基本上执行您已经发现的切片。 如果您只是将这些错误返回给客户端,则可能完全无需对此进行类型转换。 实现JSON Marshaler接口,您可以使您的类型自动以您希望的格式输出JSON。 例如,对于上面给出的格式,这将是: func (e BadField) MarshalJSON() ([]byte, error) { return json.Marshal([]string{"field_name",e.Field,e.Err.Error()}) ...
  • 我找到了临时解决方案 图书馆golang.org/x/crypto/bcrypt在github上有镜像。 在你的GOPATH创建文件夹src/golang.org/x/ 。 mkdir -p $GOPATH/src/golang.org/x/ 然后从github克隆加密 。 cd $GOPATH/src/golang.org/x/ git clone git@github.com:golang/crypto.git I found temporary solution. Library golang.o ...
  • 看到这里: http : //blog.golang.org/slices 简短的答案:1)它增长倍增(虽然短)。 如果你追加一次,你可能会再次追加,这会避免分配。 2)这就是切片生长的原理。 一个数组不能增长,所以分配一个新的,更大的数组,旧的数组被复制,并且你交给一个指向较大副本的切片。 (golang.org网站上的文档非常有帮助,可读性强,简短而精确。我想建议先查看golang.org,然后再问这里。) See here: http://blog.golang.org/slices Short an ...
  • http://golang.org/pkg/fmt/ fmt.Printf("address of slice %p add of Arr %p \n", &slice, &intarr) %p将打印地址。 http://golang.org/pkg/fmt/ fmt.Printf("address of slice %p add of Arr %p \n", &slice, &intarr) %p will print the address.
  • 好,我知道了: var myData [][]interface{} = make([][]interface{}, len(resp[0].Series[0].Values)) for i, d := range resp[0].Series[0].Values { myData[i] = d } fmt.Println("", myData[0]) //first element in slice fmt.Println( ...
  • 在范围声明中 for _, f := range fixtures { ... } f是一个新声明的Fixture类局部变量。 它不是任何参考 。 因此,在设置其值之后,必须将其放入fixtures片中。 package main import "fmt" type Fixture struct { Probabilities *[]float64 } func main() { fixtures := []Fixture{} f := Fixture ...
  • 这就是fmt.Println的定义。 来自https://golang.org/pkg/fmt/#Println : Println格式使用其操作数的默认格式并写入标准输出。 始终在操作数之间添加空格,并附加换行符。 它返回写入的字节数和遇到的任何写入错误。 在该页面的早期,描述默认格式: 对于复合对象,使用这些规则打印元素,递归地,如下所示: struct: {field0 field1 ...} array, slice: [elem0 elem1 ...] maps ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)