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

VS Code - AudioPlayerOptions does not contain definition for CategoryOptions #135

Open
whann0205 opened this issue Oct 8, 2024 · 11 comments

Comments

@whann0205
Copy link

Cannot build solution on the mac with Visual Studio Code
because of that error, in Visual Studio 2022 running from a windows machine
it compiles just fine and the simulator runs without any problem.
If i open the definition from VS Code i can see that its somehow does
not have the correct context.
I dont know how i can change the framework context in vscode.
They only thing which i can do is click on the brackets select as target
my iphone.
I can overcome that thing for the moment since i am able to deploy
via visual studio 2022 on windows (remote device).

Bildschirmfoto 2024-10-08 um 07 32 24 Screenshot 2024-10-08 092847 Bildschirmfoto 2024-10-08 um 07 31 44 Bildschirmfoto 2024-10-08 um 07 32 16
@SchittkowskiMS
Copy link

Same error happens when calling dotnet publish on a mac when trying to create a version to upload to appstore

@whann0205
Copy link
Author

I have found the problem source
see microsoft/vscode-dotnettools#1522
It seems that they opened a bug on that, but i did not
get any message from anybody. Also i am not sure if its a bug or
simply something i (we?) dont know.

@whann0205
Copy link
Author

@jfversluis Can you help us out, since there is no reaction from the vscode Team?

@bijington
Copy link
Collaborator

The property only exists on iOS and MacCatalyst, your screenshots show that you aren't guarding the code with a #if therefore it's trying to compile for all platforms. Does it work if you place the #if from the commenter out section below?

@SchittkowskiMS
Copy link

i had it guarded by #if, had no issues to compile in visualstudio on windows and debugging to ios device. the error seems to be happening only when compiling on mac

@bijington
Copy link
Collaborator

Do you have the same .NET SDK and MAUI workloads installed on both machines? To check this you run the following in command prompt/terminal:

Dotnet SDK
dotnet--info

Workloads
dotnet workload list

@whann0205
Copy link
Author

whann0205 commented Oct 22, 2024

Since it is a compiler error from vscode i doubt that i has something to do
with the dotnet version or installed workloads does it?
They are indeed very different though, i can post the output of both commands
on the machines if it helps.

@bijington
Copy link
Collaborator

There is no compiler in VS Code it will be using whichever compiler is installed as part of whichever .NET SDKs are installed.

The workloads might have something to do with it. It will be much easier to prove once I know what workloads you have installed

@whann0205
Copy link
Author

Alright, here you go!

dotnetmac.txt
dotnetwin.txt
dotnetwlmac.txt
dotnetwlwin.txt

@whann0205
Copy link
Author

OK, i have an update for you all.
I deleted dotnet completely from my mac (everything),
installed the latest .net8 sdk, restored workloads.
Now all is working.
Thank you for pointing in the right direction,
didnt know that the sdk has that impact on the source.
Strange though.

@bijington
Copy link
Collaborator

Thanks for the update. We have recently discovered that workloads can impact which TFM is being targeted when the NuGet package is built. At times this can be painful especially when you have certain preview builds installed. Glad it's solved it for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants