小编Jer*_*ink的帖子

将命令行变量传递到基于WiXx的Windows Installer MSI

我正在使用WiX构建一个MSI安装程序,我正在使用WixUI_Advanced.我的定义ApplicationFolder看起来像这样,遵循另一个SO答案(WiX技巧和提示)的建议.

  <Directory Id="TARGETDIR" Name="SourceDir">
     <Directory Id="$(var.PlatformProgramFilesFolder)">
        <Directory Id="APPLICATIONFOLDER" Name="$(var.InstallName)">
Run Code Online (Sandbox Code Playgroud)

我现在想让用户选择进行静默安装并ApplicationFolder在路径上传递名称,相对于相应的程序文件文件夹或绝对名称.

我知道我可以在命令行上传递公共属性值msiexec,但是如何将其用作值ApplicationFolder以及如何为绝对路径和相对路径设置它.

windows-installer wix command-line-arguments

14
推荐指数
1
解决办法
1万
查看次数

当我使用 tsconfig.json 文件时,Typescript 编译非常慢

当我使用项目文件 (tsconfig.json) 运行 tsc 时,需要很长时间(> 1 分钟)才能完成。当我在命令行或参数文件中指定相同的参数时,它会在几秒钟内完成。这发生在带有 typescript 2.7.2 的 Mac OS 上

这是我使用的 tsconfig.json:

{
  "compilerOptions": {
    "target": "es2017",
    "module": "commonjs",
    "outDir": "dist", 
    "rootDir": "src",  
    "sourceMap": true
  }
}
Run Code Online (Sandbox Code Playgroud)

当我使用 time 命令计时时,我得到以下结果:

> time tsc --diagnostics -p tsconfig.json

Files:           38
Lines:        34429
Nodes:       157429
Identifiers:  52565
Symbols:      50844
Types:        12929
Memory used: 86147K
I/O read:     0.02s
I/O write:    0.01s
Parse time:   0.64s
Bind time:    0.44s
Check time:   1.91s
Emit time:    0.19s
Total time:   3.19s

real    2m20.611s
user    0m34.914s
sys …
Run Code Online (Sandbox Code Playgroud)

typescript

7
推荐指数
1
解决办法
4807
查看次数

Linq-to-entities:如何创建对象(new Xyz()vs CreateXyz())?

在实体框架中添加新对象的最佳方法是什么?设计师添加了所有这些创建方法,但对我而言,在对象上调用new更有意义.生成的CreateCustomer方法例如可以像这样调用:

Customer c = context.CreateCustomer(System.Guid.NewGuid(), "Name"));
context.AddToCustomer(c);
Run Code Online (Sandbox Code Playgroud)

对我来说,这样做会更有意义:

Customer c = new Customer {
    Id = System.Guid.NewGuid(),
    Name = "Name"
};
context.AddToCustomer(c);
Run Code Online (Sandbox Code Playgroud)

后者更加明确,因为在构造中设置的属性被命名.我假设设计师故意添加创建方法.我为什么要用那些?

entity-framework

3
推荐指数
1
解决办法
1696
查看次数

为什么没有事务的1M记录插入比事务内部慢?

我正在使用.Net 3.5对SQL Server进行一些性能测试.我正在插入100万条记录.当我将它包装在一个事务(可序列化,RepeatabelRead或ReadUncommited)中时,它在我的系统上运行不到80秒.当我删除它在大约300秒内运行的事务.我希望不使用事务是将行插入数据库的最快方法,因为DBMS不需要考虑潜在的回滚.这里发生了什么?这是典型的SQL Server,SQL Server ADO.Net Provider,ADO.Net一般,DBMSes一般吗?

我有iSeries/DB2数据库的背景知识.在DB2中,您必须启用日记功能才能获得承诺控制和事务,并且日志记录相对昂贵.

我真正想要做的是比较SqlCommand插入与实体框架插入,但我对这些结果感到非常惊讶,我想先找出这里的内容.

在我用来运行测试的代码下面.当我运行以下代码时,大约需要74秒(在AtStart日志和AtEnd日志行之间测量)

using (SqlConnection sqlConnection = new SqlConnection(connectionString))
{
    sqlConnection.Open();
    SqlCommand deleteCommand = new SqlCommand("DELETE FROM LockTest");
    deleteCommand.Connection = sqlConnection;
    deleteCommand.ExecuteNonQuery();

    using (SqlTransaction transaction = sqlConnection.BeginTransaction(System.Data.IsolationLevel.Serializable))
    {
        try
        {
            if (DEBUG) LOG.Debug("AtStart");

            SqlCommand insertCommand = new SqlCommand();
            insertCommand.Connection = sqlConnection;
            insertCommand.Transaction = transaction;

            insertCommand.CommandText = "INSERT INTO LockTest (Id, Name, Description, Type) "  + 
                "VALUES (@id, @name, @description, @type)";
            SqlParameter idParameter = new SqlParameter("@id", System.Data.SqlDbType.UniqueIdentifier);
            insertCommand.Parameters.Add(idParameter);
            SqlParameter nameParameter = new SqlParameter("@name", System.Data.SqlDbType.NVarChar, …
Run Code Online (Sandbox Code Playgroud)

.net database sql-server transactions

3
推荐指数
1
解决办法
2081
查看次数

css中的@ font-face声明不起作用

我正在帮助我的姐姐将一个有人为她做的网站转换为html.

他们使用闪存中的花哨字体,我试图通过@ font-face在css文件中定义.我尝试在firefox,IE和chrome中打开页面,但我没有看到正确的字体.

我使用的声明是:

@font-face {
  font-family: "VAG Rounded";
  src: url("http://judith.huinink.net/chilax/VAGROUNL.OTF");
}
Run Code Online (Sandbox Code Playgroud)

http://judith.huinink.net/chilax/index.htm包含html.

http://judith.huinink.net/chilax/chilax.css包含完整的CSS.

我检查过我可以下载字体文件,但是当我在浏览器中打开页面时它根本不使用该字体.我必须忽视一些事情.有人有什么建议吗?

html css fonts font-face

2
推荐指数
3
解决办法
1万
查看次数

从XPath表达式返回一个布尔值

我们希望通过XPath表达式实现对元素的存在检查.XPath表达式是在外部定义的.我们正在尝试使用System.Xml.XPath中的XPathEvaluate扩展方法,但是当我们尝试执行以下操作时它会抱怨.

XDocument d = new XDocument(
                new XElement("test", 
                    new XElement("element"),
                    new XElement("element")));
bool b = (bool)d.XPathEvaluate("/test/element[exists()]");
Run Code Online (Sandbox Code Playgroud)

此函数当前失败,并出现"需要命名空间管理器或XsltContext.此查询具有前缀,变量或用户定义的函数.".如果我们尝试,我们会收到相同的消息exists(/test/element).

我们想在XPath表达式中表达的其他事情之一是元素的数量,例如count(/text/element) = 2.

测试条件应该是XPath表达式的一部分.

函数调用d.XPathEvaluate("/test/element[last()]")按预期进行求值.

有可能用XPathEvaluate这种方式吗?

[编辑]是的.

如果没有,.Net框架中是否有其他选择?

[编辑]是的.

[编辑]剩下的问题:为什么exists功能不起作用?

.net xpath

2
推荐指数
1
解决办法
6339
查看次数