Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by LEGEND383 · Jun 10, 2014 at 02:30 PM · monodevelopformatting

How to force monodevelop to use my code policy on new projects

I have found a few things around the internet about doing this, but none of them are permanent. I can get mono to use my policy, but the next time I switch to Unity and back it is using the default policy again.

I'm a bit of a neat freak when it comes to how my code looks and am getting really frustrated with having to write a block of code and then go back and put it how I typed it in the first place.

Any help appreciated.

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

2 Replies

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

Answer by Landern · Jun 10, 2014 at 02:45 PM

From my experience and i'm similar that i present my code layout in a particular way, a new solution in monodevelop gets all the defaults, creating a custom policy that i save, allowing me to apply it to new solutions when created is the trick.

From StackOverflow:

  1. MonoDevelop->Custom Policies->Add Policy->New Policy

  2. Edit the policy inside of the 'Custom Policies' window, making sure your policy is selected.

  3. Project->Apply Policy->Apply Stock or Custom Policy Set (select your policy)->Apply

but you want to apply it to your solution:

  1. (right click the solution, then Tools->Apply Policy) and save the solution under a new filename. That way, Unity won't overwrite your settings every time it regenerates the projects.

Comment
Add comment · Show 3 · 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 LEGEND383 · Jun 10, 2014 at 02:59 PM 0
Share

Edit again: after closing everything and manually rena$$anonymous$$g the solution it seems to be working, thanks for your help :)

avatar image Essential · Nov 27, 2014 at 01:05 PM 0
Share

What do you mean by 'manually rena$$anonymous$$g the solution' ? Every time I quit and re-open $$anonymous$$ono it's reverted back.

avatar image Essential · Nov 27, 2014 at 01:30 PM 0
Share

AHA, I think I solved it.

After creating your own policy and applying it by following the steps above, I did this:

  1. Double check your formatting is showing correctly.

  2. Rename the solution in $$anonymous$$onodevelop (right click the pink icon in the left sidebar and 'Rename' from '$$anonymous$$yUnityProject' to e.g. '$$anonymous$$yUnityProject fixed')

  3. Close $$anonymous$$onoDevelop and find the folder the solution is saved into (should look something like /User/$$anonymous$$yUnityProject/) — You should see both your original solution '$$anonymous$$yUnityProject.sln' and your new one '$$anonymous$$yUnityProject fixed.sln'. Remove the original and then you can rename '$$anonymous$$yUnityProject fixed.sln' to your original file name '$$anonymous$$yUnityProject.sln'. Also do the same for the .userprefs files.

  4. Reopen $$anonymous$$onoDevelop — everything should be working now! :)

avatar image
0

Answer by fserb · Dec 11, 2015 at 12:35 PM

I think I found a better solution than forking the sln project.

Find where MonoDevelop store the policies.

In the case of Mac is: ~/Library/Preferences/MonoDevelop-Unity-5.0.

You will find there a Default.mdpolicy.xml and your own mdpolicy file ( WhateverYouNamedIt.mdpolicy.xml ).

Just overwrite the default with yours and suddenly it all goes to your policy as the default. I've tried a couple times and seems to be working fine.

Comment
Add comment · 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

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

23 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

Related Questions

MonoDevelop Doesn't Remember Policy File 0 Answers

Monodevelop formatting [Header] weirdly 0 Answers

Monodevelop Tab Error 0 Answers

Precompiler directives break MonoDevelop autoformat 0 Answers

MonoDevelop 4.0.1 auto (de)formatting 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