Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Generate .sln/.csproj without Visual Studio

Discussion in 'Scripting' started by LitchiSzu, May 12, 2018.

  1. LitchiSzu

    LitchiSzu

    Joined:
    May 14, 2016
    Posts:
    13
    Hi there!

    I've been using VS Code for more than a year now but I used to also have Visual Studio installed, which I don't do on all computers anymore.
    I realised recently (by making new projects) that if VS Code is selected as the preferred editor for Unity, no sln/csproj will be generated, even using the Edit -> Open C# Project action.

    Only way to get them to be generated is to switch the preferred editor to Visual Studio and to use the Open C# Project action or to double click a C# file in the project.
    I can deal with that (eventhough it's quite annoying...) but I would love to not have to install Visual Studio everywhere. I always have the build tools installed (for C++ reasons, but I still install msbuild and .NET for C# anyway) but I don't really want to install Visual Studio while I am not using it.

    Is there any alternative to generate the solution files please ? I need them for Omnisharp (in VS Code) to enable Intellisense.

    Thanks!

    PS: I'm on Windows, in case it matters.
     
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    5,560
    Generate the solution files on the machine with Visual Studio. Then submit those solution/proj files to whatever version control/repository system you use for you shared project. And the other machines will get it, while not needing Visual Studio.
     
  3. LitchiSzu

    LitchiSzu

    Joined:
    May 14, 2016
    Posts:
    13
    Thank you but, clearly we are not facing the wall with this problem and we are already using this alternative.
    However it still is annoying when someone has to create a new project on a computer without VS.

    I am only looking for a way to generate these files without VS on the computer or at least without having to switch the preferred editor in the Preferences.
     
  4. LitchiSzu

    LitchiSzu

    Joined:
    May 14, 2016
    Posts:
    13
    Bumping that up as I didn't get any reply.
    I want to be able to generate the csprojs file without switching to Visual Studio for that.

    I'm going to write some tool to do it, but if there is a way to do it from the engine, it would be great. Or, if there is some specification for me as to which file types I need to include for it to be similar to Unity's (I've seen it include .cs, .shader, .compute but unsure what else!)
    It would also help to be able to regenerate them easily on the fly so that when people add files to the project they can regenerate their csproj themselves : )

    Thanks,

    Clem
     
  5. Dance_M

    Dance_M

    Joined:
    Aug 17, 2014
    Posts:
    5
    Same here. No *.sln; *.csproj files generation in latest Unity version, which is critical for Sublime Text users. I cannot find any solution except manual switching to VS, building, and switching back to ST. That is terrible :(
     
  6. Jakintosh

    Jakintosh

    Joined:
    Jan 26, 2014
    Posts:
    1
    Agreed. I've been struggling to keep sublime text 3 as my default editor, but it just gets harder and harder. I've had to resort to jumping back and forth to VS to generate the .sln files and it's really a huge pain. VS eats resources on my machine like nobody's business, I really wish I didn't have to rely on it.
     
    Dance_M likes this.