dotnet build fails to generate TypeGeneration.cs on linux
See original GitHub issueSince the removal of TypeGeneration.cs
file in e1c83dfdb0c6b6cfd8d8655f22c77019b5b30787, I cannot build the project on Linux. Obviously, I don’t have the VisualStudio to generate the file, and I cannot figure out if there is a combination of options to do it using only dotnet/msbuild. Here’s what I get:
motus@motus-xps13:~/devel/TorchSharp/Tester:master$ dotnet run
Program.cs(5,20): error CS0246: The type or namespace name 'FloatTensor' could not be found (are you missing a using directive or an assembly reference?) [/home/motus/devel/TorchSharp/Tester/Tester.csproj]
The build failed. Please fix the build errors and run again.
motus@motus-xps13:~/devel/TorchSharp/Tester:master$ dotnet --version
2.1.403
I think @NiklasGustafsson has the same problem. @migueldeicaza, do you know how to fix it? Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
dotnet build fails to generate TypeGeneration.cs on linux #27
I got around this problem on my Mac by running the tool from within VS, but it seems to me that it should...
Read more >net core - Error generating code during dotnet build
cs files are not generated. The build obviously fails after that since everything that is generated can't be found. git clean -dxf <...
Read more >Code Generation Fail: An all the king's horses tragedy
Relevant GitHub Issues: dotnet build fails to generate TypeGeneration. cs on linux. Add MSBuild targets package.
Read more >dotnet build command - .NET CLI
The dotnet build command builds a project and all of its dependencies.
Read more >dotnet run command - .NET CLI
The dotnet run command provides a convenient option to run your application from the source code.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FWIW it’s generally necessary to check in the output of tt files. This is because they follow the model of design-time generation (think winforms designer files) rather than the more modern build integrated generation used by e.g. xaml. It would be possible to change the generation model once an msbuild task existed, like in the issue I linked.
The Mono.TextTemplating NuGet includes a net4x version of
TextTransform.exe
in the tools folder, so you could run that usingmono
. This is the same T4 engine that VSMac and MonoDevelop use.A more complete solution would probably involve fixing https://github.com/mono/t4/issues/12