Skip to content
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

Can't generate .csproj for player projects #763

Open
Merichbier opened this issue Nov 28, 2023 · 6 comments
Open

Can't generate .csproj for player projects #763

Merichbier opened this issue Nov 28, 2023 · 6 comments
Assignees
Labels
area-roslyn area-unity Unity support enhancement New feature or request triaged The issue has been triaged
Milestone

Comments

@Merichbier
Copy link

Type: Bug

Currently it seems impossible to toggle the generation of player projects file. This is usefull when developing for platform where we need to write native code, like for HoloLens 2.

In Visual Studio we have the possibility to switch the code analysis between project and player (editor / platform) which allows compilation checks for the platform.
image
image

Reproduction steps :

  • Go to Unity Preferences
  • Try to toggle Player projects under "Generate .csproj files for:"
    image

Actual:

  • Can't toggle the option

Expected:

  • Toggle is active

Extension version: 0.9.3
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z)
OS version: Windows_NT x64 10.0.22621
Modes:

System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i9-12900H (20 x 2918)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.68GB (9.13GB free)
Process Argv C:\git-repos\some-repo --crash-reporter-id fc47f6da-83c7-43c9-b339-54ad6c91ce78
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30880072
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
282f8724:30602487
f6dab269:30613381
showlangstatbar:30737416
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialog:30887143
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30871694
pythonregdiag2:30871582
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
2e7ec940:30885897
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30886110
dsvsc017:30886112
dsvsc018:30886114
aa_t_chat:30882232

@microsoft-issue-labeler microsoft-issue-labeler bot added the area-test Test discovery, execution, debugging label Nov 28, 2023
@webreidi webreidi added area-roslyn area-unity Unity support and removed area-test Test discovery, execution, debugging labels Nov 28, 2023
@dibarbet
Copy link
Member

@jbevain is this expected to be supported? How do these player projects work? Is the .cs file shared between multiple projects - or is there a separate .cs file for each project?

If these projects required shared files - then assuming the project generation happens, we'd still need to implement dotnet/vscode-csharp#5788 to allow you to switch between different contexts.

@jbevain
Copy link
Member

jbevain commented Nov 28, 2023

Hi @dibarbet, at the moment we're not supporting this because there's no way to switch between different contexts :)

Basically today we generate project files to represent what Unity is compiling for the Unity Editor.

Having Player projects allows you in VS to be able to select the project context to represent what Unity is compiling when building a Player for a target platform, so you can get a different editor experience based on ifdef or references for instance.

@jbevain jbevain added the enhancement New feature or request label Nov 28, 2023
@dibarbet
Copy link
Member

Basically today we generate project files to represent what Unity is compiling for the Unity Editor.

Having Player projects allows you in VS to be able to select the project context to represent what Unity is compiling when building a Player for a target platform, so you can get a different editor experience based on ifdef or references for instance.

How does this work in VS - is the project generated with a linked file reference to the same .cs file? If so we can mark this as blocked on Roslyn support for project contexts.

@jbevain
Copy link
Member

jbevain commented Nov 28, 2023

Yes, there are N different csprojs with a different set of defines and references that are referencing the same .cs file.

@dibarbet dibarbet assigned dibarbet and unassigned jbevain Nov 29, 2023
@dibarbet dibarbet added this to the Backlog milestone Nov 29, 2023
@dibarbet
Copy link
Member

Got it, blocked on dotnet/vscode-csharp#5788 then

@Merichbier
Copy link
Author

Amazing, thanks for the check and extra information!

@arunchndr arunchndr added the triaged The issue has been triaged label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-roslyn area-unity Unity support enhancement New feature or request triaged The issue has been triaged
Projects
None yet
Development

No branches or pull requests

5 participants