NeVeSpl / NTypewriter

File/code generator using Scriban text templates populated with C# code metadata from Roslyn API.
https://nevespl.github.io/NTypewriter/
MIT License
126 stars 25 forks source link

config issue: error CS0115: 'NTConfig.GetProjectsToBeSearched()': no suitable method found to override #33

Closed gregveres closed 3 years ago

gregveres commented 3 years ago

My csharp configuration seems to be broken with the latest version. It was working just fine with the previous version.

I have an NTConfig.cs file:

using NTypewriter.Editor.Config;
using System.Collections.Generic;

namespace SkyCourt.UI.ui.src.api
{
    [NTEditorFile]
    public class NTConfig : EditorConfig
    {
        public override IEnumerable<string> GetProjectsToBeSearched()
        {
            yield return "SkyCourt";
            yield return "SkyCourt.App.Api";
            yield return "SkyCourt.App.Models";
            yield return "SkyCourt.App.Utilities";
            yield return "SkyCourt.App.ViewModels";
        }
    }
}

that was being picked up just fine. But with this latest version I am getting this as an error message:

08:12:08.584 INFO: 
  _   _ _____                               _ _            
 | \ | |_   _|   _ _ __   _____      ___ __(_) |_ ___ _ __ 
 |  \| | | || | | | '_ \ / _ \ \ /\ / / '__| | __/ _ \ '__|
 | |\  | | || |_| | |_) |  __/\ V  V /| |  | | ||  __/ |   
 |_| \_| |_| \__, | .__/ \___| \_/\_/ |_|  |_|\__\___|_|   
             |___/|_|
17:42:54.552 INFO: ------------------------------------------------------
17:42:54.558 INFO: Loading configuration
17:42:54.599 ERROR: Failed to compile configuration
17:42:54.601 ERROR: C:\Users\Greg\source\repos\SquashSpider\SquashSpider\SkyCourt.UI\ui\src\api\NTConfig.cs(9,45): error CS0115: 'NTConfig.GetProjectsToBeSearched()': no suitable method found to override
NeVeSpl commented 3 years ago

There were some breaking changes in version 0.1.0, you need to update nugets and change methods into properties in the configuration file: https://github.com/NeVeSpl/NTypewriter/blob/master/Documentation/Configuration.md#ProjectsToBeSearched

gregveres commented 3 years ago

Thanks. Updating the NuGet package and changing the config fixed it.