-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[wasm] Fix analyzer support in templates #77704
Conversation
Tagging subscribers to 'arch-wasm': @lewing Issue Details
|
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
621ca03
to
31599a4
Compare
- Add `[assembly:System.Runtime.Versioning.SupportedOSPlatform("browser")]` to the browser, and console templates. This would allow the analyzers, if enabled, to treat the assembly as one that will run only on browser. - Also, populate `@(SupportedPlatform)` with only `browser`, for *wasm* projects, similar to https://github.com/dotnet/sdk/blob/fef8cedfb6b4ac85a7e135f3e4f155e29cdcbdf1/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets#L75-L79
31599a4
to
142b063
Compare
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
ba5c91b
to
1e189ec
Compare
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
[assembly:System.Runtime.Versioning.SupportedOSPlatform("browser")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best approach we can offer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, this is needed. I'm not sure how else we can do this, but open to suggestions!
If this is the right way how to do it, then the samples\wasm should get the same treatment and then we could |
@akoeplinger does my implementation look correct? I added it for the samples, but didn't enable the analyzers. We could try that. |
This is good to go, once we have an approval. |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
Add
[assembly:System.Runtime.Versioning.SupportedOSPlatform("browser")]
to the browser, and console templates. This would allow the analyzers,
if enabled, to treat the assembly as one that will run only on
browser.
Populate
@(SupportedPlatform)
with onlybrowser
, for wasmprojects, similar to https://github.com/dotnet/sdk/blob/fef8cedfb6b4ac85a7e135f3e4f155e29cdcbdf1/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets#L75-L79
This also fixes the firefox CI build which regressed recently