TextTemplating | Text templating is used to dynamically render contents
kandi X-RAY | TextTemplating Summary
kandi X-RAY | TextTemplating Summary
Text templating is used to dynamically render contents based on a template and a model.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of TextTemplating
TextTemplating Key Features
TextTemplating Examples and Code Snippets
Community Discussions
Trending Discussions on TextTemplating
QUESTION
I would like to pass a value/ parameter to a .tt file. In this case, it's the 'ClassName'. To generate the class, the Mono.TextTemplating.Roslyn NuGet package is used and .NET 6.
As soon as the .tt is executed, the next error is displayed:
System.ArgumentNullException: Value cannot be null. (Parameter 'objectToConvert')
Both 'Add' functions don't result in the expected behavior:
...ANSWER
Answered 2022-Jan-31 at 14:41The Parameter is not exposed as variables, they are intended as arguments for custom directive processors. To access directly from code you have to set hostspecific="true"
and access via Host.ResolveParameterValue (paramName)
.
*.tt
file:
QUESTION
I work on an open-source application that is built in VisualStudio using the v142
toolset. This toolset is choosen over the newer v143
toolset because
- some external libraries provide binary distributions for
v142
- github actions provide a runner containing
v142
New developers of course start with VisualStudio 2022 CE. They just have to install the correct toolset and the compilation succeeds as expected. However, when building the installer (using Wix) it complains that the merge module for v142
is not available:
ANSWER
Answered 2022-Jan-17 at 20:38This appears to be a bug in the Visual Studio 2022 installer: The merge modules component should be tied to which toolsets are installed, but it appears to install only the latest/current toolset's merge modules. The same is true for Visual Studio 2019; it appears that version is the only way to get the merge modules installed.
That said, merge modules are not recommended. The preferred method is to use the redistributable packages.
QUESTION
I've encountered NuGet problems while building DirectX-Graphics-Samples
The error occurs with many projects, here is an example:
...ANSWER
Answered 2021-May-05 at 01:29QUESTION
I'm a little confused about compatibilities between netstandard
, netframework
, netX
and how mono fits into the picture...
I understand that Rider's T4 engine runs on mono, but does that mean I can't use net5.0
assemblies in my T4 templates?
Currently, I have a net5.0
project, referencing net5.0
nuget assemblies.
In my T4 templates, I'm referencing the assembly DLLs in bin/Debug/net5.0
with `<@ assembly name="...">
When I run the T4 templates in-proc in a net5.0
Console Application via Mono.TextTemplating.TemplateGenerator.TemplateGenerator
, then the templates work.
However, if I right-click a template in the Solution explorer and select 'Run Template', I get a list of errors that core System.* libs are missing, e.g.
...ANSWER
Answered 2021-Mar-24 at 09:18Due to implementation details, Rider compiles T4 files targeting a version of .NET Framework, that's why it has problems with files referencing net5.0
assemblies. As far as I understand what I see in Mono.TextTemplating
, they target the runtime they are launched in instead. To solve your problem I'd suggest trying Mono.TextTemplating
as a command-line tool - it might be able to compile files with net5.0
references. To integrate that external tool into Rider, you can go to File > Settings > Tools > Custom Tools
, disable Bundled T4 Template Executor
and add a custom tool for Mono.TextTemplating
CLT.
To answer your question: yes, it probably can be called a bug
QUESTION
I'm aware that I can install vs2019 by checking the option in GUI interaction. Actually, I've setup a box this way. I'm trying another way.
Per ms doc I can do the job from command line.
...ANSWER
Answered 2021-Jan-04 at 01:14Previously saved .vsconfig
installation configurations can be installed or added with the --config
command line option. From the Using --config examples:
Using
--config
to install the workloads and components from a previously saved installation configuration file:
QUESTION
I'm trying to write a class in .Net Core using the Roslyn compiler to compile my project and return me the ClassDefinitions in that project. I am going to use that information to generate code using T4.
It's a .Net Core 3.1 project.
I can't find any good documentation on what packages I should use to accomplish this.
In the Solution getter after loading the Solution I get no documents in the Documents property and 1 Diagnostic message for each project it is trying to load:
...ANSWER
Answered 2020-Dec-20 at 02:56It appears that when you install latest Visual Studio (I've got 16.8.3) - MSBuildLocator
defaults to using the .NET 5 MSBuild:
QUESTION
Typing in Visual Studio feels often very sluggish. Like I'm typing in mud. I tried researching this forever on Google, but can't find a cause.
I have a high performance laptop that has no problems with running other tools. I have the feeling that it wasn't a problem in the beginning.
Is there somehow that I can debug performance of Visual Studio itself? Maybe it's some rogue extension or option that I can disable, because I don't use it anyway.
After every letter I type I see VS starts "low running background tasks" light up:
Despite that I assume it shouldn't have influence on typing performance, I want to exclude everything.
I also found the Performance Manager, but it seems to be empty:
Question:
Is there any way to debug VS performance myself? To i.e. find rogue settings or extensions?
Update:
As asked by @rustyx, here is an export. I use at the moment VS 2019 Preview - but I'm having the same problems with the normal release. Should be pretty vanilla.
...ANSWER
Answered 2020-May-03 at 16:24You can use PerfView to collect an ETW trace for Visual Studio operations: How to: Diagnose UI delays caused by extensions
QUESTION
I'm Trying to Transform T4 Template using MSBUILD , but I'm getting the following error
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\TextTemplating\Micro soft.TextTemplating.targets(224,5): error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the asse mbly "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Build.Tasks.Cores.dll ". Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Curre nt\Bin\Microsoft.Build.Tasks.Cores.dll' or one of its dependencies. The system cannot find the file specified. [E:\csha rpprojects\Automateodessa\Automateodessa\Automateodessa.csproj]
My .tt file content
...ANSWER
Answered 2020-Mar-09 at 06:02Not able to Transform T4 Template using MSBUILD toolset=“16.0”
I think you just use msbuild.exe from an old framework or just use an old version of MSBuild like VS2017. Since you have set MSBUILD toolset="16.0"
, it means that you should use MSBuild v16.0 to build your project.
1) Please use C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
rather than any other old version of MSBuild.exe
2) just use Developer Command Prompt for VS2019
Update 1
Besides, if you still face the issue after the solution, I think there are something wrong with your project or VS Environment.
Solution
1) I think you have create a new VS2019 project and then migrate the old project into it to test whether it is your old project's problem.
2) Please do a repair in VS Installer or update your VS to the latest version to test whether it is the issue of your VS Environment.
Hope this could help you.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install TextTemplating
Run the demo program included in the repo
Read the Scriban language docs
Read the Text Templating wiki
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page