Skip to content

Cannot use a custom $(PackageId).props or targets file in a razor class library project #61891

Open
@nvmkpk

Description

@nvmkpk

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

If I add my own props file with the name $(PackageId).props following the instructions in https://learn.microsoft.com/en-us/nuget/concepts/msbuild-props-and-targets, the content of it does not get included in the nuget package. Even a targets file is not packaged and neither is an analyzer/source generator from another project gets included. All of these just work when the project is not a razor class library.

I did not try including mvc views/pages in the razor class library project.

Expected Behavior

The nuget package should contain the props file with content included in the one in the project. Any analyzer/source generator should also be included in the package.

Steps To Reproduce

Exceptions (if any)

None

.NET Version

9.0.203

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions