Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by andriilytvynenko · Apr 11, 2019 at 07:55 AM · testinglibrariesassembliessource code

.asmdef files and Libraries with DLL files only. Source editor doesn't see any Classes.

I'm trying to use .asmdef files in my project. I put .asmdef files to all external libraries, but my source editor didn't see any library classes from libraries with DLLs only (for example Firebase).

How to resolve this issue?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Apr 11, 2019 at 11:48 AM

What do you mean by

I put .asmdef files to all external libraries


assembly definition files control the compilation of source files into seperate assemblies. If you have already compiled libraries asmdef files are pointless. Also what is your "source editor"? If you imported a third party C# assembly into your project, Visual Studio should "see" the classes defined in those already compiled assemblies. Not the source of course, but the class members, signatures of the methods, etc.


What kind of DLLs do you actually import? If it's a native code plugin (C++ / C library) you need some C# wrapping code. If it's actually a C# assembly, just make sure you set up the dependencies / references for your own assemblies correctly. So if your classes which you put in a seperate assembly (by using an asmdef file) should have access to one of the third party assemblies, you have to put that third party assembly into the references of the asmdef file.


Just think of an asmdef file as a seperate C# project that only contains some of your files. It will be compiled seperately from everything else into its own assembly. Of course you have to specify which other assemblies you depend on.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image andriilytvynenko · Apr 11, 2019 at 01:14 PM 0
Share

I will try to explain on an example: 1. Your current project has two folders: src(contain your own scripts), Text$$anonymous$$esh Pro(third-party library) 2. You added to src file .asmdef. All code in this folder will not see any class members, signatures of the methods, etc. from other folders which not have .asmdef 3. Ok, You will add .asmdef to Text$$anonymous$$esh Pro and set reference in .asmdef file in src folder and it will work.

But if a third-party library will contain only DLL files (for example Firebase) this solution will not work.

avatar image Bunny83 andriilytvynenko · Apr 11, 2019 at 04:05 PM 1
Share

You can setup two types of references in the asmdef inspector. First there are the "Assembly Definition References" so you can actually reference other assemblies that are created with asmdef files. Second there's the normal "Assembly References" where you should be able to reference any already compiled assembly (as long as the assembly is an actual managed .NET assembly). Actual native code plugins (DLLs which are not .NET assemblies but actual C++ / C native code DLLs) have to be placed inside the plugins folder. However as i said such DLLs need some sort of managed wrapper code (a class with some external declarations).


ps: It looks like Firebase does actually ship managed assemblies (or maybe they are just managed wrappers). So you should be able to setup the references you need in your own asmdef file.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

102 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Adding Game Assembly causes type or namespace errors 0 Answers

How to access Unity's preprocessor directives from a custom C# class library project? 2 Answers

"value must be greater than 0" - (Filename: Dynamics3/Cloth.cpp Line: 701) 1 Answer

Testing Network Code in Unity 4 Answers

Testing in Unity3d 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges