Skip to content

源生成器没有正确识别 RootNamespace 属性 #31

@Soar360

Description

@Soar360

当在 .csproj 文件中设定 RootNamespace 属性后,SG 项目生成的 R 类型所在命名空间没有遵循该属性,仍为程序集名称。

比如:

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFramework>net8.0</TargetFramework>
		<ImplicitUsings>enable</ImplicitUsings>
		<Nullable>enable</Nullable>
		<RootNamespace>Popcorn.Toolkit</RootNamespace>
	</PropertyGroup>

</Project>

生成的代码:

// <auto-generated />
#nullable enable

using System;
using System.IO;
using LuYao.ResourcePacker;

namespace Popcorn.Toolkit.Client
{
    /// <summary>
    /// Provides strongly-typed access to resources in Popcorn.Toolkit.Client.
    /// </summary>
    internal static class R

请创建一个项目用来验证、测试。项目存放在 samples 目录,并加入解决方案。

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions