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
7
Question by blitzen · Oct 13, 2011 at 04:11 PM · c#monodevelopdefaultparameter

Default Parameter Specifiers Are Not Permitted

I started editing a new C# script in MonoDevelop, and pressed the "Build Project Assembly" button (F7). This caused it to now go into another C# library package I've had working for a while, and drop the following error dozens of times on function definitions with optional parameters:

Default parameter specifiers are not permitted (C50241)

The errors are only thrown in MonoDevelop. When you save it and switch to the Unity editor, it compiles and runs the code fine, as I've been using that package's scripts for weeks. I'm thus only now discovering that MonoDevelop doesn't approve, possibly because it's the first time I hit F7 on a C# file instead of JS, so I presume that it compiles all scripts of only the language of the script you're editing.

Google has it that C# only started accepting default parameter specifiers after version 4.0. So is there a discrepancy between the assembler of Unity and that of MonoDevelop, such that the former accepts post-C#-4.0 conventions and the latter doesn't?

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 felipeimax · Oct 15, 2013 at 01:54 PM 0
Share

I think you mean CS0241, not C50241.

3 Replies

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

Answer by feanix · Jan 09, 2012 at 05:55 AM

The latest version of mono supports this just fine. If you're using Mono Develop 2.8x and you're still getting this problem you might want to make sure you're actually using the .NET 4.0 compiler.

To do this change the setting in the Project options:

alt text alt text

Comment
Add comment · Show 5 · 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 blitzen · Feb 12, 2012 at 05:34 PM 0
Share

Indeed $$anonymous$$e was set to 3.5 by default. Good one.

avatar image The-Oddler · Jan 15, 2013 at 04:57 PM 6
Share

Is there a way to make this change permanent? It seems to reset this sometimes :s

avatar image doublethink · Jan 16, 2013 at 09:10 PM 0
Share

I can confim this. .NET 3.5's alternate to default parameters is member overloading. As far as changing it back I think Unity is doing that. You shouldn't have a problem if you build in Unity even though $$anonymous$$onoDevelop may be giving you an error.

$$anonymous$$ember Overloading - http://msdn.microsoft.com/en-us/library/vstudio/ms229029%28v=vs.100%29.aspx

avatar image The-Oddler · Jan 16, 2013 at 09:29 PM 0
Share

True, no problems in Unity. Though it's still annoying in monodevelop. I mainly get this when using other libraries, and it's a pain to change all their default-parameter stuff to member overloading :P

avatar image hungtdo · Apr 16, 2015 at 05:53 PM 0
Share

Great answer! Thanks

avatar image
2

Answer by BenoitFreslon · Aug 27, 2014 at 10:45 AM

It's worked for me: http://forum.unity3d.com/threads/monodevelop-problems-with-default-parameters.67867/#post-898994

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 agusdean · Jan 27, 2017 at 03:54 AM 0
Share

thanks for solution

avatar image
2

Answer by Nummo · Dec 13, 2015 at 02:48 PM

To solve this problem I've installed latest .NET Mono Framework and then I have configured it as displayed on next picture. picture


monodevelopdotnetruntimes.png (35.5 kB)
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

12 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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

How do I change the default monoDev C# file? 4 Answers

App work in play test mode but not working in android real device 0 Answers

Possible to set compiler directives for generated MonoDevelop solution? 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