从Java应用程序中安装和访问Nuget软件包中的类
我创建了一个Nuget软件包(.NET标准2.0和.NET Framework 4.8-兼容性),我想知道是否可以从Java应用程序访问。
I have created a NuGet package (.Net standard 2.0 and .Net Framework 4.8 - compatibility) that I would like to know if it is possible to access from a Java application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Nuget是.NET中使用的包装格式。不在爪哇。 Java为此而受苦。
因此,没有简单的方法(或我建议的任何方法)可以轻松地使用Java中的代码。
但是,如果您确实需要使用软件包中的方法,则可以尝试执行以下操作:
基本上您应该能够调用DLL中定义的方法。您可以在.NET中做类似的事情。可以采用DLL,并从.NET知道方法签名中称其为.NET。它被称为
”请注意,Nuget软件包实际上是一个ZIP存储库。您可以使用任何ZIP工具打开它,可以将其提取并使用dotnet命令编译代码。
Nuget is a package format that is used in .NET. Not in Java. Java has Maven for that.
So there is no simple way (or any way I could recommend) to use the code easily in Java.
But if you really need to use the methods you have in the package, you can try to do the following:
Basically you should be able to call the methods defined in your DLL. Similar thing you can do in .NET. It is possible to take a dll, and call it's methods from .NET knowing the method signature. It is called Interoperability
Also please note that the nuget package is a zip repository in fact. You can open it using any zip tool, you can extract it and compile the code with dotnet command.