Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Nuget Package in UPM Package and Assembly definition

Discussion in 'Package Manager' started by bcwbbrj, May 30, 2023.

  1. bcwbbrj

    bcwbbrj

    Joined:
    Dec 26, 2022
    Posts:
    8
    So I'm currently trying to make a UPM Package that contains some Nuget packages (currently imported as Dlls) and I have some questions that I'm not so sure of

    1. How to include Nuget package in package.json? Can I just include them like other UPM packages? For example

    "dependencies": { "Grpc.Core": "x.x.x" }


    2. Is there any tutorial on how to write the asmdef file? I'm not quite sure which scripts I should include & how to include them in the asmdef file.

    Thanks in advance!
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    Hmmm what makes you think that Nuget will work with Package Manager?
    PM uses its own registry. You can add more. Maybe that‘s all there is to it? I doubt it though because Nuget and PM are separate systems.
    And since those registries are defined on the project level (manifest.json if i remember correctly) this may not satisfy your needs.
    See https://docs.unity3d.com/Manual/upm-scoped.html

    As to asmdef: you don‘t write it yourself (though you could), it‘s an asset with an Inspector GUI. And you don‘t include scripts in it, only assemblies. I would advise reading the manual first. There isn‘t much need for a tutorial there.
     
  3. bcwbbrj

    bcwbbrj

    Joined:
    Dec 26, 2022
    Posts:
    8
    Thanks for the info! So this means the only way to use the Nuget packages is to put the dll files in some folders?
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899