- Home /
Assembly-CSharp as Default Class Library for Scripts?
So i'm new to Unity and I have a question about the Libraries for created scripts.
When I make a new script, I find that this is under a Class Library in Visual Studio 2017 with the name: Assembly-CSharp.
https://i.imgur.com/PPXpAIj.png
Any video I find online for a Unity walkthrough has the Library named differently, usually it's the same as the solution name(Project Name) for the basic ones.
Here is a screenshot of this video at 1:09(https://www.youtube.com/watch?v=9ZEu_I-ido4)
https://i.imgur.com/rYrycQA.png
I find this is wrong, or i'm just concerned i'm starting off on the wrong foot, why is it defaulting this way for me?
Answer by Martin_Gonzalez · Mar 26, 2018 at 10:42 AM
Unity creates a project based on a Solution File (.sln) that contains the assemblies references (.csproj files)
When a script is in Assets root it will be in Assembly-Csharp
When a script is under an Editor folder then it will be in Assembly-CSharp-Editor
When a script is under Standard Assets it will be in Assembly-CSharp-firstpass
When a script is under Standard Assets/Editor it will be under Assembly-CSharp-Editor-firstpass
This is because Unity separate editor code and third party code.
So what is something like https://i.imgur.com/rYrycQA.png , this will still be under Assembly-CSharp but the na$$anonymous$$g convention is changed at default?
In the .sln file you can name the assmeblies.
if you inspect the .sln file you will find a line like this
Project("{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{1AF10902-9781-58C1-C1BA-8EC10E1CFC9A}"
Where is a simple map of name - file. Both can be anything else.
Do you happen to know why it goes to "Assembly-CSharp" ins$$anonymous$$d of the name of the project like the picture I posted above? IE Class Library the same name as Project Name.
Also are they the same technically? I see that the icons are different.