Commit Graph

20810 Commits

Author SHA1 Message Date
Pranav K d9dd46ec8e
Use StaticWebAssetBasePath if specified to calculate blazorwasm publish paths (#27896)
In 3.2, Blazor WebAssembly had a feature which allowed prefix the relative path within the PublishDir
by configuring a StaticWebAssetBasePath property in the project file. As part of migrating to 5.0, this
feature was (accidentally) not brought forward which is remedied by this commit.

* Use StaticWebAssetBasePath to calculate asset base paths
* Add publish tests to verify hosted and standalone scenarios

Fixes https://github.com/dotnet/aspnetcore/issues/27776

Co-authored-by: Artak <34246760+mkArtakMSFT@users.noreply.github.com>
2020-11-20 23:46:31 -08:00
Pranav K 26c2891c60
Default the timezone to UTC if it is not resolved. (#27505)
Browsers may not correctly resolve the machine's timezone in some cases. In the current implementation,
this results in an exception being thrown by .NET Core (WASM). This code defaults the timezone to UTC
when the timezone cannot be resolved.

Fixes https://github.com/dotnet/runtime/issues/44154
Port of https://github.com/dotnet/aspnetcore/pull/27444

Co-authored-by: Artak <34246760+mkArtakMSFT@users.noreply.github.com>
2020-11-20 23:45:49 -08:00
Hao Kung a2c983c1fb
Ship the Identity.Specification.Tests package again (#28024)
Description
This package is a collection of tests which we have shipped which allows customers who have implemented their own identity stores to verify that their stores behave as expected. Our quarantine process introduced some internal dependencies to this package during 5.0, which resulted in us no longer shipping this package.

Customer impact
Customers were relying on using this library to ensure that their implementations worked against our identity manager implementations.

Regression
Yes. Regression from 3.2

Risk
Low. We currently run our CI tests against this package, this just allows customers to once again be able to run our tests on their CI builds.
2020-11-20 15:02:20 -08:00
Javier Calvarro Nelson 6bb4a3f370
[Blazor] Fixes issues with route precedence (#27907)
Description
In 5.0 we introduced two features on Blazor routing that enable users to write routing templates that match paths with variable length segments. These two features are optional parameters {parameter?} and catch all parameters {*catchall}.

Our routing system ordered the routes based on precedence and the (now false) assumption that route templates would only match paths with an equal number of segments.

The implementation that we have worked for naïve scenarios but breaks on more real world scenarios. The change here includes fixes to the way we order the routes in the route table to match the expectations as well as fixes on the route matching algorithm to ensure we match routes with variable number of segments correctly.

Customer Impact
This was reported by customers on #27250

The impact is that a route with {*catchall} will prevent more specific routes like /page/{parameter} from being accessible.

There are no workarounds since precedence is a fundamental behavior of the routing system.

Regression?
No, these Blazor features were initially added in 5.0.

Risk
Low. These two features were just introduced in 5.0 and their usage is not as prevalent as in asp.net core routing. That said, it's important to fix them as otherwise we run the risk of diverting in behavior from asp.net core routing and Blazor routing, which is not something we want to do.

We have functional tests covering the area and we've added a significant amount of unit tests to validate the changes.
2020-11-20 11:43:11 -08:00
Safia Abdalla 222a218187
Bump Selenium dependency versions (#27947) (#28001)
* Bump Selenium dependency versions (#27947)
* Fix up package references for Selenium deps
2020-11-19 17:24:52 -08:00
Pranav K f1ed2df88f
Include .Views.dll from single file in .NET Core 3.1 apps (#27897)
For 5.0, we made a change to exclude .Views.dll from the single file bundle as a reaction
to changes in bundling. However the SDK change also applied to .NET 3.1 apps. This change
limits the exclusion to 5.0 and newer apps.

Fixes https://github.com/dotnet/aspnetcore/issues/27831
2020-11-19 11:41:00 -08:00
Safia Abdalla de177e3a80
Pass file path with runtime version to hash generator (#27835)
Description
This pull request addresses an issue reported by users in #27752 in which the integrity checks that occur in the browser for assemblies loaded by a Blazor WebAssembly application incorrectly fail after a user upgrades their application from one version to another. This occurs because our MSBuild targets don't correctly update the compressed assemblies when a user upgrades, which results in the non-compressed assemblies and integrity hash pointing to the new version but the compressed assembly pointing to the old version which causes an integrity check failure.

Technical Description

The GzipCompression task iterates through a list of provided FilesToCompress and determines whether or not a file needs to be updated by checking to see if the input file is older than the compressed file that already exists in the intermediate output path.

aspnetcore/src/Components/WebAssembly/Sdk/src/GZipCompress.cs

Lines 45 to 50 in 45540f7

 if (File.Exists(outputRelativePath) && File.GetLastWriteTimeUtc(inputPath) < File.GetLastWriteTimeUtc(outputRelativePath)) 
 { 
     // Incrementalism. If input source doesn't exist or it exists and is not newer than the expected output, do nothing. 
     Log.LogMessage(MessageImportance.Low, $"Skipping '{inputPath}' because '{outputRelativePath}' is newer than '{inputPath}'."); 
     return; 
 } 
The outputRelativePath used in the comparison above is a hashed value generated from the the RelativePath which is set to wwwroot/_framework/Microsoft.CSharp.dll for example. If a user changes from version 5.0-rc2 to 5.0 of a package, then the RelativePath will be the same whereas the FullPath will be ~/.nuget/packages/microsoft.netcore.app.runtime.browser-wasm/5.0.0/runtimes/browser-wasm/lib/net5.0/Microsoft.CSharp.dll compared to /Users/captainsafia/.nuget/packages/microsoft.netcore.app.runtime.browser-wasm/5.0.0-rc.2.20475.5/runtimes/browser-wasm/lib/net5.0/Microsoft.CSharp.dll.

By passing the FullPath we are able to account for the package version in the generated output which will cause a unique hash to be generated for different package versions and the File.Exists check in the conditional to fail and result in the new gzipped outputs being generated as expected.

Customer Impact
This bug was reported by multiple customers after the release of .NET 5. The bug makes the upgrade experience between .NET versions a lot rougher since users run into unexpected exceptions in their apps at runtime. Viable workarounds for this include running dotnet clean before building the project after an upgrade.

Regression?
This is not a regression, but the issue is more serious since users are upgrading from Blazor WASM 3.2 to Blazor WASM 5 or from a 5.0 RC to the RTM.

Risk
The risk associated with this change is relatively slim, because:

Manually validation was completed
The behavior implemented in the changeset mimicks what we already do in the Brotli compression
The impact area is only limited to Blazor WASM apps running in development
2020-11-16 22:56:18 -08:00
John Luo 807e8ccd47
Fix API baseline check when building site extensions (#27841)
* Include API files when building site extensions

* Test SiteEx build on PR

* Revert test code

* Disable the check all together

* revert test change
2020-11-15 01:05:55 +00:00
Pranav K b34c5ddd5f
Prevent dotnet-watch script injection staleness (#27778)
The browser refresh mechansim used by dotnet-watch and VS modifies HTML content. The modified content includes
a script block that has a WebSocket url that changes for each new execution of dotnet watch run (not rebuilds, but watch itself).
HTML content can come from views or static html files on disk. For the latter, ASP.NET Core participates in browser caching by sending (and invalidating) etag headers.

One way to fix this problem is remove or modify the etag headers. The risk here is that might cause differences in behavior in development users may come to rely on that are unavailable in production. This change instead modifies the HTML content so the output is always consistent and consequently safe to cache. The dynamic content is served separately by the injected middleware.

This change fixes the issue of multiple instances of dotnet-watch. While this issue may crop up if you alternate between dotnet run and dotnet watch run but we haven't seen this being an issue as yet.

Fixes #27548

Summary
Running dotnet watch run multiple times in Blazor WASM apps (or any app that serves static html files) can produce console errors and prevent the browser refresh feature from working. Given that we've been telling our users to use dotnet watch run as their primary way to work outside of VS, it's likely more users would run in this.

Customer impact
A hard browser refresh (Ctrl + R) is needed to get the refresh behavior to work.

Regression
No. This has existed since the feature was introduced we did not get reports of it

Risk
Low. The fix is isolated to dotnet-watch and VS's browser refresh mechanism which is in preview. The change was tested locally, but if there's a regression or if the change interferes with user's workflow, users have the ability to disable this feature.
2020-11-13 14:25:47 -08:00
Steve Sanderson fc1ebaaaa6
Make link click interception work with elements inside open shadow roots. Fixes #27070 (#27587)
Description
HTML <a> elements within shadow roots are invisible to the link click interception code. So when an end user clicks on a link that's inside the shadow root of a custom element, it triggers a full page load instead of a client-side navigation.

Customer Impact
Reported by a customer at #27070. There's no reasonable workaround (besides not using custom elements and shadow DOM).

The impact is that if you're using a library of custom HTML elements, which typically use ShadowDOM to render, then if you use them to produce any links, then those links will seem broken to the end user (as in, they trigger a full-page reload, destroying any app state in WebAssembly memory or discarding the Blazor Server circuit).

Regression?
No, this has always been the case. However, the use of custom elements and ShadowDOM is a growing area, especially as we try to guide customers to use custom elements like the FAST components.

The fact that this use case is growing in importance makes it relevant to consider patching rather than waiting a full year for 6.0.

We don't have to ship this in 5.0.1, but we should be prepared to ship it in a patch reasonably soon.

Risk
This changes the logic for processing clicks on all links, not just the ones in shadow roots. Although I'm not aware of any cases where the new logic might fail, and all our E2E tests pass, maybe I missed some case. It's unfortunate we don't have any opportunity to put this in front of customers any any preview form.
2020-11-13 12:29:13 -08:00
Hao Kung 6108c0d03e
Fix SignInResult with default scheme (#27531)
Description
Fixes #27494

A community PR introduced new overloads to ControllerBase for SignIn. The new overload throws due to an existing check which blocks when the scheme is null. The fix is to remove this unnecessary check. Note SignOutResult already had test coverage for this usage and is unaffected

Customer Impact
The bug was reported by a customer trying to use the new overload. The fix enables the method to be used.

Regression?
No

Risk
Low as this is a new API, and the api was unuseable in its current form.
2020-11-13 12:02:59 -08:00
Safia Abdalla 135f7820d1
Update dependencies in SPA templates (#27219)
Description
This PR updates the version of the caniuse-lite dependency to the latest version on our React and React/Redux SPA templates. The caniuse-lite dependency provides a database of browser features and their support across different browsers (as seen in caniuse.com). We were getting a warning because the dependency was out-of-date which meant that it was reporting compatibility info that was no longer accurate.

This PR also updates the version of node-sass to the latest version which no longer depends on the no-longer-supported Python 2.

Customer Impact
This bug was discovered during CTI validation.

This bug has a low severity because the user application can still run although JavaScript-based build tooling might report that the developer is leveraging browser features that aren't supported by the browser when they actually are.

Users can workaround this by running npx browserslist@latest --update-db inside their ClientApp directory. Users can also manually upgrade node-sass to v5 by editing their package.json file.

Regression?
No.

Risk
Low risk, because:

Change was validated manual
This fix applies the changes recommended by the browserlist library
2020-11-13 12:00:32 -08:00
Doug Bunting 415875625c
[release/5.0] Update API baseline files (#27653)
* Move all PublicAPI.Unshipped.txt files to PublicAPI.Shipped.txt
- we have now shipped this API surface

* Add eng/PublicAPI.empty.txt file
- make it easier to add new implementation projects

* Add missing public API baseline files
- #26784 part 1/2
- a few unexpected files turned up missing beyond the #26784 list&hellip;

* Reference Microsoft.CodeAnalysis.PublicApiAnalyzers more often
- #27484 part 2/2
- emit errors when API baseline files are missing
- update categorization of some projects
  - specification tests are not implementation projects
    - but _were_ project reference providers (keep that)
  - correct `$(IsTestAssetProject)` setting for Razor shims et cetera
  - correct `$(IsSampleProject)` setting for casing of some Sample directories
  - Microsoft.AspNetCore.Analyzer.Testing should be treated as test asset
- add `$(AddPublicApiAnalyzers)` property to support overrides
  - e.g. for `msbuild` task projects and tools

nit:
- remove useless `$(IsTestProject)` setting in a specification test project
- wrap some long `Condition`s

* Do not run public API analyzer in `RazorCoreCompile` target

* Remove old `$(EnableApiCheck)` settings
- property does nothing
- also remove a dangling ApiCheck comment
2020-11-12 10:28:52 -08:00
Eric StJohn 4d47720df2
Ensure AppLocalResolver handles package with multiple libs (#27751)
* Ensure AppLocalResolver handles package with multiple libs

This was failing to pass references to a package which contains more
than one lib.

* Use `AppBaseCompilationAssemblyResolver` in `DiagnosticProject`

* Fix, then reduce use of `TestPathUtilities.GetSolutionRootDirectory(...)` (#27404)

- do not traverse up past the `$(RepoRoot)` when running tests locally
  - if `$(RepoRoot)` is reached, search down for named `*.slnf` file
  - find `*.slnf` file when `$(OutputPath)` is under artifacts/bin/
- analyzer test projects publish needed files anyhow
  - remove `GetProjectDirectory()` helpers

Co-authored-by: Doug Bunting <6431421+dougbu@users.noreply.github.com>
2020-11-12 10:09:40 -08:00
Doug Bunting 352ad1a980
Rebrand and update for 5.0.1 (#27406)
* Move to 5.0.1 versions

* Move to GA .NET SDK
- required for some tests to pass

* Remove feeds that won't be needed after 5.0.0 is GA

* Cherry-pick `$(CrossgenOutput)` and Directory.Build.*.in changes from master
- [master] Update dependencies from dotnet/runtime dotnet/efcore (#26788)
    - 219ecd688012
- when project template tests run test assets, need latest shared Fx bits
- hit `BadImageFormatException`s otherwise
    - test projects build against uploaded packages
    - those packages reference the 5.0.1 shared framework
    - the ASP.NET parts of the 5.0.1 shared Fx are `crossgen`ed to target Windows

- Use runtime and ref/ assemblies matching repo in Helix testing
    - add Directory.Build.*.in files based on project template test infrastructure
    - use files as import boundary where the project doesn't create its own Directory.Build.* files
    - ensure `dotnet-watch` tests also use the latest runtime and ref/ assemblies

- Extend Helix Directory.Build.* workarounds
    - generate Directory.Build.* files when restoring any projects
    - include generated files in Helix runs needing the latest runtime
    - copy generated files when testing `dotnet-watch` locally
    - include generated content in Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests test assets
        - remove duplicate settings from existing Directory.Build.* files
    - ensure shared framework and targeting packs are laid out under .dotnet/ before test assets restore

- Disable `crossgen` when building for Helix runs
    - make `$(CrossgenOutput)` property override-able
    - use override in CI jobs that submit to other platforms
        - for now, leave the ARM64 Helix jobs alone (build on Ubuntu, run in Debian)

* Correct an `$(IsTestAssetProject)` setting
- affected projects are all test assets or provide test support
- without this, a number of the projects are incorrectly marked as shipping

* Baseline released 5.0.0 packages
- this is a complete rewrite of eng/Baseline.xml
  - based on the 5.0.0 MergedManifest.xml file

* Add 5.0.0 PackageOverrides.txt and PlatformManifest.txt files
- need consistent versions when servicing targeting packs

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
2020-11-10 09:51:47 -08:00
Doug Bunting ca8cc104f4
[release/5.0] Target 5.0.0 shared framework in global tools (#27599)
- #19108
- ensure the packaged runtimeconfig.json file uses the 5.0.0 shared framework
  - disable `$(TargetLatestDotNetRuntime)` in tool projects
  - skip `@(FrameworkReference)` item update if `$(TargetLatestDotNetRuntime)` is disabled

nit: Move `$(PackAsTool)` settings together
2020-11-10 09:46:06 -08:00
dotnet-maestro[bot] 371a26f07b
[release/5.0] Update dependencies from dotnet/efcore (#27189)
[release/5.0] Update dependencies from dotnet/efcore


 - Quarantine flaky test
2020-10-26 22:25:32 +00:00
Stephen Halter c15cd69b65
Prevent WebSockets from throwing during graceful shutdown (#27123)
- Fix canceled ReadResult handling in Http1UpgradeMessageBody
- Add UpgradeTests.DoesNotThrowGivenCanceledReadResult
2020-10-23 11:05:58 -07:00
Steve Sanderson d052b22874
Ensure ReadRequest type can be loaded on server. Fixes #26882 (#26931) 2020-10-15 15:41:14 -07:00
Steve Sanderson e43041d75f
Make Virtualize recover from having incorrect ItemSize info. Fixes #25915 (#26933) 2020-10-15 15:39:09 -07:00
Pranav K 753dad3e3f
Re-enable assertion for pdbs during WASM publish (#26912)
Fixes https://github.com/dotnet/aspnetcore/issues/25135
2020-10-15 09:23:18 -07:00
Javier Calvarro Nelson dd2754c2c9
Fix up to date check (#26891)
Description
We had support for the UpToDateCheck in Visual Studio with CSS isolation but the target was not being run at design time. This change introduces a new target that runs at design time and makes sure the UpToDateCheckInput and UpToDateCheckBuilt ItemGroups are populated.

Customer Impact
When using CSS isolation from within Visual Studio, a change in a scoped CSS file is not picked up and the project is not rebuilt as a result.
Regression?
No. This feature was introduced in 5.0.

Risk
Low. The new target we added only runs as part of Visual Studio builds.

Fixes
#26843
2020-10-14 22:29:45 -07:00
Pranav K fae3437139
Add docs for remaining security items (#26827)
* Add docs for remaining security items

* Google / Facebook / Microsoft Account auth
* Authorization, Authorization.Policy

Contributes to https://github.com/dotnet/aspnetcore/issues/26397

* Apply suggestions from code review

Co-authored-by: Chris Ross <Tratcher@Outlook.com>

* Update src/Security/Authorization/Policy/src/AuthorizationMiddleware.cs

Co-authored-by: Chris Ross <Tratcher@Outlook.com>
2020-10-14 15:36:26 -07:00
Steve Sanderson 86705673c7
XML docs for Middleware: Localization, Localization.Routing, ResponseCompression (#26889)
* XML docs for Middleware/Localization and Localization.Routing

* XML docs for Middleware/ResponseCompression
2020-10-14 14:02:24 -07:00
Matt Mitchell a0ab0964d4
[release/5.0] Fix some post-build signing issues (#26506)
* Fix some post-build signing issues
This fixes some post-build signing issues that are present in the aspnetcore repo
1. Add the .msi extension to be signed by Microsoft400 - Msis must be signed. With in-build signing these get handled explicitly by the wixproj infrastructure. When we do post build signing, we must sign these files.
2. Remove the strong name exclusions. These exclusions are incorrect when applied in post-build and unnecessary for in-build signing. Most importantly, the aspnetcore PKT would not end up re-strong named (it doesn't need to be strong name signed by ESRP since it's strong named in-build) because the PKT doesn't match any of the StrongNameSignInfo specified in arcade. The rest of the entries seem to be mostly about optimization. I could not find any performance difference between these entries being present and not. I am not sure whether they actually even apply to any assets. Moreover, when doing post-build signing, they would conflict with the entries in runtime and other places.

Verification - I have a tool that I wrote which unpacks every file between two directories and compares the strong name, nuget, and authenticode certs between equivalent files. This is the same tool being used to verify post-build signing. This tool shows no difference in any aspnetcore produced asset.

Baseline: https://dev.azure.com/dnceng/internal/_build/results?buildId=836183&view=results
Diff: https://dev.azure.com/dnceng/internal/_build/results?buildId=837176&view=results

* Do not push VS packages for installers when PostBuildSign == true

* Output wix command packages to the installers output path

* Don't import microbuild signing targets from wix when PostBuildSign=true

* Tweaks:
- Don't sign wixpacks when not in post-build signing
- Generate a wixpack for both the original msi name (which the wixproj generates) AND the name we use in the final outputs. This is because while these files are the same, signing differentiates the certificate based on the file name, and wixpack lookup is also based on the file names. Aspnetcore and other repos have uses the final outputs (e.g. dotnet-aspnetcore-runtime-123.5..) as well as the internal names (e.g. AspNetCoreSharedFramework_x64.msi).
- Don't sign msi's when not post-build signing.

* Avoid generating sha512 files for wixpack zips

* Don't run xplat code sign jobs if PostBuildSign == true

* Change original target names

* Conditionalize codesign operations

* Add publishing flag for linux x64 and add deb sha512 generation

* Do not push the x64 linux runtime archive more than once
2020-10-14 10:19:10 -07:00
dotnet-maestro[bot] aa50176707
[release/5.0] Update dependencies from dotnet/arcade (#26817)
[release/5.0] Update dependencies from dotnet/arcade


 - `NETCOREAPP5_0` -> `NET5_0`

 - Add PublishIISAssets To Fix Test
2020-10-14 04:35:26 +00:00
Javier Calvarro Nelson 901bf9ba43
[Blazor] Missing IAsyncDisposable implementation on renderer (#26848)
* Implement async disposable on the renderer

* Minor cleanups
2020-10-13 13:50:54 -07:00
Phil Henning 905777ca5b
Update localized strings.json (#26853)
* Update localized strings.json

* Add missing CSharp worker service update
2020-10-13 13:35:21 -07:00
Pranav K b3aa220af6
Quarantine flaky test (#26627) 2020-10-12 15:02:50 -07:00
Doug Bunting 8399c9f3f9
!!! Correct condition controlling `public` API analysis !!! (#26797)
* !!! Correct condition controlling `public` API analysis !!!
-  #26785 demonstrated analyzers were inoperable

* Remove unused `public` API files

* Update `public` API files
- three Components files were missing `#nullable enable`
- `nullable` annotations missing or out-of-date elsewhere

* Ignore `public` API files completely during source build
- do not warn about unused files

* Update more `public` API files
2020-10-12 11:07:18 -07:00
Stephen Halter ff6d1986ac
Add docs for Session, Diagnostics.EntityFrameworkCore, MiddlewareAnalysis and HeaderPropagation (#26720) 2020-10-09 20:38:45 -07:00
William Godbe bc3dc72700
Fix path data in FrameworkList.xml (#26622)
* Fix path data in FrameworkList.xml

* Move FrameworkList.xml to SharedFxRoot

* Fix targeting pack xml test

* Add test

* Add another test

* Extract .xml files to Helix as well

* Add another test

* Update TestRunner.cs

* Remove slash
2020-10-09 11:06:15 -07:00
Stephen Halter 053052d405
Remove KestrelEventSource events with broken ActivityId tracking (#26684)
* Remove KestrelEventSource events with broken ActivityId tracking

* Skip test requiring ALPN on macOS
2020-10-08 11:47:48 -07:00
Safia Abdalla 84e9f56bca
Resolve issue with readLazyAssembly returning stale value (#26642)
* Resolve issue with readLazyAssembly returning stale value

* Address feedback from peer review

* Update test to exercise loaded package
2020-10-07 22:57:13 -07:00
William Godbe 8118a25e7f
Add API ref docs for HTTPSys (#26649)
* Add API ref docs for HTTPSys

* Spacing

* Feedback
2020-10-07 22:28:49 -07:00
Brennan 5b6362f29a
Enable test logging for ProjectTemplate tests (#26507)
* Enable test logging for ProjectTemplate tests

* Add logging to templates

* some updates

* nullref
2020-10-07 14:37:33 -07:00
John Luo 8555002772
Add an option to allow 404 responses from ExceptionHandlers (#26567) 2020-10-06 10:23:58 -07:00
William Godbe d5b5f08a4f
Cast ByteBuffer to Buffer before calling position(int) (#26614)
* Cast ByteBuffer to Buffer before calling position(int)

* Add comments
2020-10-06 10:17:57 -07:00
Pranav K 8b741bd9c6
Add docs for Negotiate, OAuth, OpenIdConnect (#26610)
* Add docs for Negotiate, OAuth, OpenIdConnect

Contributes to #26397
2020-10-06 08:41:47 -07:00
Sourabh Shirhatti fda7d1d660
Preserve client order of activity baggage items (#26302) (#26395)
Co-authored-by: Andrey Tretyak <andreyt@microsoft.com>
2020-10-05 14:29:39 -07:00
Stephen Halter 96c082f285
Fix WebSockets Negotiate Auth in Kestrel (#26480)
* Don't close connections after upgrade requests without a 101 response

* Add test

* Add DefautCredentials_WebSocket_Success
2020-10-02 14:47:20 -07:00
John Luo 8eb9603a9c
Api docs for Diagnostics middlewares (#26525)
* Api docs for Diagnostics middlewares

* Update ExceptionHandlerFeature.cs

* Update StatusCodePagesMiddleware.cs

* Update ExceptionHandlerMiddleware.cs

* Apply suggestions from code review

Co-authored-by: Pranav K <prkrishn@hotmail.com>

Co-authored-by: Pranav K <prkrishn@hotmail.com>
2020-10-02 20:54:37 +00:00
John Luo ce2e3bc723
Api docs for HttpOverrides (#26530)
* Api docs for HttpOverrides

* Update ForwardedHeadersExtensions.cs

* Update ForwardedHeadersOptions.cs

* Feedback

* Add more details

Co-authored-by: Pranav K <prkrishn@hotmail.com>
2020-10-02 20:42:18 +00:00
Hao Kung 0a52bb721c
API docs for Components (#26505)
* Turn on doc warnings

* Api ref stuff

* Add api docs

* Api docs

* Missing docs

* Add docs

* Update src/Components/WebAssembly/WebAssembly.Authentication/src/Services/ExpiredTokenException.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

Co-authored-by: Pranav K <prkrishn@hotmail.com>
2020-10-02 13:22:14 -07:00
Pranav K e755f6017c
Add docs for Auth, Auth.Cookies, Auth.Certificate (#26503)
* Add docs for Auth, Auth.Cookies, Auth.Certificate

Contributes to https://github.com/dotnet/aspnetcore/issues/26397

* Also add JWT

* Apply suggestions from code review

Co-authored-by: Hao Kung <HaoK@users.noreply.github.com>
Co-authored-by: Chris Ross <Tratcher@Outlook.com>

* Update src/Security/Authentication/Core/src/TicketSerializer.cs

* Update src/Security/Authentication/Core/src/TicketSerializer.cs

* Update src/Security/Authentication/Core/src/TicketSerializer.cs

* Apply suggestions from code review

Co-authored-by: Hao Kung <HaoK@users.noreply.github.com>
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
2020-10-02 13:12:16 -07:00
John Luo acf1dc45c0
Api docs for ResponseCaching (#26531)
* Api docs for ResponseCaching

* Enable warnings for HostFiltering, HttpsPolicy and StaticFiles

* Update src/Middleware/ResponseCaching/src/ResponseCachingFeature.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Add more details

Co-authored-by: Pranav K <prkrishn@hotmail.com>
2020-10-02 18:58:34 +00:00
Brennan 659532b16c
API docs for SignalR (#26445)
* API docs for SignalR

* Apply suggestions from code review

Co-authored-by: Stephen Halter <halter73@gmail.com>
Co-authored-by: Pranav K <prkrishn@hotmail.com>

Co-authored-by: Stephen Halter <halter73@gmail.com>
Co-authored-by: Pranav K <prkrishn@hotmail.com>
2020-10-02 10:14:32 -07:00
Safia Abdalla cd94cd63b7
Add documentation for Routing surface area (#26513)
* Add documentation for Routing surface area

* Apply suggestions from code review

Co-authored-by: James Newton-King <james@newtonking.com>

* Fix up some doc strings

Co-authored-by: James Newton-King <james@newtonking.com>
2020-10-02 10:10:56 -07:00
Pranav K 63baa06482
Use assertion library more consistently (#26519)
Using Browser.Exists is equivalent to Browser.FindElement except it provides better logs
and diagnostics when the assertion fails. The additional waits will also rule out
failures due to the browser taking time to update possibly improving stability.

I looked at the implementation of WebDriverWait to verify that using it will not
introduce additional delays to our tests.
2020-10-02 09:44:02 -07:00
Hao Kung 854b4aad4d
Remove photo from showprofile (#26253) 2020-10-02 09:21:29 -07:00
Hao Kung 5e2259f4bb
Add MVC.Core api docs (#26469)
* Add docs

* Add api docs

* Add xml doc

* Reenable warnings on identity projects

* Razor pages docs

* Add doc

* Missed files

* Add docs

* Apply suggestions from code review

Co-authored-by: Safia Abdalla <safia@microsoft.com>

* Apply suggestions from code review

Co-authored-by: Safia Abdalla <safia@microsoft.com>

* PR feedback

* Update src/Mvc/Mvc.Core/src/ConsumesAttribute.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidationVisitor.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update src/Mvc/Mvc.Core/src/Routing/UrlHelperBase.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidationVisitor.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update src/Mvc/Mvc.Core/src/Infrastructure/FileResultExecutorBase.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update src/Mvc/Mvc.RazorPages/src/DependencyInjection/MvcRazorPagesMvcCoreBuilderExtensions.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update src/Mvc/Mvc.Core/src/Routing/UrlHelperBase.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update src/Mvc/Mvc.RazorPages/src/DependencyInjection/MvcRazorPagesMvcCoreBuilderExtensions.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update src/Mvc/Mvc.Core/src/Routing/UrlHelperBase.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update ValidationVisitor.cs

Co-authored-by: Safia Abdalla <safia@microsoft.com>
Co-authored-by: Pranav K <prkrishn@hotmail.com>
2020-10-01 16:02:15 -07:00
William Godbe c3f89a91ab
Generate non-stable version for installer (#26064)
* Generate non-stable version for installer

* Fix versions

* Add upgrade codes for 3.1.0-3.1.8

* Fixup

* Fixup

* Update src/Installers/Windows/SharedFrameworkBundle/Bundle.wxs

Co-authored-by: Massimiliano Donini <massimiliano.donini@gmail.com>

* Add codes for 3.1.9

Co-authored-by: Massimiliano Donini <massimiliano.donini@gmail.com>
2020-10-01 09:51:30 -07:00
Brennan 7c3a072dfd
API docs for WebSockets (#26470) 2020-09-30 20:10:49 -07:00
Safia Abdalla e2b1b20633
Add doc strings for public APIs in Http.Abstractions and Routing.Abstractions (#26468)
* Add doc strings to Http.Abstractions and Routing.Abstractions

* Address feedback from peer review

* Update src/Http/Http.Abstractions/src/ConnectionInfo.cs

Co-authored-by: James Newton-King <james@newtonking.com>

Co-authored-by: James Newton-King <james@newtonking.com>
2020-09-30 13:50:31 -07:00
Pranav K a218c3bea6
Add docs to CookiePolicy (#26446)
* Add docs to CookiePolicy

Contributes to https://github.com/dotnet/aspnetcore/issues/26397

* Apply suggestions from code review
2020-09-30 13:45:18 -07:00
Safia Abdalla 66584a0f30
Add doc strings for public APIs in src/Hosting (#26443)
* Add doc strings for public APIs in src/Hosting

* Apply suggestions from code review

Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Co-authored-by: Pranav K <prkrishn@hotmail.com>
Co-authored-by: James Newton-King <james@newtonking.com>

* Address feedback from peer review

Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Co-authored-by: Pranav K <prkrishn@hotmail.com>
Co-authored-by: James Newton-King <james@newtonking.com>
2020-09-30 13:42:05 -07:00
Stephen Halter b740b6a23b
Keep Http2Connection's ExecutionContext in middleware (#26304)
* Add Http2EndToEndTests

* Finish MiddlewareIsRunWithConnectionLoggingScopeForHttp2Requests

* Keep Http2Connection's ExecutionContext in middleware

* Restore EC before awaiting next request

* Update src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs

Co-authored-by: James Newton-King <james@newtonking.com>

* Move InitialExecutionContext to HttpConnectionContext

Co-authored-by: James Newton-King <james@newtonking.com>
2020-09-30 13:13:40 -07:00
Javier Calvarro Nelson 720f88231a
Fix policheck issues (#26433) 2020-09-30 11:55:09 -07:00
Pranav K e24064c3f6
Add docs for Authentication.Abstractions (#26438)
* Add docs for Authentication.Abstractions

Contributes to https://github.com/dotnet/aspnetcore/issues/26397

* Turn on docs warning for Authentication.Core

* Update src/Http/Authentication.Abstractions/src/AuthenticationProperties.cs

* Update src/Http/Authentication.Abstractions/src/AuthenticationProperties.cs
2020-09-30 10:52:25 -07:00
Justin Kotalik 4cb7f94fb1
Rewrite api docs (#26440) 2020-09-30 10:51:39 -07:00
Justin Kotalik 75e707bc38
API docs for IIS (#26387) 2020-09-29 14:12:28 -07:00
Steve Sanderson 67ac1675c4
Make Virtualize work in cultures that use alternate number formatting (#26432) 2020-09-29 13:17:23 -07:00
John Luo e62bd65421
Lift OIDC and JwtBearer dependencies in templates (#26390)
Reimplementing the changes originally included in https://github.com/dotnet/aspnetcore/pull/24600

Co-authored-by: Safia Abdalla <safia@microsoft.com>
2020-09-29 11:11:56 -07:00
Stephen Halter ccc59b91c4
Revert breaking KestrelServer ctor change (#26367) 2020-09-29 11:06:32 -07:00
James Newton-King 792df8a4c2
Add API docs to healthchecks and CORS (#26416)
* Add API docs to healthchecks and CORS

* Clean up

* Missing docs
2020-09-29 10:36:25 -07:00
Pranav K 0e5d7ef1d4
Attempt to read the logs from the browser (#26289)
* Attempt to read the logs from the browser

Seleniunm currently does not return log messages (See https://github.com/SeleniumHQ/selenium/issues/8229).
This making figuring out blazor WASM test failures a lot harder.

This change adds some JS to the test apps to read the console output.

* WIP
2020-09-28 17:07:22 -07:00
Pranav K de59a61f9a
Update GenericHostBuilderExtensions.cs (#26386) 2020-09-28 13:52:04 -07:00
Pranav K 6c37a763d1
Remove Microsoft.Components.Web.Extensions (#26256) (#26298)
The package was marked as non-shipping but we continued to build and test it. This change
removes it. A copy of this code exists in asplabs so all is not lost.
2020-09-25 12:14:56 -07:00
Doug Bunting eed71b9083
Support override of PackageOverrides.txt content in servicing (#26308)
* Support override of PackageOverrides.txt content in servicing
- doing now ensures we don't forget if we need to service targeting packs
- not needed in release/3.1 because that branch still pins packages at `X.Y.0` in targeting packs
  - did not do bfc1ec6792 / #25851 work in 3.1 because dotnet/runtime ref/ assemblies change there
- revert no-longer-necessary parts of 6418c8f78a / #25986
  - `$(MicrosoftNETCoreAppRuntimeVersion)` is now correct whenever `GeneratePackageOverrides` runs

nits:
- rename `GeneratePackageConflictManifest` target to `GeneratePackageOverrides`
- rename `$(PackageConflictManifestFileName)` to `$(PackageOverridesFileName)`
2020-09-25 10:54:54 -07:00
Safia Abdalla 2e7b294c6c
Revert "Disconnect circuit on 'beforeunload' event" (#26297)
* Add tests for failing disconnect scenarios

* Remove beforeunload call and add public API

* Add additional test case

* Update src/Components/test/testassets/BasicTestApp/GracefulTermination.razor

Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>

Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
2020-09-25 10:11:26 -07:00
Doug Bunting 32e3353e69
Quarantine recent test failures (#26295)
- see #26291 and #26294
2020-09-24 16:29:31 -07:00
Steve Sanderson f63e90e106
Omit omissible frames when updating rendertree to match bind event. Fixes #24014 (#26273) 2020-09-24 13:24:06 -07:00
Safia Abdalla b925b2886a
Pass all scopes in token request and update IndividualLocalAuth template (#26232)
* Pass all scopes in token request and update IndividualLocalAuth template

* Fix build and address feedback from peer review
2020-09-23 20:42:44 -07:00
dotnet-maestro[bot] 1564ca328c
[release/5.0-rc2] Update dependencies from dotnet/runtime dotnet/efcore (#26209)
[release/5.0-rc2] Update dependencies from dotnet/runtime dotnet/efcore


 - Use non-obsolete `GetColumnName(...)` overload
- react to EF breaking change

 - Add missing `using`
2020-09-23 23:25:06 +00:00
Pranav K de1bf0abe4
Detect culture change in .NET (#26192)
* Detect culture change in .NET

With ICU sharding enabled, blazor wasm attempts to detect if the application culture was changed by the
application code as part of Program.MainAsync and tell them they need to opt out of sharding.

Prior to this change, Blazor compared the .NET culture string with a JS representation for language. With iOS 14,
the two culture strings differ in casing which prevents the use of any Blazor WASM app the latest version installed.

As part of this change, the comparison is performed entirely in .NET which avoids relying on the JS representation.

* Fixups
2020-09-23 09:00:38 -07:00
Pranav K da3f97b0ad
Fix client validation for record types (#26159)
* Fix client validation for record types

Server validation for record types uses metadata from parameters
when validating record type properties. However client validation
does not use the parameter to harvest client validation attributes.

In the absence of this change, validation on parameters would require server
round trips which is unexcepted and not at parity with validation applied
to properties on regular classes or record types.

Validation experience with record types is subpar and requires server
round trips.

No. This feature is new to 5.0.

Low. The change is isolated to record types and does not affect other code paths. We have
unit and functional test coverage to verify this change.

* Correctly dispose app after use
2020-09-22 22:02:49 -07:00
William Godbe c34d1dceac
Include all .xml files in targeting pack (#26147)
* Include all .xml files in targeting pack

* Better syntax

* Remove distinct
2020-09-22 12:54:28 -07:00
Steve Sanderson 7140f7cae7
Virtualize component: method to trigger data refresh (#26177)
* E2E test cases for Virtualize data refresh

* Expose public RefreshDataAsync API

* Optimize: don't instantiate CancellationTokenSource when it won't be used

* For in-memory data, refresh automatically on each render cycle

* Fix typo
2020-09-22 11:52:16 -07:00
Safia Abdalla 93f73c7764
Add support for debugging lazy-loaded assemblies (#25943)
* Add support for debugging lazy-loaded assemblies

* Address feedback from peer review

* Increase wait for output on tests
2020-09-22 08:23:39 -07:00
Sayed Ibrahim Hashimi d97ef5ccd4
Updated icons for projects that appear in VS with icons that have the (#25974)
* Updated icons for projects that appear in VS with icons that have the
language adornment.
This PR should fix #25973.

* updating icons for asp.net core templates in vs
2020-09-21 13:04:31 -07:00
Justin Kotalik 02d81add81
Increase Http2Timeout (#26075) 2020-09-21 10:55:08 -07:00
Hao Kung 6bfffda734
Remove ComponentsWebAssembly shared layout (#26078) 2020-09-19 11:12:38 -07:00
Pranav K bf91253cd3
Increase more SignalR Java client test timeouts (#26036)
Co-authored-by: Stephen Halter <halter73@gmail.com>
2020-09-18 17:00:43 -07:00
Pranav K 140f177d9e
Converge implementations of AwaitableProcess and ProcessEx (#26069)
* Converge implementations of AwaitableProcess and ProcessEx

* dotnet-watch tests are running in to the same issue as GRPC tests (https://github.com/dotnet/aspnetcore/pull/20341/files).
This change carries over some of the patterns from the other type to remedy this issue.

* Revive dotnet-watch tests on OSX

* Remove build artifacts that were accidentally commited to source.
2020-09-18 16:32:06 -07:00
Pranav K 611ee61e0e
Quarantine tests (#26062) 2020-09-18 13:08:30 -07:00
dotnet-maestro[bot] 7e0e801bb4
[release/5.0-rc2] Update dependencies from dotnet/arcade dotnet/efcore (#26058)
[release/5.0-rc2] Update dependencies from dotnet/arcade dotnet/efcore


 - Update installers task location
2020-09-18 19:58:16 +00:00
Matt Mitchell b1b3d5474f
Enable PostBuildSign flag and include signing information in the manifest (#26033)
This change is prep for post build signing. When PostBuildSign=true, signing is not performed during the build. Instead, pass the top-level artifacts that are signable to PushToAzureDevOpsArtifacts (via Publish.proj).
Also fix up ArtifactsDir. As far as I can tell, it's been fixed up in Arcade to always include the trailing \, and Publish.proj should no longer be messed up.
2020-09-18 11:07:42 -07:00
Doug Bunting b592cf6610
Place ref/ layout where SDK can find it (#25987)
- correct Helix test failures with stable versions, where SDK's packs aren't enough

E.g. from https://dev.azure.com/dnceng/internal/_build/results?buildId=813814
``` text
...\.dotnet\sdk\5.0.100-rc.1.20379.10\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(318,5): error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly. [...\src\ProjectTemplates\test\bin\Release\net5.0\TestTemplates\AspNet.m0yq3xrporu\AspNet.m0yq3xrporu.csproj]
...\.dotnet\sdk\5.0.100-rc.1.20379.10\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(318,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '...\.dotnet\packs\Microsoft.AspNetCore.App.Ref\5.0.0\data\FrameworkList.xml'. [...\src\ProjectTemplates\test\bin\Release\net5.0\TestTemplates\AspNet.m0yq3xrporu\AspNet.m0yq3xrporu.csproj]
```
2020-09-17 21:03:07 -07:00
Doug Bunting 6418c8f78a
Pin PackageOverrides.txt Extensions versions at Major.Minor.0 in servicing (#25986)
- set the package version of Extensions assemblies using NETCore.App version
  - ignore Microsoft.Extensions.Internal.Transport package version
    - transport package has a non-stable version and isn't shipped
    - just got lucky this worked before versions stabilize
- update test expectations when checking PackageOverrides.txt
  - use NuGet.Versioning to make this easier
2020-09-17 21:02:46 -07:00
Brennan 3ee23fb771
Refactor transient state in Java client (#24219)
* Refactor transient state in Java client

* some fb

* fix nullref

* fixup rebase

* fb

* apply some fb

* fix flaky

* lock

* check previous state
2020-09-17 17:59:27 -07:00
Brennan 899deacb22
Fix SignalR+WebSockets on WASM (#25922)
* Fix SignalR+WebSockets on WASM

* fb

* move stuff

* select
2020-09-17 11:30:31 -07:00
Pranav K 2921f5514a
dotnet-watch: continue printing output to console after the app is ready (#25984)
dotnet-watch redirects standard out to detect when the app is launched and
prints these redirected messages to the console. Unfortunately once the app
is launched, redirected messages are no longer printed. This wasn't caught earlier
since ASP.NET Core is very quiet by default.

ASP.NET Core apps launched via dotnet watch do not print output to the console.

Yes. This was introduced as part of changes to dotnet-watch to launch a browser in 5.0-preview8.

Low.
2020-09-16 18:53:59 -07:00
Steve Sanderson 8c23b53bef
Make timezone and ICU data available offline for PWA (#25954) 2020-09-16 16:49:09 -07:00
dotnet-maestro[bot] 9675fdb455
[release/5.0-rc2] Update dependencies from dotnet/arcade (#25963)
[release/5.0-rc2] Update dependencies from dotnet/arcade


 - Update create light/light command package drop task

 - Create output directory
2020-09-16 22:08:01 +00:00
Brennan ce76ae75f6
Fix Java packaging (#25838)
* Fix Java packaging

* fix flaky test
2020-09-15 10:20:43 -07:00
John Luo d14e273015
[5.0.0-rc2] Backport Fix chrome/selenium tests (#25330) (#25840)
* Fix chrome/selenium tests (#25330)

* Revert "Disable failing/hanging tests due to Chrome/Selenium issue (#25323)"

This reverts commit 332f1504128a63431cb67830703922cdeefee525.

* Update Selenium to latest

* Update API

* Try specifying a version

* Update Selenium to 4.0.0-beta5

* Disable browser log tests

* Fix components e2e tests and disable blazor standalone template test

* Disable tests using browser log

* Disable template test

* Avoid using .NET formatted strings in tests

* Annotate BasicTestApp suggesting that it needs the all globalization data

* Culture specific formatting relies on the ICU data carried by the OS. This
causes issues in our tests if WebAssembly carries a different set than the OS. Instead
updating these tests to use hardcoded strings.

* Additionally fixing an issue where some projects in the solution were using tasks from
the .dotnet SDK rather than the local copy of the SDK. This was causing issues building locally.

Co-authored-by: Pranav K <prkrishn@hotmail.com>
2020-09-14 18:43:42 -07:00
Kevin Pilch e3a52ee3de
Merge pull request #25881 from dotnet-maestro-bot/merge/release/5.0-to-release/5.0-rc2
[automated] Merge branch 'release/5.0' => 'release/5.0-rc2'
2020-09-14 15:24:14 -07:00
Pranav K a6f667bbb3
Add SkipAnalyzers=true to component declaration compilation (#25736)
* Update to latest SDK

* React to platform compatibility analyzer warnings
* React to new warnings
* Add platform compatibility attributes

* Add SkipAnalyzers=true to component declaration compilation
Fixes https://github.com/dotnet/aspnetcore/issues/25365

* Update eng/Version.Details.xml

* Update Versions.props

* Update Version.Details.xml

* Update Versions.props

* Update Version.Details.xml
2020-09-14 12:41:37 -07:00
Martin Costello a0ede85a61
Fix MSB4109 (#25880)
Fix MSB4109 error when the Microsoft.Extensions.ApiDescription.Server NuGet package is installed.
2020-09-14 12:07:15 -07:00
Doug Bunting 6c29f44a0b
Reduce references to Microsoft.AspNetCore.App.Runtime.csproj (#25836)
- dotnet-watch builds against runtime in the SDK
- other projects build after runtime project due to Ref.csproj reference
  - but, when the targeting packs aren't building, there's no reason to use Ref.csproj
- followup on 76fbd1a283 and 84962660a3, reducing parallelism in build
2020-09-14 11:34:07 -07:00