diff --git a/.editorconfig b/.editorconfig index 836c1d7..134e578 100644 --- a/.editorconfig +++ b/.editorconfig @@ -163,6 +163,7 @@ indent_size = 2 ; .NET solution files - match defaults for VS [*.sln] +end_of_line = crlf indent_style = tab ; Config - match XML and default nuget.config template @@ -197,3 +198,7 @@ charset = utf-8-bom ; ReStructuredText - standard indentation format from examples [*.rst] indent_size = 2 + +# YAML - match standard YAML like Kubernetes and GitHub Actions +[*.{yaml,yml}] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes index bdaa5ba..aa7224b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,7 +13,7 @@ *.png binary *.gif binary -*.cs text=auto diff=csharp +*.cs text=auto diff=csharp *.vb text=auto *.resx text=auto *.c text=auto diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index c49f435..0000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,88 +0,0 @@ -# Contributor Guide - -Contributions to Autofac, whether new features or bug fixes, are deeply appreciated and benefit the whole user community. - -The following guidelines help ensure the smooth running of the project, and keep a consistent standard across the codebase. They are guidelines only - should you feel a need to deviate from them it is probably for a good reason - but please adhere to them as closely as possible. - -If you'd like to contribute code or documentation to Autofac, we welcome pull requests. [Questions and suggestions are welcome on the newsgroup.](https://groups.google.com/forum/#!forum/autofac). - -**Your contributions must be your own work and licensed under the same terms as Autofac.** - -## Process - -**When working through contributions, please file issues and submit pull requests in the repository containing the code in question.** For example, if the issue is with the Autofac MVC integration, file it in that repo rather than the core Autofac repo. - -- **File an issue.** Either suggest a feature or note a defect. If it's a feature, explain the challenge you're facing and how you think the feature should work. If it's a defect, include a description and reproduction (ideally one or more failing unit tests). -- **Design discussion.** For new features, some discussion on the issue will take place to determine if it's something that should be included with Autofac or be a user-supplied extension. For defects, discussion may happen around whether the issue is truly a defect or if the behavior is correct. -- **Pull request.** Create [a pull request](https://help.github.com/articles/using-pull-requests/) on the `develop` branch of the repository to submit changes to the code based on the information in the issue. Pull requests need to pass the CI build and follow coding standards. See below for more on coding standards in use with Autofac. Note all pull requests should include accompanying unit tests to verify the work. -- **Code review.** Some iteration may take place requiring updates to the pull request (e.g., to fix a typo or add error handling). -- **Pull request acceptance.** The pull request will be accepted into the `develop` branch and pushed to `master` with the next release. - -## License - -By contributing to Autofac, you assert that: - -1. The contribution is your own original work. -2. You have the right to assign the *copyright* for the work (it is not owned by your employer, or you have been given copyright assignment in writing). -3. You license it under the terms applied to the rest of the Autofac project. - -## Coding - -### Workflow - -Autofac and the associated integration libraries follow the [Gitflow workflow process](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow/) for handling releases. This means active development is done on the `develop` branch and we push to `master` when it's release time. **If you're creating a pull request or contribution, please do it on the `develop` branch.** We can then build, push to MyGet for testing, and release to NuGet when everything's verified. - -### Developer Environment - -- Visual Studio 2019 (with latest patches/updates). -- PowerShell 6+ - -### Dependencies - -The core Autofac assemblies depend _only_ on the .NET Base Class Libraries (BCL). This is a conscious decision to keep the project lightweight and easier to maintain. - -For core integration assemblies (`Autofac.Integration.*`) the latest version of the integration library relies on the latest version of the integration target. For example, `Autofac.Integration.Mvc` always relies on the latest ASP.NET MVC libraries. This also helps keep the project easier to maintain. - -The `Autofac.Extras` features include assemblies that depend on other Open Source (OSS) libraries. It is important when including new dependencies that: - -- The project can be built straight out of Git (no additional installation needs to take place on the developer's machine). This means NuGet package references and/or checking in dependencies. -- Any third-party libraries have licenses compatible with Autofac's (the GPL and licenses like it are incompatible - please ask on the discussion forum if you're unsure). - -Unit tests are written in XUnit. - -### Build / Test - -Project codelines with scripted builds generally have a `build.ps1` script. This Powershell script will build, package, and execute tests. - -Some project codelines rely on convention-based builds so do not have a specific script. In these cases you will not see a `.ps1` or `.proj` file to execute. In these cases... - -- The build is executed by running it in Visual Studio or by executing `msbuild Solution.sln` on the solution in the codeline root. -- Unit tests can be run from the Visual Studio test explorer or by manually executing the command-line unit test runner from the `packages` folder against the built unit test assembly. - -### Code Documentation - -It is *strongly* encouraged that you update the Autofac documentation when making changes. If your changes impact existing features, the documentation may be updated regardless of whether a binary distribution has been made that includes the changes. [This can also be done through pull request.](https://github.com/autofac/Documentation) - -You should also include XML API comments in the code. These are used to generate API documentation as well as for IntelliSense. - -**The Golden Rule of Documentation: Write the documentation you'd want to read.** Every developer has seen self explanatory docs and wondered why there wasn't more information. (Parameter: "index." Documentation: "The index.") Please write the documentation you'd want to read if you were a developer first trying to understand how to make use of a feature. - -### Coding Standards - -Normal .NET coding guidelines apply. See the [Framework Design Guidelines](https://msdn.microsoft.com/en-us/library/ms229042.aspx>) for suggestions. We use Roslyn analyzers to enforce guidelines - the project should build without errors or warnings. - -Autofac source code uses four spaces for indents (rather than tabs). - -[If you have the EditorConfig add-in for your editor of choice (Visual Studio, Sublime Text, etc.)](https://editorconfig.org/), there are `.editorconfig` settings in the various repositories to help make your life easier. - -## Autofac.Extras - -Autofac.Extras are companion libraries that get distributed alongside the main Autofac distribution. The Extras are distinguished by: - -- Experimental features -- Integrations with other Open Source projects -- Alternatives to the 'typical' way of doing something in the core (e.g. a different configuration syntax) - -In many cases, Autofac.Extras is a way of testing alternatives and getting visibility for new ideas that could eventually end up in the core. - -If your contribution is accepted to Autofac.Extras it is unlikely that the rest of the project team will have the knowledge to maintain it, so please expect to have bug reports assigned to you for the area (which you may subsequently reassign if you're unable to action them). diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index cf78942..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To reproduce** -Reproduction of the issue, ideally in a unit test format. - -```c# -[Fact] -public void ReproduceIssue() -{ - var builder = new ContainerBuilder(); - var container = builder.Build(); - // This assertion should pass but it doesn't - Assert.NotNull(container.Resolve()); -} -``` - -**Full exception with stack trace:** - -``` -[put exception here between fences] -``` - -**Assembly/dependency versions:** -```xml - -``` - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 95c43c5..0000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Question -about: PLEASE ask questions on StackOverflow! -title: '' -labels: question -assignees: '' - ---- - -**Please ask questions on StackOverflow!** - -Tag your question `autofac` and **do not double post here.** - -Questions are things like "How do I...?", "Others have this working but I can't figure it out...," "Can you look at my code to see what I'm doing wrong?", and so on. - -We monitor StackOverflow for `autofac` questions! - -- Your question may help others - in issues, it's harder to find and can't help others. -- Lots of people monitor StackOverflow; many, many fewer can help you in issues. - -First [check out our documentation](https://autofac.readthedocs.io) and if it's not answered there, head over to [StackOverflow](https://stackoverflow.com) and tag your question `autofac`. - -**Questions as issues may be closed without explanation or warning.** diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index 4030f6f..0000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,7 +0,0 @@ -Fixes # - -## Proposed Changes - - - - - - - diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b19de87 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +name: Build and Test +on: + workflow_call: + secrets: + CODECOV_TOKEN: + description: Token for uploading code coverage metrics to CodeCov.io. + required: true +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x + - name: Build and test + run: dotnet msbuild ./default.proj + - name: Upload coverage + uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + files: artifacts/logs/*/coverage.cobertura.xml + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload package artifacts + uses: actions/upload-artifact@v4 + with: + name: packages + path: | + artifacts/packages/*.nupkg + artifacts/packages/*.snupkg diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a11c3fd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: Continuous Integration +on: + pull_request: + branches: + - develop + - master + push: + branches: + - develop + - master + - feature/* + tags: + - v[0-9]+.[0-9]+.[0-9]+ +# If multiple pushes happen quickly in succession, cancel the running build and +# start a new one. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + # Linting + dotnet-format: + uses: ./.github/workflows/dotnet-format.yml + pre-commit: + uses: ./.github/workflows/pre-commit.yml + # Build and test + build: + uses: ./.github/workflows/build.yml + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + # Publish beta and release packages. + publish: + uses: ./.github/workflows/publish.yml + needs: + - build + - dotnet-format + - pre-commit + if: ${{ github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/v') }} + secrets: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} diff --git a/.github/workflows/dotnet-format.yml b/.github/workflows/dotnet-format.yml new file mode 100644 index 0000000..162e4cc --- /dev/null +++ b/.github/workflows/dotnet-format.yml @@ -0,0 +1,14 @@ +name: dotnet format +on: + workflow_call: +jobs: + dotnet-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup .NET 8 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: dotnet format + run: dotnet format Autofac.Extensions.DependencyInjection.sln --verify-no-changes diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..ecc9b54 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,12 @@ +name: pre-commit +on: + workflow_call: +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a0e2218 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +name: Publish +on: + workflow_call: + secrets: + NUGET_API_KEY: + description: Token for publishing packages to NuGet. + required: true +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Download package artifacts + uses: actions/download-artifact@v4 + with: + name: packages + path: artifacts/packages + - name: Publish to GitHub Packages + run: | + dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/autofac/index.json" + dotnet nuget push ./artifacts/packages/*.nupkg --skip-duplicate --source github --api-key ${{ secrets.GITHUB_TOKEN }} + dotnet nuget push ./artifacts/packages/*.snupkg --skip-duplicate --source github --api-key ${{ secrets.GITHUB_TOKEN }} + - name: Publish to NuGet + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + run: | + dotnet nuget push ./artifacts/packages/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} diff --git a/.gitignore b/.gitignore index 14992d7..9381afc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # Project specific files artifacts/ +BenchmarkDotNet.Artifacts/ # User-specific files *.suo @@ -83,11 +84,6 @@ _TeamCity* # DotCover is a Code Coverage Tool *.dotCover -# Coverage -coverage.* -codecov.sh -coverage/ - # NCrunch *.ncrunch* .*crunch*.local.xml @@ -113,7 +109,6 @@ publish/ *.pubxml # NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line packages/ # Windows Azure Build Output @@ -138,6 +133,7 @@ node_modules/ bower_components/ wwwroot/ project.lock.json +*.Designer.cs # RIA/Silverlight projects Generated_Code/ @@ -170,5 +166,5 @@ $RECYCLE.BIN/ # Mac crap .DS_Store -# JetBrains Rider crap +# JetBrains Rider .idea diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..67d2ae5 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,3 @@ +{ + "MD013": false +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1fae588 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b" # v5.0.0 + hooks: + - id: check-json + - id: check-yaml + - id: check-merge-conflict + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: "192ad822316c3a22fb3d3cc8aa6eafa0b8488360" # v0.45.0 + hooks: + - id: markdownlint + args: + - --fix + - repo: https://github.com/tillig/json-sort-cli + rev: "009ab2ab49e1f2fa9d6b9dfc31009ceeca055204" # v3.0.0 + hooks: + - id: json-sort + args: + - --autofix diff --git a/.vscode/extensions.json b/.vscode/extensions.json index ac375c4..7d7c161 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,12 +1,8 @@ -{ - "recommendations": [ - "bierner.markdown-emoji", - "davidanson.vscode-markdownlint", - "editorconfig.editorconfig", - "gruntfuggly.todo-tree", - "ms-dotnettools.csharp", - "ryanluker.vscode-coverage-gutters", - "stkb.rewrap", - "travisillig.vscode-json-stable-stringify" - ] -} +{ + "recommendations": [ + "davidanson.vscode-markdownlint", + "editorconfig.editorconfig", + "ms-dotnettools.csdevkit", + "travisillig.vscode-json-stable-stringify" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json index a874fca..8703ff3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,62 +1,62 @@ -{ - "configurations": [ - { - "args": [ - ], - "cwd": "${workspaceFolder}/test/Integration.Net6", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "name": "Launch .NET 6 Integration Site", - "preLaunchTask": "build", - "program": "${workspaceFolder}/test/Integration.Net6/bin/Debug/net6.0/Integration.Net6.dll", - "request": "launch", - "serverReadyAction": { - "action": "openExternally", - "pattern": "\\bNow listening on:\\s+(https?://\\S+)", - "uriFormat": "%s/date" - }, - "stopAtEntry": false, - "type": "coreclr" - }, - { - "args": [ - ], - "cwd": "${workspaceFolder}/test/Integration.Net7", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "name": "Launch .NET 7 Integration Site", - "preLaunchTask": "build", - "program": "${workspaceFolder}/test/Integration.Net7/bin/Debug/net7.0/Integration.Net7.dll", - "request": "launch", - "serverReadyAction": { - "action": "openExternally", - "pattern": "\\bNow listening on:\\s+(https?://\\S+)", - "uriFormat": "%s/date" - }, - "stopAtEntry": false, - "type": "coreclr" - }, - { - "args": [ - ], - "cwd": "${workspaceFolder}/test/Integration.Net8", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "name": "Launch .NET 8 Integration Site", - "preLaunchTask": "build", - "program": "${workspaceFolder}/test/Integration.Net8/bin/Debug/net8.0/Integration.Net8.dll", - "request": "launch", - "serverReadyAction": { - "action": "openExternally", - "pattern": "\\bNow listening on:\\s+(https?://\\S+)", - "uriFormat": "%s/date" - }, - "stopAtEntry": false, - "type": "coreclr" - } - ], - "version": "0.2.0" -} +{ + "configurations": [ + { + "args": [ + ], + "cwd": "${workspaceFolder}/test/Integration.Net6", + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "name": "Launch .NET 6 Integration Site", + "preLaunchTask": "build", + "program": "${workspaceFolder}/test/Integration.Net6/bin/Debug/net6.0/Integration.Net6.dll", + "request": "launch", + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)", + "uriFormat": "%s/date" + }, + "stopAtEntry": false, + "type": "coreclr" + }, + { + "args": [ + ], + "cwd": "${workspaceFolder}/test/Integration.Net7", + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "name": "Launch .NET 7 Integration Site", + "preLaunchTask": "build", + "program": "${workspaceFolder}/test/Integration.Net7/bin/Debug/net7.0/Integration.Net7.dll", + "request": "launch", + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)", + "uriFormat": "%s/date" + }, + "stopAtEntry": false, + "type": "coreclr" + }, + { + "args": [ + ], + "cwd": "${workspaceFolder}/test/Integration.Net8", + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "name": "Launch .NET 8 Integration Site", + "preLaunchTask": "build", + "program": "${workspaceFolder}/test/Integration.Net8/bin/Debug/net8.0/Integration.Net8.dll", + "request": "launch", + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)", + "uriFormat": "%s/date" + }, + "stopAtEntry": false, + "type": "coreclr" + } + ], + "version": "0.2.0" +} diff --git a/.vscode/settings.json b/.vscode/settings.json index a5c7b5f..73bdd0f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,8 +17,6 @@ "coverage-gutters.coverageFileNames": [ "coverage.net6.0.info" ], - "dotnet-test-explorer.runInParallel": true, - "dotnet-test-explorer.testProjectPath": "test/**/*.Test.csproj", "dotnet.defaultSolution": "Autofac.Extensions.DependencyInjection.sln", "dotnet.preferRuntimeFromSDK": true, "dotnet.unitTestDebuggingOptions": { diff --git a/.vscode/tasks.json b/.vscode/tasks.json index fd793e0..ed86991 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,61 +1,47 @@ -{ - "tasks": [ - { - "args": [ - "build", - "${workspaceFolder}/Autofac.Extensions.DependencyInjection.sln", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary" - ], - "command": "dotnet", - "group": { - "isDefault": true, - "kind": "build" - }, - "label": "build", - "problemMatcher": "$msCompile", - "type": "process" - }, - { - "args": [ - "test", - "${workspaceFolder}/Autofac.Extensions.DependencyInjection.sln", - "/property:GenerateFullPaths=true", - "/consoleloggerparameters:NoSummary", - "--results-directory", - "\"artifacts/coverage\"", - "--logger:trx", - "--filter", - "FullyQualifiedName!~Bench", - "/p:CoverletOutput=\"${workspaceFolder}/artifacts/coverage/\"", - "/p:CollectCoverage=true", - "/p:CoverletOutputFormat=lcov", - "/p:Exclude=\"[System.*]*\"", - "-m:1" - ], - "command": "dotnet", - "group": { - "isDefault": true, - "kind": "test" - }, - "label": "test", - "problemMatcher": "$msCompile", - "type": "process" - }, - { - "args": [ - "watch", - "--project", - "${workspaceFolder}/build/Watch.proj", - "msbuild", - "/t:Test", - "/property:GenerateFullPaths=true" - ], - "command": "dotnet", - "label": "watch", - "problemMatcher": "$msCompile", - "type": "process" - } - ], - "version": "2.0.0" -} +{ + "tasks": [ + { + "args": [ + "build", + "${workspaceFolder}/Autofac.Extensions.DependencyInjection.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "command": "dotnet", + "group": { + "isDefault": true, + "kind": "build" + }, + "label": "build", + "problemMatcher": "$msCompile", + "type": "shell" + }, + { + "args": [ + "test", + "${workspaceFolder}/Autofac.Extensions.DependencyInjection.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary", + "--results-directory", + "\"artifacts/coverage\"", + "--logger:trx", + "--filter", + "FullyQualifiedName!~Bench", + "/p:CoverletOutput=\"${workspaceFolder}/artifacts/coverage/\"", + "/p:CollectCoverage=true", + "/p:CoverletOutputFormat=lcov", + "/p:Exclude=\"[System.*]*\"", + "-m:1" + ], + "command": "dotnet", + "group": { + "isDefault": true, + "kind": "test" + }, + "label": "test", + "problemMatcher": "$msCompile", + "type": "process" + } + ], + "version": "2.0.0" +} diff --git a/Autofac.Extensions.DependencyInjection.sln.DotSettings b/Autofac.Extensions.DependencyInjection.sln.DotSettings index 0ff20ba..b6b7983 100644 --- a/Autofac.Extensions.DependencyInjection.sln.DotSettings +++ b/Autofac.Extensions.DependencyInjection.sln.DotSettings @@ -1,2 +1,2 @@  - True \ No newline at end of file + True diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..8431286 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,6 @@ + + + + true + + diff --git a/LICENSE b/LICENSE index 5432675..e89fb63 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Autofac Project +Copyright © 2014 Autofac Project Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/NuGet.Config b/NuGet.Config index 132451e..9c9666e 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -2,8 +2,7 @@ - - + diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 1601242..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,39 +0,0 @@ -image: Ubuntu - -version: 10.0.0.{build} - -dotnet_csproj: - version_prefix: '10.0.0' - patch: true - file: 'src\**\*.csproj' - -configuration: Release - -environment: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - NUGET_XMLDOC_MODE: skip - -skip_tags: true - -nuget: - disable_publish_on_pr: true - -clone_depth: 1 - -test: false - -build_script: - - pwsh: .\build.ps1 - -artifacts: - - path: artifacts\packages\**\*.*nupkg - name: MyGet - type: NuGetPackage - -deploy: - - provider: NuGet - server: https://www.myget.org/F/autofac/api/v2/package - symbol_server: https://www.myget.org/F/autofac/api/v2/package - api_key: - secure: xUXExgVAagrdEicCjSxsQVrwiLo2TtnfqMbYB9Cauq2cpbm/EVz957PBK0v/GEYq - artifact: MyGet diff --git a/bench/Autofac.Extensions.DependencyInjection.Bench/Autofac.Extensions.DependencyInjection.Bench.csproj b/bench/Autofac.Extensions.DependencyInjection.Bench/Autofac.Extensions.DependencyInjection.Bench.csproj index 579b213..2207658 100644 --- a/bench/Autofac.Extensions.DependencyInjection.Bench/Autofac.Extensions.DependencyInjection.Bench.csproj +++ b/bench/Autofac.Extensions.DependencyInjection.Bench/Autofac.Extensions.DependencyInjection.Bench.csproj @@ -1,41 +1,28 @@  - net8.0 $(NoWarn);CS1591 Exe false - x64 + $([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) true + true true - true ../../build/Test.ruleset - false - latest AllEnabledByDefault + true + false enable - - arm64 - - - - - - - - - - @@ -50,14 +37,11 @@ runtime; build; native; contentfiles; analyzers - - - diff --git a/bench/Autofac.Extensions.DependencyInjection.Bench/BenchmarkConfig.cs b/bench/Autofac.Extensions.DependencyInjection.Bench/BenchmarkConfig.cs index 85e22ac..583e240 100644 --- a/bench/Autofac.Extensions.DependencyInjection.Bench/BenchmarkConfig.cs +++ b/bench/Autofac.Extensions.DependencyInjection.Bench/BenchmarkConfig.cs @@ -9,6 +9,8 @@ namespace Autofac.Extensions.DependencyInjection.Bench; internal sealed class BenchmarkConfig : ManualConfig { + private const string BenchmarkArtifactsFolder = "BenchmarkDotNet.Artifacts"; + internal BenchmarkConfig() { Add(DefaultConfig.Instance); @@ -17,7 +19,7 @@ internal BenchmarkConfig() var rootFolder = AppContext.BaseDirectory.Substring(0, AppContext.BaseDirectory.LastIndexOf("bin", StringComparison.OrdinalIgnoreCase)); var runFolder = DateTime.Now.ToString("u").Replace(' ', '_').Replace(':', '-'); - ArtifactsPath = Path.Join(rootFolder, "BenchmarkDotNet.Artifacts", runFolder); + ArtifactsPath = Path.Combine(rootFolder, BenchmarkArtifactsFolder, runFolder); AddDiagnoser(MemoryDiagnoser.Default); } diff --git a/bench/Autofac.Extensions.DependencyInjection.Bench/xunit.runner.json b/bench/Autofac.Extensions.DependencyInjection.Bench/xunit.runner.json index 78c070e..1c72a42 100644 --- a/bench/Autofac.Extensions.DependencyInjection.Bench/xunit.runner.json +++ b/bench/Autofac.Extensions.DependencyInjection.Bench/xunit.runner.json @@ -1,3 +1,3 @@ { "shadowCopy": false -} \ No newline at end of file +} diff --git a/bench/projects/Bench.AutofacApiServer/BenchProject.AutofacApiServer.csproj b/bench/projects/Bench.AutofacApiServer/BenchProject.AutofacApiServer.csproj index e8c03cd..687602b 100644 --- a/bench/projects/Bench.AutofacApiServer/BenchProject.AutofacApiServer.csproj +++ b/bench/projects/Bench.AutofacApiServer/BenchProject.AutofacApiServer.csproj @@ -1,28 +1,23 @@ - net8.0 Exe net6.0 $(NoWarn);CS1591 true - true latest ../../../build/Test.ruleset latest AllEnabledByDefault enable - all runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/bench/projects/Bench.AutofacApiServer/DefaultStartup.cs b/bench/projects/Bench.AutofacApiServer/DefaultStartup.cs index 629b284..c06e7e5 100644 --- a/bench/projects/Bench.AutofacApiServer/DefaultStartup.cs +++ b/bench/projects/Bench.AutofacApiServer/DefaultStartup.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. namespace BenchProject.AutofacApiServer; diff --git a/bench/projects/Bench.AutofacApiServer/Properties/launchSettings.json b/bench/projects/Bench.AutofacApiServer/Properties/launchSettings.json index 569ca8c..b231387 100644 --- a/bench/projects/Bench.AutofacApiServer/Properties/launchSettings.json +++ b/bench/projects/Bench.AutofacApiServer/Properties/launchSettings.json @@ -1,30 +1,30 @@ -{ +{ "$schema": "http://json.schemastore.org/launchsettings.json", "iisSettings": { - "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { "applicationUrl": "http://localhost:55009", "sslPort": 0 - } + }, + "windowsAuthentication": false }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "weatherforecast", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, "Bench.AutofacApiServer": { + "applicationUrl": "http://localhost:5000", "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, "launchBrowser": true, - "launchUrl": "weatherforecast", - "applicationUrl": "http://localhost:5000", + "launchUrl": "weatherforecast" + }, + "IIS Express": { + "commandName": "IISExpress", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "launchBrowser": true, + "launchUrl": "weatherforecast" } } } diff --git a/bench/projects/Bench.AutofacApiServer/appsettings.json b/bench/projects/Bench.AutofacApiServer/appsettings.json index d9d9a9b..32c1921 100644 --- a/bench/projects/Bench.AutofacApiServer/appsettings.json +++ b/bench/projects/Bench.AutofacApiServer/appsettings.json @@ -1,10 +1,10 @@ { + "AllowedHosts": "*", "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } - }, - "AllowedHosts": "*" + } } diff --git a/build/Analyzers.ruleset b/build/Analyzers.ruleset deleted file mode 100644 index 58ee82f..0000000 --- a/build/Analyzers.ruleset +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/Autofac.Build.psd1 b/build/Autofac.Build.psd1 deleted file mode 100644 index 6e7a322..0000000 --- a/build/Autofac.Build.psd1 +++ /dev/null @@ -1,15 +0,0 @@ -@{ - RootModule = '.\Autofac.Build.psm1' - ModuleVersion = '0.3.0' - GUID = '55d3f738-f48f-4497-9b2c-ecd90ec1f978' - Author = 'Autofac Contributors' - CompanyName = 'Autofac' - Description = 'Build support for Autofac projects.' - FunctionsToExport = '*' - CmdletsToExport = '*' - VariablesToExport = '*' - AliasesToExport = '*' - ModuleList = @() - FileList = @() - PrivateData = '' -} \ No newline at end of file diff --git a/build/Autofac.Build.psm1 b/build/Autofac.Build.psm1 deleted file mode 100644 index 6a4da4e..0000000 --- a/build/Autofac.Build.psm1 +++ /dev/null @@ -1,256 +0,0 @@ -# EXIT CODES -# 1: dotnet packaging failure -# 2: dotnet publishing failure -# 3: Unit test failure -# 4: dotnet / NuGet package restore failure - -<# -.SYNOPSIS - Gets the set of directories in which projects are available for compile/processing. - -.PARAMETER RootPath - Path where searching for project directories should begin. -#> -function Get-DotNetProjectDirectory { - [CmdletBinding()] - Param( - [Parameter(Mandatory = $True, ValueFromPipeline = $False, ValueFromPipelineByPropertyName = $False)] - [ValidateNotNullOrEmpty()] - [string] - $RootPath - ) - - Get-ChildItem -Path $RootPath -Recurse -Include "*.csproj" | Select-Object @{ Name = "ParentFolder"; Expression = { $_.Directory.FullName.TrimEnd("\") } } | Select-Object -ExpandProperty ParentFolder -} - -<# -.SYNOPSIS - Runs the dotnet CLI install script from GitHub to install a project-local - copy of the CLI. -#> -function Install-DotNetCli { - [CmdletBinding()] - Param( - [string] - $Version = "Latest" - ) - Write-Message "Installing .NET SDK version $Version" - - $callerPath = Split-Path $MyInvocation.PSCommandPath - $installDir = Join-Path -Path $callerPath -ChildPath ".dotnet/cli" - if (!(Test-Path $installDir)) { - New-Item -ItemType Directory -Path "$installDir" | Out-Null - } - - # Download the dotnet CLI install script - if ($IsWindows) { - if (!(Test-Path ./.dotnet/dotnet-install.ps1)) { - Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./.dotnet/dotnet-install.ps1" - } - - & ./.dotnet/dotnet-install.ps1 -InstallDir "$installDir" -Version $Version - } else { - if (!(Test-Path ./.dotnet/dotnet-install.sh)) { - Invoke-WebRequest "https://dot.net/v1/dotnet-install.sh" -OutFile "./.dotnet/dotnet-install.sh" - } - - & bash ./.dotnet/dotnet-install.sh --install-dir "$installDir" --version $Version - } - - Add-Path "$installDir" -} - -<# -.SYNOPSIS - Appends a given value to the path but only if the value does not yet exist within the path. -.PARAMETER Path - The path to append. -#> -function Add-Path { - [CmdletBinding()] - Param( - [ValidateNotNullOrEmpty()] - [string] - $Path - ) - - $pathSeparator = ":"; - - if ($IsWindows) { - $pathSeparator = ";"; - } - - $pathValues = $env:PATH.Split($pathSeparator); - if ($pathValues -Contains $Path) { - return; - } - - $env:PATH = "${Path}${pathSeparator}$env:PATH" -} - -<# -.SYNOPSIS - Builds a project using dotnet cli. -.DESCRIPTION - Builds a project in a specified directory using the dotnet cli. -.PARAMETER DirectoryName - The path to the directory containing the project to build. -#> -function Invoke-DotNetBuild { - [CmdletBinding()] - Param( - [Parameter(Mandatory = $True, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)] - [ValidateNotNull()] - [System.IO.DirectoryInfo[]] - $ProjectDirectory - ) - Process { - foreach ($Project in $ProjectDirectory) { - & dotnet build ("""" + $Project.FullName + """") --configuration Release - if ($LASTEXITCODE -ne 0) { - exit 1 - } - } - } -} - -<# -.SYNOPSIS - Invokes the dotnet utility to package a project. - -.PARAMETER ProjectDirectory - Path to the directory containing the project to package. - -.PARAMETER PackagesPath - Path to the "artifacts/packages" folder where packages should go. - -.PARAMETER VersionSuffix - The version suffix to use for the NuGet package version. -#> -function Invoke-DotNetPack { - [CmdletBinding()] - Param( - [Parameter(Mandatory = $True, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)] - [ValidateNotNull()] - [System.IO.DirectoryInfo[]] - $ProjectDirectory, - - [Parameter(Mandatory = $True, ValueFromPipeline = $False)] - [ValidateNotNull()] - [System.IO.DirectoryInfo] - $PackagesPath, - - [Parameter(Mandatory = $True, ValueFromPipeline = $False)] - [AllowEmptyString()] - [string] - $VersionSuffix - ) - Begin { - New-Item -Path $PackagesPath -ItemType Directory -Force | Out-Null - } - Process { - foreach ($Project in $ProjectDirectory) { - if ($VersionSuffix -eq "") { - & dotnet build ("""" + $Project.FullName + """") --configuration Release - } - else { - & dotnet build ("""" + $Project.FullName + """") --configuration Release --version-suffix $VersionSuffix - } - if ($LASTEXITCODE -ne 0) { - exit 1 - } - - if ($VersionSuffix -eq "") { - & dotnet pack ("""" + $Project.FullName + """") --configuration Release --output $PackagesPath - } - else { - & dotnet pack ("""" + $Project.FullName + """") --configuration Release --version-suffix $VersionSuffix --output $PackagesPath - } - if ($LASTEXITCODE -ne 0) { - exit 1 - } - } - } -} - -<# -.SYNOPSIS - Invokes dotnet test command. - -.PARAMETER ProjectDirectory - Path to the directory containing the project to package. -#> -function Invoke-Test { - [CmdletBinding()] - Param( - [Parameter(Mandatory = $True, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)] - [ValidateNotNull()] - [System.IO.DirectoryInfo[]] - $ProjectDirectory - ) - Process { - foreach ($Project in $ProjectDirectory) { - Push-Location $Project - - & dotnet test ` - --configuration Release ` - --logger:trx ` - /p:CollectCoverage=true ` - /p:CoverletOutput="../../artifacts/coverage/$($Project.Name)/" ` - /p:CoverletOutputFormat="json%2clcov" ` - /p:ExcludeByAttribute=CompilerGeneratedAttribute ` - /p:ExcludeByAttribute=GeneratedCodeAttribute - - if ($LASTEXITCODE -ne 0) { - Pop-Location - exit 3 - } - - Pop-Location - } - } -} - -<# -.SYNOPSIS - Restores dependencies using the dotnet utility. - -.PARAMETER ProjectDirectory - Path to the directory containing the project with dependencies to restore. -#> -function Restore-DependencyPackages { - [CmdletBinding()] - Param( - [Parameter(Mandatory = $True, ValueFromPipeline = $True, ValueFromPipelineByPropertyName = $True)] - [ValidateNotNull()] - [System.IO.DirectoryInfo[]] - $ProjectDirectory - ) - Process { - foreach ($Project in $ProjectDirectory) { - & dotnet restore ("""" + $Project.FullName + """") --no-cache - if ($LASTEXITCODE -ne 0) { - exit 4 - } - } - } -} - -<# -.SYNOPSIS - Writes a build progress message to the host. - -.PARAMETER Message - The message to write. -#> -function Write-Message { - [CmdletBinding()] - Param( - [Parameter(Mandatory = $True, ValueFromPipeline = $False, ValueFromPipelineByPropertyName = $False)] - [ValidateNotNullOrEmpty()] - [string] - $Message - ) - - Write-Host "[BUILD] $Message" -ForegroundColor Cyan -} diff --git a/build/CodeAnalysisDictionary.xml b/build/CodeAnalysisDictionary.xml deleted file mode 100644 index 0f1b469..0000000 --- a/build/CodeAnalysisDictionary.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - Api - Autofac - autowired - autowiring - composable - configurator - Ioc - Mef - Moq - multitenancy - Mvc - Mvx - Mvvm - startable - Owin - - - - - diff --git a/build/Coverage.runsettings b/build/Coverage.runsettings new file mode 100644 index 0000000..59e9f10 --- /dev/null +++ b/build/Coverage.runsettings @@ -0,0 +1,18 @@ + + + + + + + cobertura + [System.*]* + **/LoggerMessage.g.cs + GeneratedCodeAttribute + false + true + false + + + + + diff --git a/build/Source.ruleset b/build/Source.ruleset new file mode 100644 index 0000000..f337c97 --- /dev/null +++ b/build/Source.ruleset @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/Test.ruleset b/build/Test.ruleset index eb62b92..458fa07 100644 --- a/build/Test.ruleset +++ b/build/Test.ruleset @@ -2,62 +2,82 @@ + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + - + - + + + - + - + - + - - - + - + - - - + - - - + - - - + - + + + - + + + - + - + - + - - - - diff --git a/build/Watch.proj b/build/Watch.proj deleted file mode 100644 index ca293a4..0000000 --- a/build/Watch.proj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/codecov.yml b/codecov.yml index a4a0df4..ce64798 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,6 +1,6 @@ codecov: branch: develop - require_ci_to_pass: yes + require_ci_to_pass: true coverage: status: project: diff --git a/default.proj b/default.proj new file mode 100644 index 0000000..4dd03d0 --- /dev/null +++ b/default.proj @@ -0,0 +1,73 @@ + + + + + 10.0.1 + Autofac.Extensions.DependencyInjection + Release + $([System.IO.Path]::Combine($(MSBuildProjectDirectory),"artifacts")) + $([System.IO.Path]::Combine($(ArtifactDirectory),"packages")) + $([System.IO.Path]::Combine($(ArtifactDirectory),"logs")) + $([System.IO.Path]::Combine($(MSBuildProjectDirectory),'build/Coverage.runsettings')) + $([System.DateTimeOffset]::UtcNow.ToString('yyyyMMddTHHmmssZ')) + + + + + $(Version)-local + + + + + $(Version) + + + + + $(Version)-beta$(BuildDateTime) + + + + + $(Version)-alpha$(BuildDateTime) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/global.json b/global.json index 8a5d792..d7a3fee 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,6 @@ -{ - "sdk": { - "version": "8.0.401", - "rollForward": "latestFeature" - }, - - "additionalSdks": [ - "6.0.425", - "7.0.410" - ] -} +{ + "sdk": { + "rollForward": "latestFeature", + "version": "8.0.414" + } +} diff --git a/src/Autofac.Extensions.DependencyInjection/Autofac.Extensions.DependencyInjection.csproj b/src/Autofac.Extensions.DependencyInjection/Autofac.Extensions.DependencyInjection.csproj index ab518a2..6287b32 100644 --- a/src/Autofac.Extensions.DependencyInjection/Autofac.Extensions.DependencyInjection.csproj +++ b/src/Autofac.Extensions.DependencyInjection/Autofac.Extensions.DependencyInjection.csproj @@ -14,12 +14,11 @@ true en-US - net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0; + net8.0;net7.0;net6.0;netstandard2.1;netstandard2.0 latest - true enable true - ../../build/Analyzers.ruleset + ../../build/Source.ruleset true AllEnabledByDefault enable @@ -41,20 +40,16 @@ PrepareResources;$(CompileDependsOn) - - - - @@ -65,7 +60,6 @@ - MSBuild:Compile @@ -74,7 +68,6 @@ %(Filename) - Autofac.Extensions.DependencyInjection diff --git a/src/Autofac.Extensions.DependencyInjection/AutofacChildLifetimeScopeConfigurationAdapter.cs b/src/Autofac.Extensions.DependencyInjection/AutofacChildLifetimeScopeConfigurationAdapter.cs index b6df97b..f4f59ef 100644 --- a/src/Autofac.Extensions.DependencyInjection/AutofacChildLifetimeScopeConfigurationAdapter.cs +++ b/src/Autofac.Extensions.DependencyInjection/AutofacChildLifetimeScopeConfigurationAdapter.cs @@ -10,6 +10,11 @@ public class AutofacChildLifetimeScopeConfigurationAdapter { private readonly List> _configurationActions = new(); + /// + /// Gets the list of configuration actions to be executed on the for the child . + /// + public IReadOnlyList> ConfigurationActions => _configurationActions; + /// /// Adds a configuration action that will be executed when the child is created. /// @@ -24,9 +29,4 @@ public void Add(Action configurationAction) _configurationActions.Add(configurationAction); } - - /// - /// Gets the list of configuration actions to be executed on the for the child . - /// - public IReadOnlyList> ConfigurationActions => _configurationActions; } diff --git a/src/Autofac.Extensions.DependencyInjection/AutofacChildLifetimeScopeServiceProviderFactory.cs b/src/Autofac.Extensions.DependencyInjection/AutofacChildLifetimeScopeServiceProviderFactory.cs index 8e6eb8e..e384770 100644 --- a/src/Autofac.Extensions.DependencyInjection/AutofacChildLifetimeScopeServiceProviderFactory.cs +++ b/src/Autofac.Extensions.DependencyInjection/AutofacChildLifetimeScopeServiceProviderFactory.cs @@ -10,9 +10,9 @@ namespace Autofac.Extensions.DependencyInjection; /// public class AutofacChildLifetimeScopeServiceProviderFactory : IServiceProviderFactory { + private static readonly Action FallbackConfigurationAction = builder => { }; private readonly Action _containerConfigurationAction; private readonly ILifetimeScope _rootLifetimeScope; - private static readonly Action FallbackConfigurationAction = builder => { }; /// /// Initializes a new instance of the class. diff --git a/src/Autofac.Extensions.DependencyInjection/AutofacServiceProvider.cs b/src/Autofac.Extensions.DependencyInjection/AutofacServiceProvider.cs index 95658a1..eda0b1f 100644 --- a/src/Autofac.Extensions.DependencyInjection/AutofacServiceProvider.cs +++ b/src/Autofac.Extensions.DependencyInjection/AutofacServiceProvider.cs @@ -29,6 +29,11 @@ public AutofacServiceProvider(ILifetimeScope lifetimeScope) _lifetimeScope = lifetimeScope; } + /// + /// Gets the underlying instance of . + /// + public ILifetimeScope LifetimeScope => _lifetimeScope; + /// /// Gets the service object of the specified type. /// @@ -158,30 +163,6 @@ public bool IsKeyedService(Type serviceType, object? serviceKey) return _lifetimeScope.ResolveOptional(serviceType); } - /// - /// Gets the underlying instance of . - /// - public ILifetimeScope LifetimeScope => _lifetimeScope; - - /// - /// Releases unmanaged and - optionally - managed resources. - /// - /// - /// to release both managed and unmanaged resources; - /// to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - _disposed = true; - if (disposing) - { - _lifetimeScope.Dispose(); - } - } - } - /// /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// @@ -194,6 +175,7 @@ public void Dispose() /// /// Performs a dispose operation asynchronously. /// + /// A task to await disposal. public async ValueTask DisposeAsync() { if (!_disposed) @@ -203,4 +185,23 @@ public async ValueTask DisposeAsync() GC.SuppressFinalize(this); } } + + /// + /// Releases unmanaged and - optionally - managed resources. + /// + /// + /// to release both managed and unmanaged resources; + /// to release only unmanaged resources. + /// + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + _disposed = true; + if (disposing) + { + _lifetimeScope.Dispose(); + } + } + } } diff --git a/src/Autofac.Extensions.DependencyInjection/AutofacServiceScope.cs b/src/Autofac.Extensions.DependencyInjection/AutofacServiceScope.cs index 1a01a3d..487f8ef 100644 --- a/src/Autofac.Extensions.DependencyInjection/AutofacServiceScope.cs +++ b/src/Autofac.Extensions.DependencyInjection/AutofacServiceScope.cs @@ -11,8 +11,8 @@ namespace Autofac.Extensions.DependencyInjection; /// internal class AutofacServiceScope : IServiceScope, IAsyncDisposable { - private bool _disposed; private readonly AutofacServiceProvider _serviceProvider; + private bool _disposed; /// /// Initializes a new instance of the class. @@ -48,6 +48,16 @@ public void Dispose() GC.SuppressFinalize(this); } + /// + public async ValueTask DisposeAsync() + { + if (!_disposed) + { + _disposed = true; + await _serviceProvider.DisposeAsync().ConfigureAwait(false); + } + } + /// /// Releases unmanaged and - optionally - managed resources. /// @@ -66,14 +76,4 @@ protected virtual void Dispose(bool disposing) } } } - - /// - public async ValueTask DisposeAsync() - { - if (!_disposed) - { - _disposed = true; - await _serviceProvider.DisposeAsync().ConfigureAwait(false); - } - } } diff --git a/src/Autofac.Extensions.DependencyInjection/FromKeyedServicesAttributeExtensions.cs b/src/Autofac.Extensions.DependencyInjection/FromKeyedServicesAttributeExtensions.cs index dde41b7..a936cdc 100644 --- a/src/Autofac.Extensions.DependencyInjection/FromKeyedServicesAttributeExtensions.cs +++ b/src/Autofac.Extensions.DependencyInjection/FromKeyedServicesAttributeExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Reflection; diff --git a/src/Autofac.Extensions.DependencyInjection/KeyTypeConversionException.cs b/src/Autofac.Extensions.DependencyInjection/KeyTypeConversionException.cs index d65faa4..d9269b6 100644 --- a/src/Autofac.Extensions.DependencyInjection/KeyTypeConversionException.cs +++ b/src/Autofac.Extensions.DependencyInjection/KeyTypeConversionException.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Globalization; diff --git a/src/Autofac.Extensions.DependencyInjection/KeyedServiceMiddleware.cs b/src/Autofac.Extensions.DependencyInjection/KeyedServiceMiddleware.cs index 45b06e4..f04fbde 100644 --- a/src/Autofac.Extensions.DependencyInjection/KeyedServiceMiddleware.cs +++ b/src/Autofac.Extensions.DependencyInjection/KeyedServiceMiddleware.cs @@ -17,26 +17,16 @@ internal class KeyedServiceMiddleware : IResolveMiddleware // for injection into a constructor. This is similar to the // Autofac [KeyFilter] attribute. private static readonly Parameter FromKeyedServicesParameter = new ResolvedParameter( - (p, c) => - { - var filter = p.GetCustomAttributes(true).FirstOrDefault(); - return filter is not null && filter.CanResolveParameter(p, c); - }, - (p, c) => - { - var filter = p.GetCustomAttributes(true).First(); - return filter.ResolveParameter(p, c); - }); - - /// - /// Gets a single instance of this middleware that does not add the keyed services parameter. - /// - public static KeyedServiceMiddleware InstanceWithoutFromKeyedServicesParameter { get; } = new(addFromKeyedServiceParameter: false); - - /// - /// Gets a single instance of this middleware that adds the keyed services parameter. - /// - public static KeyedServiceMiddleware InstanceWithFromKeyedServicesParameter { get; } = new(addFromKeyedServiceParameter: true); + (p, c) => + { + var filter = p.GetCustomAttributes(true).FirstOrDefault(); + return filter is not null && filter.CanResolveParameter(p, c); + }, + (p, c) => + { + var filter = p.GetCustomAttributes(true).First(); + return filter.ResolveParameter(p, c); + }); private readonly bool _addFromKeyedServiceParameter; @@ -49,6 +39,16 @@ public KeyedServiceMiddleware(bool addFromKeyedServiceParameter) _addFromKeyedServiceParameter = addFromKeyedServiceParameter; } + /// + /// Gets a single instance of this middleware that does not add the keyed services parameter. + /// + public static KeyedServiceMiddleware InstanceWithoutFromKeyedServicesParameter { get; } = new(addFromKeyedServiceParameter: false); + + /// + /// Gets a single instance of this middleware that adds the keyed services parameter. + /// + public static KeyedServiceMiddleware InstanceWithFromKeyedServicesParameter { get; } = new(addFromKeyedServiceParameter: true); + /// public PipelinePhase Phase => PipelinePhase.Activation; diff --git a/src/Autofac.Extensions.DependencyInjection/ServiceDescriptorExtensions.cs b/src/Autofac.Extensions.DependencyInjection/ServiceDescriptorExtensions.cs index ef84721..bb48639 100644 --- a/src/Autofac.Extensions.DependencyInjection/ServiceDescriptorExtensions.cs +++ b/src/Autofac.Extensions.DependencyInjection/ServiceDescriptorExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.Extensions.DependencyInjection; diff --git a/src/Autofac.Extensions.DependencyInjection/ServiceProviderExtensionsResources.resx b/src/Autofac.Extensions.DependencyInjection/ServiceProviderExtensionsResources.resx index 3b25f11..837b8b9 100644 --- a/src/Autofac.Extensions.DependencyInjection/ServiceProviderExtensionsResources.resx +++ b/src/Autofac.Extensions.DependencyInjection/ServiceProviderExtensionsResources.resx @@ -1,17 +1,17 @@  - @@ -120,4 +120,4 @@ Unable to retrieve Autofac root lifetime scope from service provider of type {0}. - \ No newline at end of file + diff --git a/test/Autofac.Extensions.DependencyInjection.Integration.Test/Autofac.Extensions.DependencyInjection.Integration.Test.csproj b/test/Autofac.Extensions.DependencyInjection.Integration.Test/Autofac.Extensions.DependencyInjection.Integration.Test.csproj index 6925783..8251a1c 100644 --- a/test/Autofac.Extensions.DependencyInjection.Integration.Test/Autofac.Extensions.DependencyInjection.Integration.Test.csproj +++ b/test/Autofac.Extensions.DependencyInjection.Integration.Test/Autofac.Extensions.DependencyInjection.Integration.Test.csproj @@ -1,16 +1,16 @@  - net8.0;net7.0;net6.0; + net8.0;net7.0;net6.0 $(NoWarn);CS1591 true ../../Autofac.snk true true ../../build/Test.ruleset + AllEnabledByDefault true false latest - AllEnabledByDefault disable @@ -18,26 +18,21 @@ - - - - - diff --git a/test/Autofac.Extensions.DependencyInjection.Integration.Test/IntegrationTests.cs b/test/Autofac.Extensions.DependencyInjection.Integration.Test/IntegrationTests.cs index 41fd317..cd8b860 100644 --- a/test/Autofac.Extensions.DependencyInjection.Integration.Test/IntegrationTests.cs +++ b/test/Autofac.Extensions.DependencyInjection.Integration.Test/IntegrationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Autofac.Extensions.DependencyInjection.Test/Autofac.Extensions.DependencyInjection.Test.csproj b/test/Autofac.Extensions.DependencyInjection.Test/Autofac.Extensions.DependencyInjection.Test.csproj index f7dbd26..2ca8a5f 100644 --- a/test/Autofac.Extensions.DependencyInjection.Test/Autofac.Extensions.DependencyInjection.Test.csproj +++ b/test/Autofac.Extensions.DependencyInjection.Test/Autofac.Extensions.DependencyInjection.Test.csproj @@ -1,31 +1,27 @@  - net8.0;net7.0;net6.0; + net8.0;net7.0;net6.0 $(NoWarn);CS1591 true ../../Autofac.snk true true ../../build/Test.ruleset + AllEnabledByDefault true false latest - AllEnabledByDefault enable - - - - all diff --git a/test/Autofac.Extensions.DependencyInjection.Test/Specification/BuilderKeyedSpecificationTests.cs b/test/Autofac.Extensions.DependencyInjection.Test/Specification/BuilderKeyedSpecificationTests.cs index d78e61b..f8d8f89 100644 --- a/test/Autofac.Extensions.DependencyInjection.Test/Specification/BuilderKeyedSpecificationTests.cs +++ b/test/Autofac.Extensions.DependencyInjection.Test/Specification/BuilderKeyedSpecificationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.Extensions.DependencyInjection; diff --git a/test/Autofac.Extensions.DependencyInjection.Test/Specification/BuilderSpecificationTests.cs b/test/Autofac.Extensions.DependencyInjection.Test/Specification/BuilderSpecificationTests.cs index c027e4e..27110a1 100644 --- a/test/Autofac.Extensions.DependencyInjection.Test/Specification/BuilderSpecificationTests.cs +++ b/test/Autofac.Extensions.DependencyInjection.Test/Specification/BuilderSpecificationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.Extensions.DependencyInjection; diff --git a/test/Autofac.Extensions.DependencyInjection.Test/Specification/ChildScopeFactoryKeyedSpecificationTests.cs b/test/Autofac.Extensions.DependencyInjection.Test/Specification/ChildScopeFactoryKeyedSpecificationTests.cs index 7c82d0f..f7aee7c 100644 --- a/test/Autofac.Extensions.DependencyInjection.Test/Specification/ChildScopeFactoryKeyedSpecificationTests.cs +++ b/test/Autofac.Extensions.DependencyInjection.Test/Specification/ChildScopeFactoryKeyedSpecificationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.Extensions.DependencyInjection; diff --git a/test/Autofac.Extensions.DependencyInjection.Test/Specification/ChildScopeFactorySpecificationTests.cs b/test/Autofac.Extensions.DependencyInjection.Test/Specification/ChildScopeFactorySpecificationTests.cs index a98fbb7..91c6378 100644 --- a/test/Autofac.Extensions.DependencyInjection.Test/Specification/ChildScopeFactorySpecificationTests.cs +++ b/test/Autofac.Extensions.DependencyInjection.Test/Specification/ChildScopeFactorySpecificationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.Extensions.DependencyInjection; diff --git a/test/Autofac.Extensions.DependencyInjection.Test/Specification/FactoryKeyedSpecificationTests.cs b/test/Autofac.Extensions.DependencyInjection.Test/Specification/FactoryKeyedSpecificationTests.cs index 11b64a0..cda7f16 100644 --- a/test/Autofac.Extensions.DependencyInjection.Test/Specification/FactoryKeyedSpecificationTests.cs +++ b/test/Autofac.Extensions.DependencyInjection.Test/Specification/FactoryKeyedSpecificationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.Extensions.DependencyInjection; diff --git a/test/Autofac.Extensions.DependencyInjection.Test/Specification/FactorySpecificationTests.cs b/test/Autofac.Extensions.DependencyInjection.Test/Specification/FactorySpecificationTests.cs index 9c2cf65..3b81e65 100644 --- a/test/Autofac.Extensions.DependencyInjection.Test/Specification/FactorySpecificationTests.cs +++ b/test/Autofac.Extensions.DependencyInjection.Test/Specification/FactorySpecificationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.Extensions.DependencyInjection; diff --git a/test/Autofac.Extensions.DependencyInjection.Test/TestCulture.cs b/test/Autofac.Extensions.DependencyInjection.Test/TestCulture.cs index ae3338c..d5f3cac 100644 --- a/test/Autofac.Extensions.DependencyInjection.Test/TestCulture.cs +++ b/test/Autofac.Extensions.DependencyInjection.Test/TestCulture.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Globalization; diff --git a/test/Integration.Net6/Controllers/DateController.cs b/test/Integration.Net6/Controllers/DateController.cs index b9e2f28..f5236b1 100644 --- a/test/Integration.Net6/Controllers/DateController.cs +++ b/test/Integration.Net6/Controllers/DateController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Integration.Net6/DateProvider.cs b/test/Integration.Net6/DateProvider.cs index 125e581..7f06435 100644 --- a/test/Integration.Net6/DateProvider.cs +++ b/test/Integration.Net6/DateProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Integration.Net6/IDateProvider.cs b/test/Integration.Net6/IDateProvider.cs index ecf94fd..a2952db 100644 --- a/test/Integration.Net6/IDateProvider.cs +++ b/test/Integration.Net6/IDateProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Integration.Net6/Integration.Net6.csproj b/test/Integration.Net6/Integration.Net6.csproj index 8fcab04..3f1ed81 100644 --- a/test/Integration.Net6/Integration.Net6.csproj +++ b/test/Integration.Net6/Integration.Net6.csproj @@ -8,6 +8,7 @@ enable ../../build/Test.ruleset AllEnabledByDefault + true diff --git a/test/Integration.Net6/Program.cs b/test/Integration.Net6/Program.cs index 8b0d51c..38a556d 100644 --- a/test/Integration.Net6/Program.cs +++ b/test/Integration.Net6/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Threading.Tasks; diff --git a/test/Integration.Net6/Properties/launchSettings.json b/test/Integration.Net6/Properties/launchSettings.json index e590cbb..c25a1d6 100644 --- a/test/Integration.Net6/Properties/launchSettings.json +++ b/test/Integration.Net6/Properties/launchSettings.json @@ -1,13 +1,13 @@ -{ - "profiles": { - "Integration.Net6": { - "applicationUrl": "https://localhost:7154;http://localhost:7155", - "commandName": "Project", - "dotnetRunMessages": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "launchBrowser": true - } - } -} +{ + "profiles": { + "Integration.Net6": { + "applicationUrl": "https://localhost:7154;http://localhost:7155", + "commandName": "Project", + "dotnetRunMessages": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "launchBrowser": true + } + } +} diff --git a/test/Integration.Net6/Startup.cs b/test/Integration.Net6/Startup.cs index 822b855..2517b8e 100644 --- a/test/Integration.Net6/Startup.cs +++ b/test/Integration.Net6/Startup.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Diagnostics.CodeAnalysis; diff --git a/test/Integration.Net6/appsettings.json b/test/Integration.Net6/appsettings.json index b93c716..4db6efe 100644 --- a/test/Integration.Net6/appsettings.json +++ b/test/Integration.Net6/appsettings.json @@ -1,7 +1,7 @@ -{ - "Logging": { - "LogLevel": { - "Default": "None" - } - } -} +{ + "Logging": { + "LogLevel": { + "Default": "None" + } + } +} diff --git a/test/Integration.Net7/Controllers/DateController.cs b/test/Integration.Net7/Controllers/DateController.cs index c567a54..67f5ae6 100644 --- a/test/Integration.Net7/Controllers/DateController.cs +++ b/test/Integration.Net7/Controllers/DateController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Integration.Net7/DateProvider.cs b/test/Integration.Net7/DateProvider.cs index 15817d3..60a73aa 100644 --- a/test/Integration.Net7/DateProvider.cs +++ b/test/Integration.Net7/DateProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Integration.Net7/IDateProvider.cs b/test/Integration.Net7/IDateProvider.cs index e7790db..a1e0817 100644 --- a/test/Integration.Net7/IDateProvider.cs +++ b/test/Integration.Net7/IDateProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Integration.Net7/Integration.Net7.csproj b/test/Integration.Net7/Integration.Net7.csproj index 16dc04d..1f58a9c 100644 --- a/test/Integration.Net7/Integration.Net7.csproj +++ b/test/Integration.Net7/Integration.Net7.csproj @@ -8,6 +8,7 @@ enable ../../build/Test.ruleset AllEnabledByDefault + true diff --git a/test/Integration.Net7/Program.cs b/test/Integration.Net7/Program.cs index a8b7956..2a747f5 100644 --- a/test/Integration.Net7/Program.cs +++ b/test/Integration.Net7/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Threading.Tasks; diff --git a/test/Integration.Net7/Properties/launchSettings.json b/test/Integration.Net7/Properties/launchSettings.json index e590cbb..c25a1d6 100644 --- a/test/Integration.Net7/Properties/launchSettings.json +++ b/test/Integration.Net7/Properties/launchSettings.json @@ -1,13 +1,13 @@ -{ - "profiles": { - "Integration.Net6": { - "applicationUrl": "https://localhost:7154;http://localhost:7155", - "commandName": "Project", - "dotnetRunMessages": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "launchBrowser": true - } - } -} +{ + "profiles": { + "Integration.Net6": { + "applicationUrl": "https://localhost:7154;http://localhost:7155", + "commandName": "Project", + "dotnetRunMessages": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "launchBrowser": true + } + } +} diff --git a/test/Integration.Net7/Startup.cs b/test/Integration.Net7/Startup.cs index d14e6fe..a15d34a 100644 --- a/test/Integration.Net7/Startup.cs +++ b/test/Integration.Net7/Startup.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Diagnostics.CodeAnalysis; diff --git a/test/Integration.Net7/appsettings.json b/test/Integration.Net7/appsettings.json index b93c716..4db6efe 100644 --- a/test/Integration.Net7/appsettings.json +++ b/test/Integration.Net7/appsettings.json @@ -1,7 +1,7 @@ -{ - "Logging": { - "LogLevel": { - "Default": "None" - } - } -} +{ + "Logging": { + "LogLevel": { + "Default": "None" + } + } +} diff --git a/test/Integration.Net8/Controllers/DateController.cs b/test/Integration.Net8/Controllers/DateController.cs index 73a38d0..63ad71f 100644 --- a/test/Integration.Net8/Controllers/DateController.cs +++ b/test/Integration.Net8/Controllers/DateController.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Integration.Net8/DateProvider.cs b/test/Integration.Net8/DateProvider.cs index 2010ee6..218d0a9 100644 --- a/test/Integration.Net8/DateProvider.cs +++ b/test/Integration.Net8/DateProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Integration.Net8/IDateProvider.cs b/test/Integration.Net8/IDateProvider.cs index 5f0ee6a..9abc3d3 100644 --- a/test/Integration.Net8/IDateProvider.cs +++ b/test/Integration.Net8/IDateProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System; diff --git a/test/Integration.Net8/Integration.Net8.csproj b/test/Integration.Net8/Integration.Net8.csproj index 505f324..77ed748 100644 --- a/test/Integration.Net8/Integration.Net8.csproj +++ b/test/Integration.Net8/Integration.Net8.csproj @@ -8,6 +8,7 @@ enable ../../build/Test.ruleset AllEnabledByDefault + true diff --git a/test/Integration.Net8/Program.cs b/test/Integration.Net8/Program.cs index 6d2e7e2..d10bd37 100644 --- a/test/Integration.Net8/Program.cs +++ b/test/Integration.Net8/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Threading.Tasks; diff --git a/test/Integration.Net8/Properties/launchSettings.json b/test/Integration.Net8/Properties/launchSettings.json index e590cbb..c25a1d6 100644 --- a/test/Integration.Net8/Properties/launchSettings.json +++ b/test/Integration.Net8/Properties/launchSettings.json @@ -1,13 +1,13 @@ -{ - "profiles": { - "Integration.Net6": { - "applicationUrl": "https://localhost:7154;http://localhost:7155", - "commandName": "Project", - "dotnetRunMessages": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "launchBrowser": true - } - } -} +{ + "profiles": { + "Integration.Net6": { + "applicationUrl": "https://localhost:7154;http://localhost:7155", + "commandName": "Project", + "dotnetRunMessages": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "launchBrowser": true + } + } +} diff --git a/test/Integration.Net8/Startup.cs b/test/Integration.Net8/Startup.cs index 3e8a102..ad7feaa 100644 --- a/test/Integration.Net8/Startup.cs +++ b/test/Integration.Net8/Startup.cs @@ -1,4 +1,4 @@ -// Copyright (c) Autofac Project. All rights reserved. +// Copyright (c) Autofac Project. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using System.Diagnostics.CodeAnalysis; diff --git a/test/Integration.Net8/appsettings.json b/test/Integration.Net8/appsettings.json index b93c716..4db6efe 100644 --- a/test/Integration.Net8/appsettings.json +++ b/test/Integration.Net8/appsettings.json @@ -1,7 +1,7 @@ -{ - "Logging": { - "LogLevel": { - "Default": "None" - } - } -} +{ + "Logging": { + "LogLevel": { + "Default": "None" + } + } +}