可以通过Visual Studio运行时文本模板在您的应用程序在运行时生成文本字符串。 执行应用程序的计算机不必具有 Visual Studio。 运行库模板有时称为"预处理文本模板"由于在编译时,该模板会生成运行时执行的代码。

将现有文件转换为运行时模板:

  • 将该文件的“自定义工具”属性设置为 TextTemplatingFilePreprocessor。【文本模板的自定义工具是TextTemplatingFileGenerator
  • 在文件开头插入下面的行 <#@ template language="C#" #>

运行时模板的tt的内容如下:

 <#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #> <h2>Sales figures</h2>
<table>
<# foreach (var item in m_data)
// m_data is declared in MyWebPageCode.cs
{ #>
<tr><td> <#= item.Key #> </td>
<td> <#= item.Value #> </td></tr>
<# } // end of foreach
#>
</table>

效果如下:

 // ------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 12.0.0.0
//
// 对此文件的更改可能会导致不正确的行为。此外,如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Test
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System; /// <summary>
/// Class to produce the template output
/// </summary> #line 1 "F:\study\share\Test\html.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "12.0.0.0")]
public partial class html : htmlBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write("<table>\r\n "); #line 7 "F:\study\share\Test\html.tt"
for (int i = 1; i <= 10; i++)
{ #line default
#line hidden
this.Write(" <tr><td>Test name "); #line 9 "F:\study\share\Test\html.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(i)); #line default
#line hidden
this.Write(" </td>\r\n <td>Test value "); #line 10 "F:\study\share\Test\html.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(i * i)); #line default
#line hidden
this.Write(" </td> </tr>\r\n "); #line 11 "F:\study\share\Test\html.tt"
} #line default
#line hidden
this.Write(" </table>");
return this.GenerationEnvironment.ToString();
}
} #line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "12.0.0.0")]
public class htmlBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == 0)
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == 0))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > 0))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
if ((indentLength > 0))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
 class Program
{
static void Main(string[] args)
{
html html = new html();
System.IO.File.WriteAllText("outputPage.html", html.TransformText());
Console.ReadKey();
} }
结果: <table>
<tr><td>Test name 1 </td>
<td>Test value 1 </td> </tr>
<tr><td>Test name 2 </td>
<td>Test value 4 </td> </tr>
<tr><td>Test name 3 </td>
<td>Test value 9 </td> </tr>
<tr><td>Test name 4 </td>
<td>Test value 16 </td> </tr>
<tr><td>Test name 5 </td>
<td>Test value 25 </td> </tr>
<tr><td>Test name 6 </td>
<td>Test value 36 </td> </tr>
<tr><td>Test name 7 </td>
<td>Test value 49 </td> </tr>
<tr><td>Test name 8 </td>
<td>Test value 64 </td> </tr>
<tr><td>Test name 9 </td>
<td>Test value 81 </td> </tr>
<tr><td>Test name 10 </td>
<td>Test value 100 </td> </tr>
</table>

若要在特定命名空间中放置已生成的类,请设置文本模板文件的“自定义工具命名空间”属性。

如果希望模板代码引用 .NET 或其他程序集(如 System.Xml.dll),应以常规方式将其添加到项目的“引用”中。

如果要以与 using 语句相同的方式导入命名空间,可以使用 import 指令

<#@ import namespace="System.Xml" #>

如果要在几个模板间共享文本,可以将文本放置在一个单独的文件中,然后在需要这些文本的每个文件中包含这些文本:

<#@include file="CommonHeader.txt" #> 

继承模式:基方法中的片段

  • 基类在类功能块<#+...#>中定义方法
  • 派生类可以调用基类中定义的方法

MyTextTemplate1.tt继承自SharedFragments.tt(生成的类MyTextTemplate1.cs 继承自SharedFragments.cs)

 SharedFragments.tt
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #> <#+
protected void SharedText(int n)
{
#>
Shared Text <#= n #>
<#+
}
// Insert more methods here if required.
#> SharedFragments.cs
// ------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 12.0.0.0
//
// 对此文件的更改可能会导致不正确的行为。此外,如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Test
{
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System; /// <summary>
/// Class to produce the template output
/// </summary> #line 1 "F:\study\share\Test\SharedFragments.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "12.0.0.0")]
public partial class SharedFragments : SharedFragmentsBase
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public virtual string TransformText()
{
this.Write(" \r\n");
return this.GenerationEnvironment.ToString();
} #line 7 "F:\study\share\Test\SharedFragments.tt" protected void SharedText(int n)
{ #line default
#line hidden #line 10 "F:\study\share\Test\SharedFragments.tt"
this.Write(" Shared Text "); #line default
#line hidden #line 11 "F:\study\share\Test\SharedFragments.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(n)); #line default
#line hidden #line 11 "F:\study\share\Test\SharedFragments.tt"
this.Write("\r\n"); #line default
#line hidden #line 12 "F:\study\share\Test\SharedFragments.tt" }
// Insert more methods here if required. #line default
#line hidden
} #line default
#line hidden
#region Base class
/// <summary>
/// Base class for this transformation
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "12.0.0.0")]
public class SharedFragmentsBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
private global::System.Collections.Generic.List<int> indentLengthsField;
private string currentIndentField = "";
private bool endsWithNewline;
private global::System.Collections.Generic.IDictionary<string, object> sessionField;
#endregion
#region Properties
/// <summary>
/// The string builder that generation-time code is using to assemble generated output
/// </summary>
protected System.Text.StringBuilder GenerationEnvironment
{
get
{
if ((this.generationEnvironmentField == null))
{
this.generationEnvironmentField = new global::System.Text.StringBuilder();
}
return this.generationEnvironmentField;
}
set
{
this.generationEnvironmentField = value;
}
}
/// <summary>
/// The error collection for the generation process
/// </summary>
public System.CodeDom.Compiler.CompilerErrorCollection Errors
{
get
{
if ((this.errorsField == null))
{
this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
}
return this.errorsField;
}
}
/// <summary>
/// A list of the lengths of each indent that was added with PushIndent
/// </summary>
private System.Collections.Generic.List<int> indentLengths
{
get
{
if ((this.indentLengthsField == null))
{
this.indentLengthsField = new global::System.Collections.Generic.List<int>();
}
return this.indentLengthsField;
}
}
/// <summary>
/// Gets the current indent we use when adding lines to the output
/// </summary>
public string CurrentIndent
{
get
{
return this.currentIndentField;
}
}
/// <summary>
/// Current transformation session
/// </summary>
public virtual global::System.Collections.Generic.IDictionary<string, object> Session
{
get
{
return this.sessionField;
}
set
{
this.sessionField = value;
}
}
#endregion
#region Transform-time helpers
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void Write(string textToAppend)
{
if (string.IsNullOrEmpty(textToAppend))
{
return;
}
// If we're starting off, or if the previous text ended with a newline,
// we have to append the current indent first.
if (((this.GenerationEnvironment.Length == )
|| this.endsWithNewline))
{
this.GenerationEnvironment.Append(this.currentIndentField);
this.endsWithNewline = false;
}
// Check if the current text ends with a newline
if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
{
this.endsWithNewline = true;
}
// This is an optimization. If the current indent is "", then we don't have to do any
// of the more complex stuff further down.
if ((this.currentIndentField.Length == ))
{
this.GenerationEnvironment.Append(textToAppend);
return;
}
// Everywhere there is a newline in the text, add an indent after it
textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
// If the text ends with a newline, then we should strip off the indent added at the very end
// because the appropriate indent will be added when the next time Write() is called
if (this.endsWithNewline)
{
this.GenerationEnvironment.Append(textToAppend, , (textToAppend.Length - this.currentIndentField.Length));
}
else
{
this.GenerationEnvironment.Append(textToAppend);
}
}
/// <summary>
/// Write text directly into the generated output
/// </summary>
public void WriteLine(string textToAppend)
{
this.Write(textToAppend);
this.GenerationEnvironment.AppendLine();
this.endsWithNewline = true;
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void Write(string format, params object[] args)
{
this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Write formatted text directly into the generated output
/// </summary>
public void WriteLine(string format, params object[] args)
{
this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
}
/// <summary>
/// Raise an error
/// </summary>
public void Error(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
this.Errors.Add(error);
}
/// <summary>
/// Raise a warning
/// </summary>
public void Warning(string message)
{
System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
error.ErrorText = message;
error.IsWarning = true;
this.Errors.Add(error);
}
/// <summary>
/// Increase the indent
/// </summary>
public void PushIndent(string indent)
{
if ((indent == null))
{
throw new global::System.ArgumentNullException("indent");
}
this.currentIndentField = (this.currentIndentField + indent);
this.indentLengths.Add(indent.Length);
}
/// <summary>
/// Remove the last indent that was added with PushIndent
/// </summary>
public string PopIndent()
{
string returnValue = "";
if ((this.indentLengths.Count > ))
{
int indentLength = this.indentLengths[(this.indentLengths.Count - )];
this.indentLengths.RemoveAt((this.indentLengths.Count - ));
if ((indentLength > ))
{
returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
}
}
return returnValue;
}
/// <summary>
/// Remove any indentation
/// </summary>
public void ClearIndent()
{
this.indentLengths.Clear();
this.currentIndentField = "";
}
#endregion
#region ToString Helpers
/// <summary>
/// Utility class to produce culture-oriented representation of an object as a string.
/// </summary>
public class ToStringInstanceHelper
{
private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
/// <summary>
/// Gets or sets format provider to be used by ToStringWithCulture method.
/// </summary>
public System.IFormatProvider FormatProvider
{
get
{
return this.formatProviderField ;
}
set
{
if ((value != null))
{
this.formatProviderField = value;
}
}
}
/// <summary>
/// This is called from the compile/run appdomain to convert objects within an expression block to a string
/// </summary>
public string ToStringWithCulture(object objectToConvert)
{
if ((objectToConvert == null))
{
throw new global::System.ArgumentNullException("objectToConvert");
}
System.Type t = objectToConvert.GetType();
System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
typeof(System.IFormatProvider)});
if ((method == null))
{
return objectToConvert.ToString();
}
else
{
return ((string)(method.Invoke(objectToConvert, new object[] {
this.formatProviderField })));
}
}
}
private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
/// <summary>
/// Helper to produce culture-oriented representation of an object as a string
/// </summary>
public ToStringInstanceHelper ToStringHelper
{
get
{
return this.toStringHelperField;
}
}
#endregion
}
#endregion
}
 MyTextTemplate1.tt
<#@ template language="C#" inherits="SharedFragments" #>
begin
<#SharedText() ;#>
end MyTextTemplate1.cs
// ------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 12.0.0.0
//
// 对此文件的更改可能会导致不正确的行为。此外,如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
// ------------------------------------------------------------------------------
namespace Test
{
using System; /// <summary>
/// Class to produce the template output
/// </summary> #line 1 "F:\study\share\Test\MyTextTemplate1.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "12.0.0.0")]
public partial class MyTextTemplate1 : SharedFragments
{
#line hidden
/// <summary>
/// Create the template output
/// </summary>
public override string TransformText()
{
this.Write("begin 1\r\n "); #line 3 "F:\study\share\Test\MyTextTemplate1.tt"
SharedText() ; #line default
#line hidden
this.Write("end 1\r\n");
return this.GenerationEnvironment.ToString();
}
} #line default
#line hidden
}

使用 T4 文本模板的运行时文本生成

T4运行时模板的更多相关文章

  1. T4学习- 3、创建运行时模板

    使用 Visual Studio 预处理过的文本模板,可以在运行时在应用程序中生成文本字符串. 执行应用程序的计算机不必具有 Visual Studio. 预处理过的模板有时称为"运行时文本 ...

  2. T4设计时模板调试

    在Visual Studio内调试T4设计时模板有多个方法:安装使用带调试功能的第三方工具,利用System.Diagnostics.Debugger实时调试器,VS内置的T4调试工具.使用第三方工具 ...

  3. T4学习- 2、创建设计时模板

    使用设计时 T4 文本模板,您可以在 Visual Studio 项目中生成程序代码和其他文件. 通常,您编写一些模板,以便它们根据来自模型的数据来改变所生成的代码. 模型是包含有关应用程序要求的关键 ...

  4. 魔改——MFC MDI程序 定制 文档模板 运行时全部打开 禁用关闭按钮

    ==================================声明================================== 本文原创,转载在正文中显要的注明作者和出处,并保证文章的完 ...

  5. [c++][语言语法]函数模板和模板函数 及参数类型的运行时判断

    参考:http://blog.csdn.net/beyondhaven/article/details/4204345 参考:http://blog.csdn.net/joeblackzqq/arti ...

  6. 【翻译】利用Qt设计师窗体在运行时创建用户界面(Creating a user interface from a Qt Designer form at run-time)

    利用Qt设计师窗体在运行时创建用户界面 我们利用Calculator窗体例子中创建的窗体(Form)来展示当一个应用(application)已经生成后,是可以在其运行时产生与例子中相同的用户界面. ...

  7. 将asp.net webapi的运行时版本由4.0升级到4.5.1时遇到的问题及解决

    更新package 更改.net运行时的版本之后,出现了错误提示,说需要改新以下组件: EntityFramework, EntityFramework.zh-Hans, Microsoft.AspN ...

  8. MFC六大核心机制之二:运行时类型识别(RTTI)

    上一节讲的是MFC六大核心机制之一:MFC程序的初始化,本节继续讲解MFC六大核心机制之二:运行时类型识别(RTTI). typeid运算子 运行时类型识别(RTTI)即是程序执行过程中知道某个对象属 ...

  9. Runtime运行时机制

    Runtime 又叫运行时,是一套底层的 C 语言 API,其为 iOS 内部的核心之一,我们平时编写的 OC 代码,底层都是基于它来实现的 我们需要了解的是 Objective-C 是一门动态语言, ...

随机推荐

  1. EF中的约定

    优先级:Fluent API >数据注释>约定 CodeFirst约定 主键约定 如果类的属性名为"ID"(不区分大小写)或类名的后面跟有"ID", ...

  2. Linq 关键字

    from var lowNums = from num in numbers            where num < 5            select num; numbers 是数 ...

  3. Servlet编码和解码

    1.request.setCharacterencoding("XXX"); 前提是POST提交 在客户端编码对value的值进行编码之前,通知客户端用什么码表(XXX)编码 2. ...

  4. C语言中的指针数组和数组指针

    代码: #include <iostream> using namespace std; int main(){ ]; ]; cout<<sizeof(a)<<en ...

  5. 连接SQLite 创建ADO.net实体类

    0.开发环境 win10,vs2013-x64 1.安装: sqlite-netFx451-setup-bundle-x86-2013-1.0.102.0.exe 注意事项:选在VisualStudi ...

  6. 无法捕获的异常:MissingMethodException

    今天一个同事发布站点,一直出现一些稀奇古怪的问题,各种各样的异常都有,根据这些异常去排查代码,都完全正常,很让人郁闷,因为代码里可能出异常的地方都记录了程序日志,所以他一直没去排查系统里的“应用程序日 ...

  7. ubuntu 下使用mysql

    第一步:安装mysql apt-get install mysql-server 第二步:设置允许远程登录 修改/etc/mysql/my.cnf(此文件为mysql的配置文件).将文件中的bindi ...

  8. ecstore后台规格超过一定数量保存丢失

    问题描述: 后台规格超过一定数量保存丢失,规格新增不了,删除出问题等不正常情况. 解决方法: 经过波波的不懈努力和日夜冥想终于破了.分析其原因就是因为多个规格组合生成的表单域太多,与php.ini配置 ...

  9. 学习ReactNative笔记整理一___JavaScript基础

    学习ReactNative笔记整理一___JavaScript基础 ★★★笔记时间- 2017-1-9 ★★★ 前言: 现在跨平台是一个趋势,这样可以减少开发和维护的成本.第一次看是看的ReactNa ...

  10. iOS7适配问题

    iOS7适配问题 2013-09-28 08:32:37     我来说两句      作者:冻僵的企鹅 收藏    我要投稿 iOS 7发布了,适配问题来了,开发者都忙起来了. 先记一个iOS7 的 ...