') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); [release/7.0] [wasm][debugger] Support create, debugging and running wasmbrowser template from VS by github-actions[bot] · Pull Request #76113 · dotnet/runtime · GitHub
Skip to content

[release/7.0] [wasm][debugger] Support create, debugging and running wasmbrowser template from VS - #76113

Merged
carlossanlop merged 10 commits into
release/7.0from
backport/pr-75986-to-release/7.0
Sep 28, 2022
Merged

[release/7.0] [wasm][debugger] Support create, debugging and running wasmbrowser template from VS#76113
carlossanlop merged 10 commits into
release/7.0from
backport/pr-75986-to-release/7.0

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Sep 24, 2022

Copy link
Copy Markdown
Contributor

Backport of #75986 to release/7.0

/cc @lewing@thaystg

Customer Impact

On 7.0, we created a new template to create a wasm browser app without using blazor, and it was not possible to run and debug it from VS, this backport fixes it.

Testing

Manually tested.

Risk

Low risk, only changing the way to start up the new template.

IMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.

@ghost

Copy link
Copy Markdown

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@carlossanlop

Copy link
Copy Markdown
Contributor

@thaystg please fill out the template, add the servicing-consider label, and send the email to Tactics requesting approval.

@thaystgthaystg added this to the 7.0.0 milestone Sep 26, 2022
@thaystgthaystg added the Servicing-consider Issue for next servicing release review label Sep 26, 2022
@carlossanlop

Copy link
Copy Markdown
Contributor

This was approved by Tactics via email.

@thaystg can you please resolve the merge conflict?

@carlossanlopcarlossanlop added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Sep 26, 2022
@carlossanlop

Copy link
Copy Markdown
Contributor

@radical

Copy link
Copy Markdown
Member

Looking at the failures now.

@radical

Copy link
Copy Markdown
Member

The json is malformed. I'll fix.

 [] Error: Failed to load template from /datadisks/disk1/work/C9390AE6/w/AAE00933/e/dotnet-net7/template-packs/microsoft.net.runtime.webassembly.templates.7.0.0-ci.nupkg(/content/templates/browser/.template.config/template.json).
[] Details: Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: ". Path 'symbols.kestrelHttpsPortGenerated.replaces', line 36, position 4.
[] at Newtonsoft.Json.JsonTextReader.ParsePostValue(Boolean ignoreComments)
[] at Newtonsoft.Json.JsonTextReader.Read()
[] at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)
[] at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)
[] at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
[] at Microsoft.TemplateEngine.JExtensions.ReadJObjectFromIFile(IFile file)
[] at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.RunnableProjectConfig..ctor(IEngineEnvironmentSettings settings, IGenerator generator, IFile templateFile, IFile hostConfigFile, IFile localeConfigFile, String baselineName)
[] at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.RunnableProjectGenerator.Microsoft.TemplateEngine.Abstractions.IGenerator.GetTemplatesAndLangpacksFromDir(IMountPoint source, IList`1& localizations)
[] No templates or subcommands found matching: 'wasmbrowser'.

.. template.json . Fixes:
```
[] Error: Failed to load template from /datadisks/disk1/work/C9390AE6/w/AAE00933/e/dotnet-net7/template-packs/microsoft.net.runtime.webassembly.templates.7.0.0-ci.nupkg(/content/templates/browser/.template.config/template.json).
[] Details: Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: ". Path 'symbols.kestrelHttpsPortGenerated.replaces', line 36, position 4.
[] at Newtonsoft.Json.JsonTextReader.ParsePostValue(Boolean ignoreComments)
[] at Newtonsoft.Json.JsonTextReader.Read()
[] at Newtonsoft.Json.Linq.JContainer.ReadContentFrom(JsonReader r, JsonLoadSettings settings)
[] at Newtonsoft.Json.Linq.JContainer.ReadTokenFrom(JsonReader reader, JsonLoadSettings options)
[] at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
[] at Microsoft.TemplateEngine.JExtensions.ReadJObjectFromIFile(IFile file)
[] at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.RunnableProjectConfig..ctor(IEngineEnvironmentSettings settings, IGenerator generator, IFile templateFile, IFile hostConfigFile, IFile localeConfigFile, String baselineName)
[] at Microsoft.TemplateEngine.Orchestrator.RunnableProjects.RunnableProjectGenerator.Microsoft.TemplateEngine.Abstractions.IGenerator.GetTemplatesAndLangpacksFromDir(IMountPoint source, IList`1& localizations)
```
@radical

Copy link
Copy Markdown
Member

It was a bad merge. Hopefully, it should be good now.

```
WasmAppHost --runtime-config /datadisks/disk1/work/99FC08A1/w/B6B509D6/e/browser_Debug_crvdkcbp.f3f/bin/Debug/net7.0/browser-wasm/AppBundle/browser_Debug_crvdkcbp.f3f.runtimeconfig.json --forward-console
Unhandled exception. System.InvalidOperationException: Dynamic port binding is not supported when binding to localhost. You must either bind to 127.0.0.1:0 or [::1]:0, or both.
at Microsoft.AspNetCore.Server.Kestrel.Core.LocalhostListenOptions..ctor(Int32 port)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.ParseAddress(String address, Boolean& https)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IEnumerable`1 listenOptions, AddressBindContext context, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.WebHost.StartAsync(CancellationToken cancellationToken)
at Microsoft.WebAssembly.AppHost.WebServer.StartAsync(WebServerOptions options, ILogger logger, CancellationToken token)
at Microsoft.WebAssembly.AppHost.BrowserHost.StartWebServerAsync(String appPath, Boolean forwardConsole, String[] urls, CancellationToken token)
at Microsoft.WebAssembly.AppHost.BrowserHost.RunAsync(ILoggerFactory loggerFactory, CancellationToken token)
at Microsoft.WebAssembly.AppHost.BrowserHost.InvokeAsync(CommonConfiguration commonArgs, ILoggerFactory loggerFactory, ILogger logger, CancellationToken token)
at Microsoft.WebAssembly.AppHost.WasmAppHost.Main(String[] args)
at Microsoft.WebAssembly.AppHost.WasmAppHost.<Main>(String[] args)
```
@radical

Copy link
Copy Markdown
Member

@carlossanlop good to go

@thaystg

Copy link
Copy Markdown
Member

Tested and it's working.

@lewing

Copy link
Copy Markdown
Member

whoops 😬

Thanks for fixing up

@carlossanlop

Copy link
Copy Markdown
Contributor

Thanks for the fix @radical.
Approved by Tactics, signed off, and new CI run hit again the unrelated firefox known failure: #75018

Ready to merge. :shipit:

@carlossanlop
carlossanlop merged commit 228edfc into release/7.0Sep 28, 2022
@carlossanlop
carlossanlop deleted the backport/pr-75986-to-release/7.0 branch September 28, 2022 20:12
@ghostghost locked as resolved and limited conversation to collaborators Oct 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Servicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@carlossanlop@radical@thaystg@lewing