Search Unity

No autocomplete on Monodevelop after updating to most recent Unity version

Discussion in 'Scripting' started by Zaine7673, Jan 7, 2019.

  1. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238
    So I've just updated to the most recent Unity version. I've been avoiding updating because I was afraid something would get broken as it always does and ... yes it's broken.

    Monodevelop no longer seems to popup with autocomplete suggestions for unity. cant even get Debug.Log to show up.

    I've tried deleting files from the root folder, tried clearing solutions, tried reinstalling and updating .NET framework and tried every other thing that i can find on the internet but I can't seem to get it back.

    First Monodevelop was asking me for .NET 4.7.1 - now that I've got that it gives me the following errors

    and

    and

    I know a lot of people have had this issue. Any ideas on how i can resolve this nonsense??

    thanks in advance,
     
    karan-veer and MCPCMC like this.
  2. Vectorbox

    Vectorbox

    Joined:
    Jan 27, 2014
    Posts:
    232
    From Unity 2018.1 onwards, MonoDevelop has been replaced with Microsoft Visual Studio which supports the new .NET 4.6+ scripting runtime. It can be installed using the Unity installer or directly from Microsoft.

    You can read the full Unity blog announcement here

    Once installed, you can set Visual Studio as your default script editor... 'Edit Menu / Preferences / External Tools / External Script Editor'
     
    karan-veer and xVergilx like this.
  3. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238

    Thank you.

    I've already read this but i was hoping there was a way around this and i could get my auto complete back on monodevelop as I won't be using VS. It's just incredibly slow in my experience and full of windows and suggestions that I'm not interested in.

    It was a choice between going back to 2017 or adjusting to monodevelop without the auto complete and I've gone for the latter until someone a little smarter than I am figures out how to get it working again.

    thanks anyway :)
     
  4. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    If you are looking for another free solution and/or need Mac/Linux support, there is always VSCode.
     
  5. Vectorbox

    Vectorbox

    Joined:
    Jan 27, 2014
    Posts:
    232
    I know that this is the common conception, but having used Visual Studio for quite some time I wouldn't go back to Mono Develop even if it received a major compatibility update. After a bit of tinkering, my default VS layout consists of a single scripting window and the only messages I get are occasional update notifications. Initial launching can be a little slow, but once it's sorted itself out it's quite responsive. I also find it ideal for DLL scripting which is a bonus.

    It's really a matter of personal choice and (as mentioned above) VS Code could be a viable lightweight alternative.
     
  6. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238

    I thought I'd try VS again after reading your comment but it keeps saying my 30 day trial period has expired. I thought VS community version was free. it has been a long time since I've used VS
     
  7. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238

    thanks I may try this because the lack of auto complete is driving me nuts. but whats the difference between this and the normal visual studio?

    just started using it and it seems to be just what i was looking for. speedy and simple. :)
     
    Last edited: Jan 8, 2019
  8. Vectorbox

    Vectorbox

    Joined:
    Jan 27, 2014
    Posts:
    232
    It is free, you probably need a current license. When the '30 day trial period has expired' notice appears, click 'check for an updated license' and Visual Studio should be fine.
     
  9. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    There is a free Visual Studio Community available for creating non-enterprise apps.

    I was referring to VSCode, which is open source, cross-platform and free with no limitations.

    The VSCode community has also created some great extensions for VSCode, to help you get some extra bells & whistles.

    The most noticeable difference for me between VSCode and the other Visual Studio flavors is the keyboard shortcuts are different. I normally use the full Visual Studio 2017, so I often get confused and use the wrong keyboard shortcuts when I am using a machine with VSCode on it.
     
    Vectorbox likes this.
  10. Zaine7673

    Zaine7673

    Joined:
    Feb 15, 2018
    Posts:
    238

    I am now using vscode and im rather liking it. there are a few handy features that once you get used to is pretty awesome. i think the UI could have been a bit more user friendly but im not complaining too much. it has auto complete for unity so great :)

    thanks for the suggestion
     
    Vectorbox likes this.
  11. karan-veer

    karan-veer

    Joined:
    Nov 2, 2017
    Posts:
    6
    I've got the exact same three issues, two warning and the last one being an error.
    So, the only solution is VSCode or Visual Basic?
    Got so used to MonoDevelop to be honest. No other way really?
    If not, then those who switched from MonoDevelop could give a feedback on their new IDE, along few handy tips?

    EDIT:
    I compiled my code in VS 20017.
    Now I have 48 Errors and 24 Warnings. Pretty sure you had them too..so what should i do?
     
    Last edited: Mar 14, 2019
  12. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    How are you compiling said code? You can edit your code in Visual Studio and let Unity compile it for you by just switching back to it.
     
  13. garnek15

    garnek15

    Joined:
    Mar 9, 2019
    Posts:
    1
    Hi,

    I got similar problem with not working autocomplete on monodevelop. I found that when I open in mono my old projects autocomplete works, and in every new unity project it doesnt work. I think that key is Assembly-CSharp.csproj config file generated by unity.

    I was trying compare old and new files and for now I only found that when I remove below line autocomplete is working again:

    <PropertyGroup>
    <LangVersion>latest</LangVersion>
    <CscToolPath>C:\Program Files\Unity\Hub\Editor\2019.2.0f1\Editor\Data\Tools\RoslynScripts</CscToolPath>
    <CscToolExe>unity_csc.bat</CscToolExe>
    </PropertyGroup>

    but I dont know if we have same problem, and if this is best solution. I think you should try to change Assembly-CSharp.csproj yourself to find what exactly works for you.
     
  14. mallyhubz

    mallyhubz

    Joined:
    Dec 23, 2017
    Posts:
    1
    I had this with Unity 2018.3 and Mono 5.9.6

    I added a pre-build script to each project to replace the "LangVersion" on each build, and it seems to help prevent at least 1 error and keep the autocomplete working.

    RMB on Assembly-CSharp -> Options -> Build -> Custom Commands

    Before Build
    powershell ((Get-Content -Path ${ProjectFile} -Raw) -replace '<LangVersion>latest</LangVersion>','<LangVersion>4</LangVersion>') | Set-Content -Path ${ProjectFile}

    I still get to "warnings" "MSB3257: The primary reference ..." but they are not slowing me down. Am looking for a solution to those.

    I will try to get VSCode working fully in the near future and ditch Mono though tbh.