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.

dotnet build fails to generate TypeGeneration.cs on linux

See original GitHub issue

Since 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:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mhutchcommented, Nov 2, 2018

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.

1reaction
mhutchcommented, Nov 1, 2018

The Mono.TextTemplating NuGet includes a net4x version of TextTransform.exe in the tools folder, so you could run that using mono. 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

Read more comments on GitHub >

github_iconTop 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 >

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