• 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 /
  • Help Room /
avatar image
Question by AndresPGC · Jun 09, 2016 at 07:58 PM · c#buildbuild settingscompilerassembly

Change assembly name

By default, the assembly name is Assembly-CSharp. Is there a way to change this name?

Comment
alfish

People who like this

1 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 solidjoe · Dec 22, 2016 at 11:45 AM 0
Share

I personally need this because my Unity project is part of a bigger solution, and I can't have it called Assembly-CSharpXXXX every time Unity spits out its project files. Any idea how/where I can affect this change?

3 Replies

  • Sort: 
avatar image

Answer by BorisOkunskiy · Nov 13, 2020 at 08:04 AM

For anyone who came here from Google search: the correct way is to create an Assembly Definition in your Assests/Scripts folder and name it appropriately. This generates the correct .csproj files and furthermore uses the correct assembly name everywhere (e.g. if you use JsonUtility to serialize references with [SerializeReference] you'll get an appropriate assembly name within your JSON files instead of Assembly-CSharp).

Comment
alfish
DotusX

People who like this

2 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 alfish · Jan 09, 2021 at 03:19 AM 0
Share

Upvoting this because it indeed makes Unity not include Assembly-CSharp.dll on the output, unless you have any runtime script outside the assembly definition directories (the folders containing .asmdef and .asmref). Once you get rid of all non-editor scripts outside the assembly def/ref folders, you'll want to delete the auto-generated Assembly-CSharp.csproj, which won't be generated again.

Note: Remember that special folders like Editor aren't special under asmdef/ref. Also, you'll need to explicitly reference any runtime assemblies you use (packages, plugins) on the asmdef, since they won't be Auto-Referenced.

avatar image

Answer by FortisVenaliter · Jun 09, 2016 at 08:07 PM

Not that I'm aware of. And it's only an internal code project name, so why do you need to change it?

Comment

People who like this

0 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 OliverBooth · Jun 21, 2017 at 10:22 AM 0
Share

As someone who wants to change the assembly name, I can answer that question.

I'm developing a class library with internal types and members, and would like the InternalsVisibleTo assembly attribute to be more restrictive than "Assembly-CSharp"

avatar image Hauthorn · Aug 15, 2019 at 12:02 AM 0
Share

This is not even close to an answer.

avatar image

Answer by Hauthorn · Aug 15, 2019 at 12:05 AM

Yes, you can. I'm able to change it like you would any project, via project properties (Alt + Enter). You may need to change a setting in Options -> Tools -> Tools for Unity called "Access to project properties". You also many need to close and re-open your solution to see the effects of changing the settings.

Comment

People who like this

0 Show 0 · 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

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

173 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 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

UnityEditor unusable ? :: error CS0016 1 Answer

How to have Unity Cloud Build point to custom build call. 0 Answers

Unity Start not called on build, but it does when testing 0 Answers

/Editor Scripts Organization with 2017.3 Assembly Definition Files 2 Answers

PlayerPrefs is affecting all builds of my game 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