• 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 justice_chasmo · Feb 06, 2019 at 06:15 PM · namespace

Namespace cannot be found

hello. so i have been looking around the net for a few days so i have seen the .Net version solution but it didn't help me. So here is the problem. I have made a dll, i have a reference to the dll (FluidStudios) the reference for the dll on the server side works just fine nothing goes wrong. when i try to reference the dll on the client side i face this problem. if i use the "using FluidStudios;" that becomes the error. if i do not, all the references to this throughout the script becomes the error. and a note, VS seems to see no problems with the using, or anything but unity does not accept it. here is the code:` using System.Collections; using System.Collections.Generic; using FluidStudios; using UnityEngine; using UnityEngine.UI;

public class ClientData : MonoBehaviour {

 public static ClientData instance;
 public Network network;

 [Header("Login")]
 public Text _loginUsername;
 public Text _loginPassword;

 [Header("Registration")]
 public Text _username;
 public Text _password;
 public Text _password2;


 void Awake()
 {
     instance = this;
 }


 public void SendDataToServer(byte[] data)
 {
     FluidStudios.FluidStudios buffer = new FluidStudios.FluidStudios();
     buffer.WriteBytes(data);
     network.myStream.Write(buffer.ToArray(), 0, buffer.ToArray().Length);
     buffer = null;
 }

 public void SendAccount()
 {
     FluidStudios.FluidStudios buffer = new FluidStudios.FluidStudios();
     buffer.WriteInteger(1);

     if (_username.text == string.Empty)
     {
         Debug.Log("Please insert a username.");
         return;
     }

     if (_password.text == string.Empty)
     {
         Debug.Log("Please insert a password.");
         return;
     }

     if (_password2.text != _password.text)
     {
         Debug.Log("Your password do not match.");
         return;
     }

     buffer.WriteString(_username.text);
     buffer.WriteString(_password.text);

     SendDataToServer(buffer.ToArray());
     buffer = null;
 }

 public void SendLogin()
 {
     FluidStudios.FluidStudios buffer = new FluidStudios.FluidStudios();
     buffer.WriteInteger(2);

     if (_loginUsername.text == string.Empty)
     {
         Debug.Log("Please insert a username.");
         return;
     }

     if (_loginPassword.text == string.Empty)
     {
         Debug.Log("Please insert a password.");
         return;
     }

     buffer.WriteString(_loginUsername.text);
     buffer.WriteString(_loginPassword.text);

     SendDataToServer(buffer.ToArray());
     buffer = null;
 }

} `

Comment
Add comment · Show 1
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 Casiell · Feb 06, 2019 at 10:59 PM 0
Share

Do you have your .dll in Assets folder? Any subfolder of Assets will do, but it has to be included in a project.

If that doesn't work, you may want to check this steps, never used them myself, but they are in accepted answer, so they must've worked for someone: https://answers.unity.com/questions/333829/including-a-dll-in-unity.html

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Bunny83 · Feb 07, 2019 at 01:01 AM

You can not "reference" an external DLL in Unity. Unity does not use or build on top of the .NET framework like normal .NET applications do. Unity uses it's own framework which is shipped with your build. If you have a DLL you want to use in your Unity game you have to physically copy it into your Assets folder. Note that if that DLL has other dependencies they need to be copied as well.


You can not "add references" in the C# project as the project files are only generated for IDE support. The project file and its settings are not used by Unity. Unity "manually" compiles your scripts by directly invoking the compiler


Note: Not all DLLs can be used inside a Unity project. Which DLLs can be used highly depends on your targetplatform and which scripting backend is used.

Comment
Add comment · Show 1 · 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 justice_chasmo · Feb 07, 2019 at 01:37 AM 0
Share

so i don't know enough of network program$$anonymous$$g to be able to answer anything in your note. but the rest i absolutly thank you for! i will try and copy in the dll and hope it still work with the server scripts i am working with outside unity (since i am trying to make my own server so i dont have to use the old Network API's in unity and not use their google partnership) so thank you for your response :)

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

100 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

Related Questions

C# Visual Basic Error 1 Answer

the type or namespace name Note could not be found. are you missing a using directive or an assembly reference. 0 Answers

Missing namespaces with A* Pathfinder Pro 2 Answers

Trying to access the Slider component 1 Answer

"using UnityEditor;" throws an error? 1 Answer


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