Skip to content

ContentPathGenerator.tt keeps the extension when it's not needed #884

@equalisysdev

Description

@equalisysdev

I got a structure that looks like this

Root
|    ContentPathGenerator.tt
|    Content
     |    textures
          |    logo
               |    studio
                   |    black.png
| ...

so the template generates something like this:

class Content
	{
		public static class Textures
		{
			public static class Logo
			{
				public static class Studio
				{
					public const string Black = @"Content\textures\logo\studio\black.png";
				}

			}

			public const string Ball = @"Content\textures\ball.png";
		}

		public const string Content = @"Content.mgcb";

	}
}

But when I use it, i get an error :
FileNotFoundException : Could not find file '[...]\bin\Debug\net8.0\Content\textures\logo\studio\black.png.xnb'.

Because the real file path is
[...]\bin\Debug\net8.0\Content\textures\logo\studio\black.xnb

The file extension is removed at Content compile time but the template doesn't seem to take that into account..

How could it be fixed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions