Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
3
Question by Runewake · Sep 04, 2015 at 09:52 PM · c#visualstudiosolution

Unity Failing to Generate Visual Studio Solution Files

I am using Visual Studio 2015 with Unity Pro and have created a quick project to teach some students Unity. When I create a simple C# script file and attempt to edit the file Unity launches Visual Studio as you would expect. Everything breaks after that.

I am getting an error when opening Visual Studio staying UnityVS.Project.sln can't be found. This file does not exist in the directory where I am working so this makes sense. When I use the Sync MonoDevelop Project menu item under Assets -> Sync MonoDevelop Project I get the same error.

If I navigate to the project folder in Explorer I see two generated Solutions and two related projects. There are:

  • Project.sln

  • Project-csharp.sln

  • Assembly-CSharp-Editor.csproj

  • Assembly-CSharp-Editor-vs.csproj

If I open the generated C# script file and edit it Unity does see the edits. I guess this means I can continue to work on my project, I just can't use any of the connectivity features between Unity and my VS Solutions.

Is there a way to make Unity correctly generate solutions?

Note that I have replaced the name of my project with "Project" in the file names I mentioned above.

Comment
Add comment · Show 5
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 Runewake · Sep 04, 2015 at 10:02 PM 0
Share

I have tested this by creating multiple additional Unity projects with a single C# script. All are failing in identical fashion.

avatar image Positive7 · Sep 04, 2015 at 10:09 PM 1
Share

Are you using Visual Studio Tools? it should generate new solution (if it's missing) at start as far as I know

avatar image Runewake · Sep 04, 2015 at 10:13 PM 0
Share

@Positive7 I am using Visual Studio 2015 Tools for Unity v2.0.0. I just ran the repair tool. This had no effect and I'm still encountering the error. Perhaps it's a bug in version 2?

avatar image Positive7 · Sep 04, 2015 at 10:26 PM 1
Share

I'm using 2.0.0 too and never had this issue. I tried to delete my *.sln then open VS from Unity -> Visual Studio Tools -> Open in Visual Studio and it recreated the solution. Try to Generate Project files from Unity -> Visual Studio Tools -> Generate Project Files Also check it in Configuration if Generate Solution Files checked

avatar image Runewake · Sep 04, 2015 at 10:31 PM 0
Share

Alright, I figured it out. I'll post an answer regarding the fix. Having the Tools installed in Visual Studio is not enough and there was apparently a breaking change made that requires you to download a separate asset package from the Asset Store to use Visual Studio. Failing to do that results in the error I receive.

For an engine which prides itself on usability, these are the things I'd expect them to avoid...

Anyway, thank you for your help!

2 Replies

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

Answer by Runewake · Sep 04, 2015 at 10:35 PM

Right so here is how to fix this problem. There was apparently a breaking change introduced to Unity recently that changes how the workflow with Visual Studio works. You can no longer simply open the project in Visual Studio as if it were MonoDevelop. Even if you have the Visual Studio Tools for Unity plugin installed in Visual Studio it still will not work.

You will need the tools for Visual Studio for Unity installed in Visual Studio and you will need the Visual Studio 2015 Tools package from the Unity Asset Store. Failing either of these appears to result in the problem I described above. Once you have downloaded the package from the asset store everything will clear itself up.

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 Positive7 · Sep 04, 2015 at 10:41 PM 0
Share

Yeah you should always Import UnityVS (Visual Studio Tools 2015) upon starting a New Project :D

avatar image Suddoha · Sep 04, 2015 at 11:43 PM 0
Share

That's strange, i have neither of both (tools/plugins) and it works just fine (since I went back to Windows 7). But I can remember the problem, it always occured when i still had Windows 8 on my laptop.

avatar image Runewake · Sep 04, 2015 at 11:49 PM 0
Share

@Suddoha Perhaps this is the result of having one and not the other or a specific version of Windows?

avatar image
3

Answer by cowlinator · May 17, 2020 at 07:04 AM

If Assets --> "Open C# Project" doesn't create the .sln file, try updating your external tools preferences.

In Unity, go to Edit --> Preferences, and make sure that Visual Studio is selected as your preferred external editor.
Also, make sure that "Generate all .csproj files" is on.

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 hallarazad · Sep 27, 2021 at 04:41 PM 0
Share

Thank you! Exactly what I was looking for

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

30 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 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

Warning with Unity 2018.1.3 and Visual Studio 2017 1 Answer

Creating new C# script in unity not being added in VS's solution 3 Answers

vector 3 isnt working offset part,the vector 3 isnt working 'offset' has a problem 2 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