* Initialize the runtime state correctly for debugging
On startup the DebugProxy needs to know when the runtime
has initialized enough to be able to begin interaction
this is accomplished by breaking in mono_wasm_runtime_ready()
which the Proxy sees does initialization and then resumes from.
Simply setting mono_wasm_runtime_is_ready breaks that logic,
but even worse it appears that the variable is linked out
in the release version
* Regen webassembly.js
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* In debug mode, don't enable the linker by default
* Fixup
* Update Blazor.MonoRuntime.targets
* Ensure we have a true/false value. Stop inferring from BlazorLinkOnBuild.
* Avoid doing work for ServiceWorkerAssetsManifest when it's not being used
* React to BlazorLinkOnBuild->BlazorWebAssemblyEnableLinking rename
Co-authored-by: Pranav K <prkrishn@hotmail.com>
* For individual auth cases, when creating the template from Visual Studio there is no way to provide parameters.
* This change adds a message in the index.html to indicate the steps that need to be followed.
* Update to match Mono sources at a8d34b2
* Update to match Mono sources at fafa41f
* Update to match Mono sources at ed012b6
* Change class/struct/enum types to internal
* Use ILogger in proxy code
* Update to match https://github.com/mono/mono/pull/19026
Fixes: #18814
This adds back support on the Blazor WASM Host for using
ISerivceProviderFactory<>.
We previously had this support when the Blazor WASM host was a clone of
generic host, but I accidentally lost it when simplifying the host
(sorry :( ).
* Support logging errors that happen really early
* Tolerate all the ways caching might be unavailable
* Include dotnet.js in blazor.boot.json
* Reorganize boot manifest to categorize files by role, not just by filename extension
* Enable cache-busting and SRI check on dotnet.js
* Change cache-busting to vary filename, not using querystring. Needed to make PWA manifest still work.
* [Blazor] Move Blazor to use Static Web Assets
* Plugs-in Blazor wasm through the static web assets infrastructure.
* Avoids the need for a custom Blazor.config file.
* Removes broken auto-rebuild and debug support.
* Removes unnecessary server-side Blazor helpers.
* [Blazor] Adds a project template option for individual auth
* Handles hosted scenarios with Identity Server.
* Handles non-hosted scenarios with oidc-client.js.
* Handles AAD and B2C scenarios with an MSAL library (disabled for now).
* Adds a Microsoft.AspNetCore.Components.WebAssembly.Authentication
library for performing authentication in Blazor webassembly.
* Includes a default implementation that supports OIDC capable IdPs
using oidc-client.js
* Includes multiple primitives to deal with authentication flows and
supports acquiring access tokens to call APIs.
* RemoteAuthenticatorView is responsible for handling authentication
operations at the user interface level.
* RemoteAuthenticatorService is responsible for handling the lower
level authentication details by using JavaScript interop to interact
with the underlying javascript library implementing the auth protocol.
* SignOutSessionStateManager handles CSRF protection for the logout
path.
* IAccessTokenProvider handles provisioning access tokens to call APIs.
* Update dependencies from Arcade
* Try publishing checksums
* Fix some errors
* Set RelativeBlobPath
* Fix publish location
* Centralize ChecksumExtension
* Fix use of ChecksumExtension in publishing.props
when attempting to enable client debugging on blazor-wasm an attempt to
provide a helpful message casues an ¨Unknown OS platform¨ exception
relates to #16366#12970
* Use the analyzer from the SDK when available
This prevents a build warning when building a project that contains a reference to
Microsoft.AspNetCore.Components and a netcoreapp3.0 or newer targeting Web project.
The Web SDK implicitly adds the Components.Analyzer for netcoreapp3.0 or newer targeting projects.
If the project additionally referenced this package (directly or transitively), the package would
set up a property that prevented the implicit analyzer reference. This prevented the analyzer from
being referenced twice.
There were two issues with the current approach:
a) The props file wasn't propogated via buildTransitive. Consequently transitive project references
would reference two copies of the analyzer. When these were different versions, it resulted in a compiler
warning.
b) Forward looking, this prevents newer versions of the analyzer shipped from the SDK from ever being used.
This is particularly problematic since apps are likely to reference component libraries that were previously
compiled against 3.x.
This change attempts to mitigate both of these issues:
a) We add a buildTransitive so our build targets flow
b) We knock out the analyzer added by the package if the SDK's already added it.
Fixes https://github.com/dotnet/aspnetcore/issues/18563
* Update Microsoft.AspNetCore.Components.Analyzers.targets
* Update Microsoft.AspNetCore.Components.Analyzers.targets
* Add a description
* Update Microsoft.AspNetCore.Components.Analyzers.targets
* Add service worker
* Add manifest
* Bring back BaselineTest.cs
* Add baselines for blazorwasm templates
* Add publishing test for PWA template
* Baseline fixes
* Fix baseline test logic to allow for multi-project outputs
* Remove non-blazorwasm baselines, since this branch now only covers blazorwasm
* Add test for PWA publish output
* Beginning generation of assets manifest
* Generate assets manifest including blazor outputs
* Tweaks
* Write assets manifest in JSON form
* Publish service worker
* Better API
* More resilience
* Better API again
* Make ComputeBlazorAssetsManifestItems public as people will need to customize the list
* Exclude service worker files from assets manifest
* Use web standard format for hash
* Update project template
* In assets manifest, only include items being published
* Renames
* Compute default assets manifest version by combining hashes
* Emit sw manifest in .js form
* Update service worker in project
* Actually isolate browser instances when requested during E2E tests
* E2E test for published PWA operating offline
* Fix SWAM path in template
* Clarify targets
* Mark AspNetCore projects that aren't packaged explicitly
- avoid NU5104 warnings due to confusing versioning
- `$(IsShippingPackage)` was semantically incorrect in any case
* Remove redundant `$(IsShippingPackage)` settings in `$(IsAspNetCoreApp)` projects
- default is `true` for all implementation projects
* Use `$(IsPackable)` when deciding how `$(IsAspNetCoreApp)` projects are handled
- remove all use of `$(IsShippingPackage)` for shared framework composition
- update documentation to match these changes
nits:
- remove odd default for `$(IsPackable)` in Directory.Build.targets
- no longer relevant since all `$(IsAspNetCoreApp)` projects are `$(IsShippingPackage)` too
- include more information in docs/ProjectProperties.md
* Add direct System.Text.Json references
- avoid MSB3277 warnings
The version of the runtime that projects compile against
is stamped in to the runtimeconfig.json. In an earlier change, the AspNetCoreRef version
was bumped up to 3.1.2 which causes running dotnet dev-serve to fail
if you do not have the runtime installed.
In addition, the template json allows roll-forwards to major version (5.0 versions) if that's the only version
available. We do this with the razor compiler:
https://github.com/dotnet/aspnetcore-tooling/blob/master/src/Razor/src/Microsoft.AspNetCore.Razor.Tools/runtimeconfig.template.json
* Use stable versioning in blazor-wasm
* This branch never builds the targeting pack
* Update eng/Versions.props
* Undo changes to patchconfig.props
Co-authored-by: Pranav K <prkrishn@hotmail.com>
* Update to latest ws-proxy sources
* Changes needed inside ws-proxy sources for inclusion in Microsoft.AspNetCore.Blazor.Server
* Use ILogger in ws-proxy
* Fix for /json endpoint when on HTTPS
Fixes: #16874
This is a significant simplication of our startup code model for Blazor
wasm with the goal of removing concepts that don't make much sense here.
Previously in this area we've tried to be consistent with ASP.NET Core
on the server, but it's not helping up much in WASM.
We're still leveraging some of the lessons from server-size ASP.NET
(hello CreateDefaultBuilder) but consistency is no longer a goal.
This change actually makes a bunch of scenarios better (rather than
removing features) - it's now possible to access services from the
application's DI scope and initialize them before the UI is shown
`RunAsync`.
This change also adds configuration in a central way. There's nothing in
this change that populates configuration in an automatic way, that will
come next.
* Update dependencies from dotnet/blazor
* Update version of blazor package used
* Removed obsolete WipedMethod invocation test
* react to mono.wasm to dotnet.wasm rename
* Leftover code cleanup
* [Fixes#17014] Add an auth-enabled template for Blazor WASM projects
* The template enables auth using cookies.
* Includes a UserController to return the user claims/data to the user
* Includes an IdentityAuthenticationStateProvider that fetches the
claims data from the application.
* It requires a hosted project.
* [Platform] Detect and fix certificates with potentially inaccessible keys on Mac OS (2.1) (#17560)
* [Https] Detects and fixes HTTPS certificates where the key is not guaranteed to be accessible across security partitions
* Fix dotnet dev-certs https --check
* Update logic for detecting missing certs
* Fix security command
* Update warning logic
* Check that the key is accessible in Kestrel
* Add correct link to docs
* Update src/Tools/dotnet-dev-certs/src/Program.cs
Co-Authored-By: Daniel Roth <daroth@microsoft.com>
* Update src/Tools/dotnet-dev-certs/src/Program.cs
Co-Authored-By: Daniel Roth <daroth@microsoft.com>
* Add test for 2.1
* Update src/Tools/dotnet-dev-certs/src/Program.cs
Co-Authored-By: Chris Ross <Tratcher@Outlook.com>
* Address feedback
* Fix non-interctive path
* Fix tests
* Remove a couple of test from an unshipped product
* Check only for certificates considered valid
* Switch the exception being caught, remove invalid test
Co-authored-by: Daniel Roth <daroth@microsoft.com>
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
* Fix patchconfig merge (#18389)
* Fix flaky HubConnectionHandler test (#18391)
Co-authored-by: Javier Calvarro Nelson <jacalvar@microsoft.com>
Co-authored-by: Daniel Roth <daroth@microsoft.com>
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Co-authored-by: Brennan <brecon@microsoft.com>
* Added the survey link to the Blazor Server project
* Use new survey link for server project
* Updated the baseline to include the SurveyPrompt.razor file
* Added the SurveyPrompt.razor to all the test baselines
* Add support for IAsyncEnumerable<T> where T is value type (#17154)
* Add support for IAsyncEnumerable<T> where T is value type
Fixes https://github.com/aspnet/AspNetCore/issues/17139
* Fixup ref asm
* undo changes to blazor.server.js
- match changes that are in 'release/3.1' but not 'release/3.0'
- e.g. `StaticComponentRenderer`'s namespace change and newly-added members
- redo GenAPI exclusions
- remove some unecessary workarounds getting in the way of keeping up w/ API changes
- add more GenAPI exclusions, enabling `--all` without hitting dotnet/arcade#4488
* Remove useless src/PackageArchive files
- not used outside 2.x branches
* Improve use of ref/ assemblies
- compile against ref/ assemblies but do not change package metadata
- update the metadata of implementation projects to include the ref/ assembly path
- update `@(ReferenceAssembly)` metadata for Extensions packages, not `@(PackageReference)`
- can be disabled using `$(CompileUsingReferenceAssemblies)` e.g. when generating ref/ projects
- include ref/ projects in source build by default
- remove `$(ExcludeFromSourceBuild)` overrides from ref/ project files
- use latest package references and use project references even when _not_ building the targeting packs
- restore previous `@(Reference)` -> `@(PackageReference)` logic
- add build-only Microsoft.Internal.Extensions.Refs package reference in most cases
- remove IndirectReferences.props and `@(_ExtensionInternalRefAssemblies)`; no longer needed
* Improve ref/ project generation
- use ../src/**/AssemblyInfo.cs files instead of including attributes in *.Manual.cs files
- for same reason, copy `@(InternalsVisibleto)` items from src/ to ref/ projects
- use eng/targets/CSharp.ReferenceAssembly.props instead of ref/Directory.Build.props files
- use TFM-specific *.Manual.cs files in ref/ project files instead of ref/Directory.Build.props files
optimizations and usability improvements:
- add `$(BuildMainlyReferenceProviders)` property to focus on reference providers when generating ref/ projects
- disable `$(UseReferenceAssemblyInImplementation)` to avoid using ref/ projects while generating them
nits:
- clean up whitespace and remove blank lines in ref/ project files
* Perform smaller cleanup
- remove `$(IsTargetingPackPatching)`; use only `$(IsTargetingPackBuilding)`
- remove `$(DisableServicingFeatures)`; enable the servicing features we need
- suppress baseline references even in servicing builds
- restore `$(AdditionalGenApiCmdOptions)`; useful when updating *.Manual.cs files
nits:
- simplify conditions using `$(HasReferenceAssembly)`
- correct spelling in comments
- shorten long lines
* Use a response file for GenAPI commands
- work around dotnet/arcade#4021 and help with additional ref assemblies
- mimic 111462e0c2 and integrate w/ other changes here
* Undo some manual ref/ project changes
- now done automatically or centrally
- remove manual `[TypeForwardedTo]` and `[InternalsVisibleTo]` attributes
- fully qualify a type now that `using` is gone
- remove dupe `@(Compile)` items for *.Manual.cs files; included in the ref/ project files
- remove redundant `$(AllowUnsafeBlocks)` and `$(NoWarn)` settings
nits:
- rename a *.Manual.cs file that's not TFM-specific
- remove `private` members
* Correct use of `@(ProjectReference)` items for reference providers
- use `@(Reference)` instead
* Remove recently-added `@(Compile)` and `@(Reference)` items
- were added due to missing `[InternalsVisibleTo]` attributes in ref/ assemblies or as early workarounds
- plus, now transitive references **Just Work™️**
- expose `ClosedGenericMatcher` in the usual (*.Manual.cs) way
- also undo Microsoft.Extensions.ApiDescription.Server workaround
* Remove `private` members from ref/ *.Manual.cs files
- not useful and bloat the ref/ assemblies
* Cleanup warnings
- avoid "CSC warning CS2008: No source files specified." building site extensions
- correct warnings (as errors) about `RenderToStringResult` being obsolete
- add Microsoft.AspNetCore.SpaServices.Tests to Middleware solution
* Remove `@(RuntimeHostConfigurationOption)` workarounds
- deps files are unaffected by new ref/ assembly handling and test projects aren't special-cased
- also execute a test previously skipped due to deps file problems
* Regenerate ref/ projects
- pick up the latest generation changes
(unclear why Mvc.RazorPages/ref/Microsoft.AspNetCore.Mvc.RazorPages.netcoreapp3.0.cs changed but works)
* Fill in missing `internal` types 1 of n
- rename Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs; need `RenderTreeFrame` type everywhere
- add types needed in unit and perf tests to *.Manual.cs files
* Clean up recent commits
- remove recently-added `private` members
- restore `_dummyPrimitive` fields in Microsoft.AspNetCore.Server.HttpSys.Manual.cs
* Add *.Manual.cs files for more projects
* !fixup! fields in *.Manual.cs `struct`s
- GenAPI sometimes generates `_dummy` and `_dummyPrimitive` fields _instead of_ visible members
- what GenAPI generates sometimes have the right length but actual fields don't hurt
- that is, using the real fields corrects both the visible API and `struct`s' sizes
nits:
- consolidate `namespace`s in Microsoft.AspNetCore.Mvc.Core.Manual.cs
* Remove special case for generating ref/ projects on non-Windows
- referenced issue was closed with no action but workaround still not required
- no tabs in generated content
* Only create ref/ projects for assemblies in the shared framework
- restrict when `$(HasReferenceAssembly)` is `true` by default
- add warnings when `$(IsAspNetCoreApp)` or `$(HasReferenceAssembly)` have unexpected values
* Remove "extra" ref/ projects
- associated implementation projects no longer have `$(HasReferenceAssembly)` set to `true`
* Add a few GenAPI exclusions
- see dotnet/arcade#4488
- generation for these members leads to NREs
* Add more `internal` types and members
- Identity/Core
- Identity/Extensions.Core
- Mvc/Mvc.ViewFeatures
* Add direct dependencies to work around CS1705 errors
- add direct references to some test and sample projects to make intent clear i.e. address CS1705 root cause
- these projects must use implementation assemblies for those direct references
- requirement also applies to anything depending on them e.g. functional tests
- for simplicity, use `$(CompileUsingReferenceAssemblies)` instead of targeted `@(Reference)` metadata
- leads to ~40 projects that do not themselves add ref/ metadata
- this is _not_ transitive i.e. it applies only to projects that override `$(CompileUsingReferenceAssemblies)`
* nits: Remove a few more `private` members in *.Manual.cs files
* !fixup! correct namespaces of a few types in *.Manual.cs files
* Try another way to fix Microsoft.AspNetCore.Blazor.Build.Tests
* Try another way to fix missing targets in Web.JS.npmproj
* Update dependencies from https://github.com/aspnet/Blazor build 20191121.2
- Microsoft.AspNetCore.Blazor.Mono - 3.1.0-preview4.19571.2
* Update dependencies from https://github.com/aspnet/Blazor build 20191126.1
- Microsoft.AspNetCore.Blazor.Mono - 3.1.0-preview4.19576.1
* Update dependencies from https://github.com/aspnet/Blazor build 20191126.2
- Microsoft.AspNetCore.Blazor.Mono - 3.1.0-preview4.19576.2
* Add missing extensions feed
Seems like the feed with stable versions has been deleted in the updated. I've re-added it and that should fix the existing restore issues.
* Pass an empty array to entry point
Fixes https://github.com/aspnet/AspNetCore/issues/17419
* Use System.Reflection.Metadata to generate BootConfig
* Remove reference to Mono.Cecil
* Remove support for auto embedded css \ js
* Remove blazor.webassembly.js
- #13864
- use latest Arcade from '.NET 3 Tools'
- pick up @joeloff's #4083 signing validation fixes
- update signing validation exclusions to get them working
- remove custom embedded package icon bits and use Arcade approach
- also switch VS.Redist.* packages to use license expressions
* Make constraint cache thread safe
Fixes: #17101
This changes the constraint cache to use ConcurrentDictionary. This code
is invoked in a multithreaded way in Blazor server resulting in internal
failures in dictionary.
Since this is a threading issue there's no good way to unit test it, but
I noticed we're missing tests in general for this class, so I added a
few for the caching behavior.
* PR feedback
* Now works on ns2.1, but links too much
* Now only link System.* assemblies
* Clean up. Also link Microsoft.Extensions.* now too, since it works.
* x-plat slash consistency
* Change all Blazor.* projects to netstandard2.1
* Further TFM updates
* Stop linking Microsoft.Extensions for now, since it requires a more detailed treatment to avoid breaking things