-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Using .NET 7
In my experience:
- The
ts-gencommand doesn't manage to compile the root types provider properly. It doesn't add assembly references to common types, such as those in theSystem.Collections.Genericnamespace - This leads to compilation errors:
dotnet ts-gen -a bin/Debug/net7.0/ExtDep.dll --directory "." --outputDir frontend/
Generating TypeScript
MyRootTypesProvider.cs(1,13): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'Example' (are you missing an assembly reference?)
MyRootTypesProvider.cs(12,20): error CS0246: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?)
MyRootTypesProvider.cs(12,25): error CS0246: The type or namespace name 'Type' could not be found (are you missing a using directive or an assembly reference?)
MyRootTypesProvider.cs(12,42): error CS0246: The type or namespace name 'ConfirmationViewModel' could not be found (are you missing a using directive or an assembly reference?)
I don't know how to fix these, except perhaps by not using AdhocProject.
- The README doesn't really document that you need to write an
IRootTypesProviderimplementation when using the CLI tool in the first place - For using the Roslyn support in code rather than at the CLI, there is no real documentation about what should be passed to
AdhocProject.GetCompilation. It turned out that the root types provider source code must be available within the list of directories, but I did not know that initially - and I just got NullReference exceptions referencing the use ofx.SourceTree!inGetNamespaceTypes. It makes sense now that I've read through the library's code a bit more. - I'm just generally a bit lost with getting this to actually work using Roslyn
Metadata
Metadata
Assignees
Labels
No labels