简体   繁体   English

.NET 自定义依赖项(无 nuget)

[英].NET custom dependencies (no nuget)

So, I'm having trouble adding a git project to my net Core solution, and after spending hours trying to figure this out and being uncapable of finding a solution online, I decided to ask here.因此,我在将 git 项目添加到我的net Core解决方案时遇到了麻烦,在花了几个小时试图解决这个问题并且无法在线找到解决方案之后,我决定在这里提问。

I have a forked github repo ( link ) in which I modified some files to suit my needs, but I simply can't seem to get it to work with my current project.我有一个分叉的 github 存储库(链接),我在其中修改了一些文件以满足我的需要,但我似乎无法让它与我当前的项目一起使用。

The problem I'm having is that normally, when I want a package for a .NET project, I usually simply go to nuget and fetch the necessary dependencies. The problem I'm having is that normally, when I want a package for a .NET project, I usually simply go to nuget and fetch the necessary dependencies. This is usually very simple and straight forward.这通常非常简单直接。 But now that I have these modified files, I'm unsure on how to proceed.但是现在我有了这些修改过的文件,我不确定如何继续。

I have tried adding it as a submodule, but after I built the project, I got an exception saying that the dll could not be found.我曾尝试将其添加为子模块,但在构建项目后,我收到一个异常,提示找不到 dll。 Then I've tried adding the dll itself as a reference, but the ImGui.dll depends on a C dll which couldn't be found then (nor added to the project). Then I've tried adding the dll itself as a reference, but the ImGui.dll depends on a C dll which couldn't be found then (nor added to the project). Finally, I've tried adding the csproj as a project of my solution, but that didn't work either最后,我尝试将 csproj 添加为我的解决方案的项目,但这也不起作用

Do you know what am I doing wrong here?你知道我在这里做错了什么吗? Am I missing a key piece or is it just something obvious I'm not seeing?我错过了一个关键部分还是只是我没有看到的明显的东西? It can't be this hard to get it to work让它发挥作用并不难

From the look of it, that repository produces a DLL (output type Class Library).从外观上看,该存储库生成 DLL(输出类型 Class 库)。 So modify it to your liking, and use the sample program build (ImGui.NET.SampleProgram) to test your changes.因此,根据您的喜好对其进行修改,并使用示例程序构建 (ImGui.NET.SampleProgram) 来测试您的更改。 Once you're happy, build the DLL project (ImGui.NET) and use the resulting DLL as a Reference in your own app.满意后,构建 DLL 项目 (ImGui.NET) 并在您自己的应用程序中使用生成的 DLL 作为参考。

In Visual Studio:在 Visual Studio 中:

Solution Explorer>YourApp>References>Right Click>Add Reference...>Locate your DLL

This means you should also keep track of your modifications to the ImGui.NET project itself, since you may/will be required to maintain this in the future.这意味着您还应该跟踪对 ImGui.NET 项目本身的修改,因为将来您可能/将需要维护它。

Hope this gets you started -- update your question with more specific issues once you're underway.希望这能让你开始——一旦你开始,用更具体的问题更新你的问题。

Edit:编辑:

Like @CoolBots mentions, I probably misread your question.就像@CoolBots 提到的那样,我可能误读了你的问题。 Seems like the build depends on cimgui.dll , which you can hotlink from the ImGui repo along with your custom DLL.似乎构建取决于cimgui.dll ,您可以从 ImGui 存储库进行热链接以及自定义 DLL。 In fact, the demo app is using cimgui.dll , cimgui.dylib and cimgui.so .事实上,演示应用程序正在使用cimgui.dllcimgui.dylibcimgui.so Regardless of linking method, you want the files to copy into your build folder.无论使用哪种链接方法,您都希望将文件复制到您的构建文件夹中。 I don't believe subfolder /bin is necessary.我不相信子文件夹/bin是必要的。

You can find all the cimgui dependencies for various operating systems in the ~/ImGui.NET/deps/cimgui folder.您可以在~/ImGui.NET/deps/cimgui文件夹中找到各种操作系统的所有 cimgui 依赖项。

The demo also utilizes NuGet packages Velrid and Velrid.StartupUtilities .该演示还利用 NuGet 包VelridVelrid.StartupUtilities

Depending on your own codebase, you may or may not require these NuGet packages along with the aforementioned class library.根据您自己的代码库,您可能需要也可能不需要这些 NuGet 包以及上述 class 库。

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

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