Skip to content

[Bug]: Generator does not create csproj when one does not already exist #25

@jarz

Description

@jarz

Describe the bug

A new csproj is not created when the OutputDirectory does not exist

Which version of the tool was used?

2fc93de

Options

Modified test/Generator.Tests/Models.UnitTests.cs InitializeAsync() to use Generator.Tests.Foo for output directory and namespace:

var outDir = PathHelper.GetCombinedFullPath(currentDir, "Generator.Tests.Foo", 4); // <--
var options = new ModelGeneratorOptions
{
    OutputDirectory = outDir,
    Namespace = "Generator.Tests.Foo", // <--
    JsonModelsDirectory = jsonDir,
    CopyrightHeader = "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License."
};

Steps To Reproduce

The readme states:

  1. In the event a user of the generator doesn't have their own project destination to place the generated classes, this project serves as a template for the user to start from. Our generator will inject the correct Namespace and Assembly information into the template project based on options passed into the Generator.

Based on the above, I'd expect the following given the options listed above:

  • Generator.Tests.Foo.csproj to be created in the Generator.Tests.Foo directory.
  • The RootNamespace and AssemblyName properties have the same value: Generator.Tests.Foo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugBug fix of existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions