• 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 $$anonymous$$ · Nov 26, 2012 at 07:34 PM · c#dllnamespace

'The type or namespace name could not be found'

Hey all,

I have a bit of a problem which I've just starred myself blind at.

First of all, don't make too much of the silly names in my current scripts and DLLs :P It is simply a quick demo to explain what is wrong.

Anyways,

I've compiled my own DLL from MonoDevelop with one simple class in it. The class is called MyClass I've placed the class in a namespace called mao. In the MonoDevelop assembly browser, you can see the structure clearly: alt text

Now the problem is that when I then reference this namespace from within the lol.cs script like this:

 using mao;

using mao; I can easily compile the code from within MonoDevelop and no error is raised at all.

But when I hit the play test button from the unity editor I am presented with the following error:

Assets/Scripts/lol.cs(3,7): error CS0246: The type or namespace name `mao' could not be found. Are you missing a using directive or an assembly reference?

And I have no clue as to why this is happening.

Any help or tip would be appriciated :)

Thank you for your time! :)

assemblybrowsermao.png (41.3 kB)
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
1
Best Answer

Answer by Landern · Nov 26, 2012 at 07:48 PM

Is the built assembly(dll) in the plugin folder in the inspector?

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 $$anonymous$$ · Nov 26, 2012 at 07:51 PM 0
Share

Aha! This did the trick, thank you so much for the help :) Could you describe exactly why it is that unity require the DLL to be included through the inspector? Is it simply the way that Unity compiles and links projects that requires it to be referenced through Unity rather than strictly through $$anonymous$$onoDevelop?

avatar image Landern · Nov 26, 2012 at 08:44 PM 0
Share

First you may want to check out the documentation(http://docs.unity3d.com/Documentation/$$anonymous$$anual/UsingDLL.html).

From what I gather this is just how its done, i don't think it does a typical visual studio linkage from monodevelop. But that's just a guess. Putting it into the project allows unity to be aware of the assembly. solution files and project files from mono or VS are for the convenience of the user using said IDE's for development. Deleting them doesn't hurt unity's ability to build the project from my experience.

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

10 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

Related Questions

Distribute terrain in zones 3 Answers

Using DLLS in a Webplayer 0 Answers

Multiple Cars not working 1 Answer

Using C# .dll that doesn't use namespaces 0 Answers

Sending and receiving variable-length arrays to and from DLL 0 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