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
C# Dev Kit Support for Unity Projects #271
Comments
I also start getting an error: |
Same error here using linux Mint |
Also having this problem using windows 11. Tried installing .NET 4.7.1 SDK and targeting pack to no avail. Seems purely due to the bit older format of unity generated csproj files. I find that a project will succeed at loading when i add the However, while the projects will load, the solution viewer will be useless because, since Unity csproj files are generated in the root directory, each project in the solution viewer just shows the entire project file system like the regular view. This could be fixed oneself by moving your assembly's .csproj file in the folder alongside the assembly definition file, but unity will just regenerate that csproj file at the root directory the next yo you compile your code so that doesn't work either & this regeneration removes the property changes/additions that I stated above which causes the projects to fail to compile once more and back at the beginning... So evidently I was unable to fix the problem, but I have uncovered why it occurs and what needs to be don't to fix it so hopefully it can help the DevKit team resolve this by making some special treatment for Unity C# Projects :) |
So, im super new to unity and got this problem too, the thing is, my intelissense is not working, and i thought this was related, is it? |
Yes, that's the cause.
Em seg., 31 de jul. de 2023 20:34, Facewade ***@***.***>
escreveu:
… So, im super new to unity and got this problem too, the thing is, my
intelissense is not working, and i thought this was related, is it?
—
Reply to this email directly, view it on GitHub
<#271 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALVBAETRN4EOS3C2NE4X54DXTA6HBANCNFSM6AAAAAA2OENOII>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I subscribe, mine doesn't work either |
Not working for me as well. Now it's impossible to use Unity with VS Code a few days after Unity posted a guide on how to debug with VS Code (debugging with unity is different). You can't use one of the most famous use cases of C# with VS Code, great idea. |
You have two options for SDK style csproj.
or
Note that you can't have both packages installed simultaneously for reasons that only Microsoft & Unity know. (See Chizaruu/com.tsk.ide.vscode#77 for more details) |
We just announced the addition of the Unity extension for Visual Studio Code to the C# Dev Kit family of extensions, currently in preview. Make sure to follow the Getting Started guide and you should be good to go. I'm going to close this issue, but feel free to create new issues if you encounter problems with the preview! |
Feel free to open a new issue to track this. The behavior and code your highlight in your GitHub issue is simply a way to avoid a conflict between the Visual Studio Code support in the Visual Studio Editor Unity Package that we work on in collaboration with Unity, and the Visual Studio Code Editor Unity Package that Unity previously maintained and now stopped supporting (but is still installed in many Unity versions). We'd be happy to look at only disabling the legacy and unmaintained Unity Package that Unity still ships if that conflicts with your package. |
Sounds like a plan, thanks for letting me know! |
try open Assembly-CSharp.csproj file, add new line value is net sdk you installed before ex: |
Upgrading to the latest Visual Studio Package (v2.0.20) fixed this issue for me, I didn't realize that package was involved. Thank you! |
Follow this document Unity Development with VS Code. |
Delete all CsProj files and soltuion files from the root, and regenerate the files from settings (Edit->Preferences->Regenerate Project Files) |
Can something please be ever released without any critical issues that block the workflow.... |
Im having this same issue, ive updated to version 2.0.20 but it still doesnt work |
Having the same issues as well. Downloading the 2.0.20 version of Visual Studio Editor, as well as Visual Studio Code Editor, and regenerating files etc still provides me with The project file '...\Assembly-CSharp.csproj' is in unsupported format (for example, a traditional .Net Framework project). It need be converted to new SDK style to work in C# Dev Kit. Tried pretty much everything here (deleting then regenerating files etc) and nothing seems to work. |
Removing the Visual Studio Code Editor package and updating Visual Studio Editor in Unity Package Manager fixed it for me. |
Complete guide that worked for me: (from answes above)
|
Well, what if you dare to use Unity 2020? |
I already did everything said here and nothing works! this is fuckin hell! |
. have yousolved the problem? |
Late Edit: It seems like the Visual Studio Editor package version 2.0.20 and above solve this issue automatically.
If you don't want to delete your csproj files, use the method below After failing to solve it on this page, i found this: https://discussions.unity.com/t/vscode-cant-load-c-project/273373 Particularly, nothing worked until I added Here are the steps
Since I hadn't coded on my home PC in awhile, I also updated to the latest C# SDK before I did these steps. https://dotnet.microsoft.com/en-us/download |
Oh my god, this actually works, on MacOS at least:
And the output (after 22:26 is when I changed it and saved)
Life saver! Thank you @nguyenminhtri10061997 ! |
Worked for me too, thanks!! |
FWIW, I think you should add the line |
Thank you very much it worked for me :) |
Updating to Visual Studio Editor (version 2.0.20) |
Using Unity 2019.4 here. One silly thing that was making things difficult for me, was not closing and relaunching Unity after making package changes. I asumed this was not required, but finally proved to help. |
TWIMC, if you want to automate patching
P.S.: I'm using 2020.3.40f1, because that's my fixed version for releases currently. |
Maybe can solve this problem:Delete all CsProj files and solution files from the root directory, then regenerate files from Settings (Edit -> Preferences -> Regenerate project files) |
Thank you guys - I've solved my issue simply by moving to my PC and using Visual Studio instead. For some reason that works completely fine, and even on my Mac it works much better. VSCode still gets the same errors, but that's a problem for the future, I've wasted enough time on this. |
I'm also moving to Visual Studio instead, the C# Dev Kit its so buggy for me, and the documentation is so confusing,I wasted so much time trying to make things work. |
To resolve the issue of the Unity assembly C# file being in an unsupported format, you'll need to convert it to the new SDK style. Here are the steps to do so:
|
DONT forget to restart Unity after plug-ins updated. |
How do i delete this extension it's malware |
For those still struggling with this on Mac (might work for Windows, idk):
|
I was struggling horribly with this, and this turned out to be what I was missing. I removed Visual Studio Code Editor, and added Visual Studio Editor*, and it was continuing to generate the project xml files with the bad This is very confusing and the error messages are pretty unhelpful! :( * Also at this step, after installing Visual Studio Editor and based on a comment on a forum, I went into the Player settings and changed the API Compatibility Level from ".NET Framework" to ".NET Standard 2.1". I do not know if this step did anything at all, but if it did, it had no effect until I restarted Unity. |
Describe the feature you'd like
Whenever I try to open a unity project in VSCode using the new C# Dev Kit I get the following warning messages for each project
[warning] The project file 'PATH TO THE .CSPROJ FILE' is in unsupported format (for example, a traditional .Net Framework project). It need be converted to new SDK style to work in C# Dev Kit.
Opening Unity C# projects in the new extension will be very useful for a lot of programmers.
And thanks for the amazing extension.
Alternatives considered
No response
Environment Information
No response
The text was updated successfully, but these errors were encountered: