- Home /
Some public methods can not be called
Example: System.IO.Directory has 2 CreateDirectory:
public static DirectoryInfo CreateDirectory(string path);
public static DirectoryInfo CreateDirectory(string path, DirectorySecurity directorySecurity);
when i called the second method, Unity told me:
error CS1501: No overload for method CreateDirectory takes 2 arguments
Why is that?
Is there a way to know what method can not be called even if it is public?
(I need to generate auto-call code by reflection)
Answer by saschandroid · Feb 04, 2016 at 08:56 AM
You can't use the second method if you have set the api compatibility level to .NET 2.0 subset. Switch to .NET 2.0 and it should be there.
Thank you ! But why typeof(Directory).Get$$anonymous$$ethods(...) contains the second method (.net 2.0 subset)?
Your answer
Follow this Question
Related Questions
What is wrong with the script 1 Answer
3rd Person Camera to Rotate With the Player 0 Answers
Why won't my scripts work? 1 Answer
Need help fixing my script 1 Answer
Can't use any scripts at all (Just installed engine). 0 Answers