customtool

Running a T4 template using C#

∥☆過路亽.° 提交于 2019-12-04 08:05:48
问题 I have T4 template (mycode.tt) which generates a cs file. I usually right click the tt file and select RunCustomTool which internally takes an xml file and generate code for me. Now i want to run the custom tool using a c# windows application. So onclick of a button i want to run the Custom Tool . Is it possible to run the CustomTool from c#. Edit: I have 2 tt files and one of them doesn't have a codebehind cs file. But another has a .cs file attached with it and i am invoking the second file

Visual Studio custom tool for code generation… how do I find out what's going wrong?

冷暖自知 提交于 2019-12-04 07:15:24
I'm trying to create a custom tool for code generation in Visual Studio 2010. First I register it: "$(FrameworkSDKDir)Bin\NETFX 4.0 Tools\gacutil.exe" /if "$(TargetPath)" Then I add it via a reg key: [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\CLSID\{6A96476E-74F3-4AB3-9CCA-F15EC6104D84}] "RuntimeVersion"="v4.0.30319" "Class"="MapBuildTool.MapFileGenerator" "Assembly"="MapBuildTool, Version=1.0.0.0, Culture=en-US, PublicKeyToken=7d8abca94a1e38ae" "ThreadingModel"="Both" "InprocServer32"="C:\\Windows\\SysWOW64\\mscoree.dll" @="MapBuildTool" [HKEY_LOCAL_MACHINE\SOFTWARE

How to register “custom tool” with Visual Studio 2017 or Visual Studio 2019 to make it work?

跟風遠走 提交于 2019-11-30 15:30:54
问题 Background: We have a custom tool which takes the xml input and generates the cs output. A custom tool needs to register with the Visual studio in order to make it work with that version of visual studio. What we have done: We have done the custom tool registration with the Visual Studio 2015 which is working fine. But now the problem is with Visual Studio 2017. Problem: So far in my research, I found until Visual Studio 2015, VS had the direct registry entries which were allowing to register

How do I write to the Visual Studio Output Window in My Custom Tool?

喜欢而已 提交于 2019-11-28 03:34:41
I am writing a custom tool and I currently have it doing what I want as far as functionality. I would like to be able to write to Visual Studio if something goes wrong. (Incorrectly formatted code or whatever). Are there any standards for this? Right now I basically can force the tool to fail and Visual Studio puts in a warning that it has done so. I'd like a category in the Output window with any resulting messages I want to send. I could also live with a more descriptive task/warning in the Error list window. Output Window To write to the "General" output window in Visual Studio, you need to

How to hide files generated by custom tool in Visual Studio

邮差的信 提交于 2019-11-27 17:21:06
I would like the files generated by my custom tool to be hidden, but I cannot find any documentation on how this is done. An example of what I'm looking for is WPF code behind files. These files are not displayed in the Visual Studio project view, yet are compiled with the project and are available in IntelliSense. WPF code behind files (Window1.g.i.cs, for example), are generated by a custom tool. The solution is to create a Target that adds your files to the Compile ItemGroup rather than adding them explicitly in your .csproj file. That way Intellisense will see them and they will be

How do I write to the Visual Studio Output Window in My Custom Tool?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 00:07:03
问题 I am writing a custom tool and I currently have it doing what I want as far as functionality. I would like to be able to write to Visual Studio if something goes wrong. (Incorrectly formatted code or whatever). Are there any standards for this? Right now I basically can force the tool to fail and Visual Studio puts in a warning that it has done so. I'd like a category in the Output window with any resulting messages I want to send. I could also live with a more descriptive task/warning in the