我正在使用
Microsoft.VisualStudio.TextTemplating.Engine
Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates
这是我的密码。它直接从上面的示例中获取
Oleg Sych's
博客
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates;
using Microsoft.VisualStudio.TextTemplating;
namespace PropertyDirectivePot
{
class Program
{
static void Main(string[] args)
{
var arguments = new Dictionary<string, PropertyData>();
arguments.Add(âMyPropertyâ,
new PropertyData(Color.AntiqueWhite, typeof(Color)));
string currentDirectory = Directory.GetCurrentDirectory();
TemplateHost host = new TemplateHost(currentDirectory, arguments);
host.TemplateFile = Path.Combine(currentDirectory, âPropertyTest.ttâ);
string template = File.ReadAllText(host.TemplateFile);
ITextTemplatingEngine engine = new Engine();
string output = engine.ProcessTemplate(template, host);
string outputFile = Path.ChangeExtension(host.TemplateFile, â.txtâ);
File.WriteAllText(outputFile, output);
}
}
}
问题
我得到一份工作
System.EntryPointNotFoundException
在处理模板并返回输出代码文件时。。。
string output = engine.ProcessTemplate(template, host);
这个异常表明我在某个地方有一个组件版本不匹配,并且
googling
我发现其他人也遇到过这个问题,但我使用的组件版本要旧得多。我的版本是。。。
Visual Studio
SP19.0.30729.1
Microsoft.VisualStudio.textTemplateing
Microsoft.Practices.RecipeFramework.VisualStudio.Library
我有最新版本的GAX、GAT和VS2008 SDK(今天下载并安装)。
有人知道发生了什么事,或者我如何进一步调查吗?
如果可能的话,我真的不想开始使用跟踪器来跟踪调用堆栈:(