question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI produces invalid T4 template

See original GitHub issue

Get 2 errors when generate db scheme using CLI with a default (unmodified) T4 template created by the CLI.

T4 compilation failed:
	(123,108): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
	(123,29): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
	(142,64): error CS0246: The type or namespace name 'EntityModel' could not be found (are you missing a using directive or an assembly reference?)
	(159,73): error CS0246: The type or namespace name 'StoredProcedureModel' could not be found (are you missing a using directive or an assembly reference?)
	(176,71): error CS0246: The type or namespace name 'TableFunctionModel' could not be found (are you missing a using directive or an assembly reference?)
	(191,72): error CS0246: The type or namespace name 'ScalarFunctionModel' could not be found (are you missing a using directive or an assembly reference?)
	(206,75): error CS0246: The type or namespace name 'AggregateFunctionModel' could not be found (are you missing a using directive or an assembly reference?)
	(222,69): error CS0246: The type or namespace name 'AssociationModel' could not be found (are you missing a using directive or an assembly reference?)

Environment details

linq2db version: 4.0.0 Database Server: Postgres Operating system: macOS .NET Framework: 6.0.101

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
MaceWinducommented, May 20, 2022

Feel free to send PR 😃

0reactions
MaceWinducommented, May 20, 2022

BTW, thanks for trying new tool. If you have any feedback, please provide it here here https://github.com/linq2db/linq2db/discussions/3531

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - T4 Templates outputting wrong data
Go to your file in Solution Explorer. Right click -> Properties. In the properties window change the value of "Custom Tool" to ...
Read more >
Design-Time Code Generation by using T4 Text Templates
Learn how design-time T4 text templates let you generate program code and other files in your Visual Studio project.
Read more >
Run-Time Text Generation with T4 Text Templates
Learn how you can generate text strings in your application at run time by using Visual Studio runtime text templates.
Read more >
[accepts invalid] binding template template arguments with ...
S should not match template_ s template argument (yet no error is generated by MSVC). gcc and clang reject this code. C++cppcompiler.
Read more >
T4 Models
T4 models are used to generate POCO's C# code using your database structure. Installation. First you should install one of packages with T4...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found