English 中文(简体)
新型作物必须由一个协会参考。 NET 核心6应用部分项目
原标题:What Nuget packages must be referenced by an ASP.NET Core 6 application parts project

我正在建立一个伙伴关系。 NET 核心6申请,我想纳入由单独议会提供的额外领域。 我在以下网址查阅了文件:https://learn.microsoft.com/en-us/aspnet/core/mvc/advanced/app-parts?view=aspnet-6.0。 在提供部件的项目中,我添加了<代码>IMvcBuilder的推广方法,使我能够方便地登记部件,例如:

services.AddMvc().AddFeatureXyzParts();

延长期限更像:

public static IMvcBuilder AddFeatureXyzParts(this IMvcBuilder builder)
{
    if (builder == null) throw new ArgumentNullException(nameof(builder));
    builder.AddApplicationPart(typeof(MvcBuilderExtensions).Assembly);
    return builder;
}

在项目档案中,我从<代码>Microsoft.NET.Sdk的属性改为Microsoft.NET.Sdk。 Web to reference the ASP. NET Core 6 SDK/2006/10ly (as it is set up for the main application Project), but this diss the building with the wrong states that the Assembly lacks the definition of a Main.

由于它不是一个独立的网络应用程序组,而是一个部分图书馆,提供额外的控制器类型和服务,因此,我愿意将<代码>Sdk的财产重新编号为Microsoft.NET。 Sdk 。 然后,我不得不人工添加缺失的成套参考资料。 为此,Microsoft.AspNetCore.App 一揽子方案似乎是错误的选择。 NET Core 6, and Microsoft.AspNetCore.App.Refs 不得使用。

我需要什么提法?

<>Update - Define the required entry point to meet the Building

作为一个能够让我参考所需伙伴关系的工作。 NET Core 6 SDK, I can use the 微软.NET.Sdk。 网页 SDK 如果我添加一个内部<代码>Program类别,其中界定了Main方法。 有了这种安排,我就可以把我的部分大会登记为通缉,控制人员(即使是某个地区的一部分)能够融为一体。

internal static class Program
{
    public static void Main() => throw new NotImplementedException();
}
最佳回答
问题回答

对于我来说,我是上调一组校准。,使用Microsoft.NET.Sdk

From:

<TargetFrameworks>netcoreapp2.1;net45;net46;net47;net48</TargetFrameworks>

www.un.org/spanish/ecosoc To:

<TargetFrameworks>net8.0</TargetFrameworks>

I found that adding the following solved my all build errors

<ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
</ItemGroup>

www.un.org/spanish/ecosoc 不能确定能否为被占领土的准确局势工作,但作为一系列“重复”的问题,我来到这里,想在个案中担任职务,帮助一些其他神职人员。

升级助理VSIX对此进行了追踪,并附有一些不熟悉的说明。 旧的植被已经注意到,它们已经做了折旧,但却没有帮助使用什么。

这是VS2022社区版。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签