-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
missing / outdated solution and assembly files -> missing assembly references #165
Comments
Not sure where to put it.. I previously open an issue report here as well: dotnet/vscode-csharp#2325 |
Hm, nobody seems to care.. I am wondering how people are still be able to use unity and vs code properly with this issue. I did some deeper digging myself. Looks like Unity does not call OnGeneratedCSProjectFiles (vscode.cs line 1298) anymore. I added the UpdateSolution() call in vscode.cs line 290. Maybe a bit over the top, but at least it's working again:
|
Hrm, I was happy to fast: The vscode plugin sais "[VSCode] Updating Solution & Project Files" but it actually does nothing. Looks like this function is broken in Unity2018: Anybody has an idea? |
Did some more digging and testing and found a solution more or less working for me: First I still need to have visual studio community with the unity plugin installed. Second, I changed the constructor (line 284 for version 2.7 or line 301 - 328 for version 2.8) to this:
Basicaly this means, that visual studio community gets selected as the external editor (under Edit -> Unity Preferences -> External Tools -> External Script Editor) for a short time. So when syncing the project, unity uses the community version to create the solution files. My previous assumption, that OnGeneratedCSProjectFiles() is not called anymore, was wrong. With the above fix, project files are generated again and the callback is triggered afterwards as expected. Please tell me if that fix helps you too! |
@grofie thanks for this. to clarify, this can be tested by replacing the latest version of vscode.cs lines 304 - 328? but only if visual studio community 2017 is installed? which plugin is that you mention? |
Hi @DMlightup, finally someone joined me in this thread =D I still had version 2.7 in my project, that's why the line numbers did not match. I just downloaded version 2.8 - and the solution files dont get created automatically again (means the plugin is still broken in version 2.8). Then I replaced the constructor with the code above (you're right, now it's in line to 301 - 328) and it works fine again. Thx for the hint, I will change the line numbers in the comment above. I think the unity plugin gets installed automatically when you install visual studio over the unity installer. If you install visual studio separately (like I did), make sure you put the check mark for unity: To be honest, I am not 100% sure if the plugin is really necessary, but I installed it anyways and did not test the problem without it. |
Thanks @grofie ! So I still get some assembly warnings but at least I can work without false positives on my code. For the sake of completeness I'm on Unity 2018.1.0f2 and here is my omnisharp log: `Starting OmniSharp server at 6/22/2018, 9:24:57 AM OmniSharp server started Starting OmniSharp on Windows 6.2.9200.0 (x64) And my dotnet --info: `.NET Core SDK (reflecting any global.json): Runtime Environment: Host (useful for support): .NET Core SDKs installed: .NET Core runtimes installed: To install additional .NET Core runtimes or SDKs: |
No one cares this big issue |
I've tested that latest 2017.x version of unity works with this plugins and vscode create csproj and sln files correctly (https://unity3d.com/get-unity/download/archive?_ga=2.176330017.583502768.1533393667-1270968443.1532679919) (In my case version of unity is 2017.4.8f1, vscode 1.26.0-insider) |
Still does not work with 2018.2.3f1. @xahon Does your 2017.x version of unity still come with monodevelop? |
@DMlightup Do you use the hack from this page or does it work with the original code? |
@grofie I'm using the hack. One of our MacOS based engineers made a change to the file, but it only applies to MacOS machines. |
Environment data
dotnet --info
output:.NET Command Line Tools (1.0.0-preview2-003131)
Product Information:
Version: 1.0.0-preview2-003131
Commit SHA-1 hash: 635cf40e58
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
VS Code version:
Version 1.23.1
Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
Datum 2018-05-10T17:11:17.614Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architektur x64
C# Extension version:
1.15.2
Steps to reproduce
Expected behavior
Actual behavior
How I fixed it dirty
You have to do this all the time something changed, so this solution is really not practically!
How I fixed it less dirty
First I still need to have visual studio community with the unity plugin installed.
Second, I changed the constructor (line 284) to this:
Related Issues ??
Maybe this problem is also the reason for these releated issues:
dotnet/vscode-csharp#1867
dotnet/vscode-csharp#1676
dotnet/vscode-csharp#2209
The text was updated successfully, but these errors were encountered: