Comments (13)
@martincostello, sorry about that.
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-MVCTest1-7cbb08a3-0196-42e4-8f3a-5de650cb96e4</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<None Update="app.db" CopyToOutputDirectory="PreserveNewest" ExcludeFromSingleFile="true" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0-preview.6.24328.4" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0-preview.6.24328.4" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="9.0.0-preview.6.24328.4" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0-preview.6.24328.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0-preview.6.24327.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-preview.6.24327.4" />
<PackageReference Include="Microsoft.Extensions.Apidescription.Server" Version="9.0.0-preview.6.24328.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
from aspnetcore.
It can also repro with .NET 8.0 project.
Not sure if it's a reasonable scenario. Why I try to add Nuget Package 'Microsoft.Extensions.Apidescription.Server' : when I do config 'Microsoft Power Power Platform', I met this issue: BUG 2110144. After doing the workaround adding Nuget package can resolve this issue. I aslo added the error message comment for doing publish using VS to BUG 2110144. The error message is different.
@mkArtakMSFT, can you please take a look at if it is a real issue for .NET SDK?
CC: @balachir
from aspnetcore.
@v-qushi Is the Microsoft.AspNetCore.OpenApi
package installed in your project? If not, try installing it and see if this issue continues to repro.
dotnet add package Microsoft.AspNetCore.OpenApi -v 9.0.0-preview.6.24324.2
from aspnetcore.
Checked my project, the package isn't installed.
I tried to install it, the issue still can repro.
from aspnetcore.
Add an explicit PackageReference for a newer version of System.Drawing.Common
, or if you use central package management add an explicit PackageVersion
of the same and set CentralPackageTransitivePinningEnabled
to true
.
from aspnetcore.
I can work around the system drawing common warnings by installing a newer version of it, but that does not take care of the actual publish failure itself
from aspnetcore.
@v-qushi Can you share the contents of the project file for your MvcTest1.csproj
?
from aspnetcore.
@captainsafia Create new MVC Individual project, MvcTest1.csproj
as below:
After add package Microsoft.Extensions.Apidescription.Server
and Microsoft.AspNetCore.OpenApi
:
from aspnetcore.
@v-qushi Can you provide the actual XML rather than a screenshot of it please? It's a lot easier for people to use, rather than needing to manually transcribe and type it out.
from aspnetcore.
Hi all, any news on this please? I am having same issue on .NET 8. While I can build and run the sub-project using OpenAPI/Swashbuckle, publish on the solution fails with same error for.
1>C:\Users\matgazo\.nuget\packages\microsoft.extensions.apidescription.server\8.0.7\build\Microsoft.Extensions.ApiDescription.Server.targets(66,5): error : Unable to find service type 'Microsoft.Extensions.ApiDescriptions.IDocumentProvider' in dependency injection container. Update the 'Startup' class to register a document.
EDIT: I worked around by setting <OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>
in my .csproj as Swagger UI still works just fine with this.
from aspnetcore.
@matus-gazo If you're running into this issue in .NET 8, I'd recommend upgrading to the latest version of the Swashbuckle package that targets the .NET 8 TFM and seeing if you still repro.
@v-qushi Can you email me a ZIP folder of the project that you are reproing this issue on?
from aspnetcore.
@captainsafia , I already sent you the email.
from aspnetcore.
@captainsafia , 'dotnet build' failed with the same 2 errors after adding the package.
from aspnetcore.
Related Issues (20)
- `ElementReference` is sometimes null when performing interop in `OnAfterRenderAsync` HOT 4
- UseStatusCodePagesWithReExecute with Blazor not working
- Trim unused code when publish will delete route controllers HOT 1
- OpenAPI schema transformers not working correctly for types HOT 1
- Perf improvement: connectionclose, multiple_queries
- Perf regression: fortunes_ef
- Perf improvement: ApiCrudDeleteProduct
- Schemas for parameters should not specify `nullable: true`
- [6.0] Bad template configuration HOT 1
- Please provide a way to disable the DeveloperExceptionPage during development. HOT 2
- Enum as API method's parameter ignoring naming policy when binding
- Perf regression: mvc, plaintext
- Blazor JS to .Net Streaming. IJSStreamReference using same stream reference. HOT 2
- Cannot navigate to Nested Razor Component HOT 2
- Need custom configurations and New Default implementations for Identity Endpoints HOT 1
- Perf improvement: json, json_middleware
- Perf regression: fortunes_dapper
- Perf regression: plaintext, plainTextSansFilter
- Perf regression: ApiCrudListProducts
- Schemas for arrays created because properties have descriptions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspnetcore.