我试图用Visual Studio构建一个WiX补丁.很容易.我使用Visual Studio构建,并构建它.但是,当我尝试运行生成的MSI时,我被告知
无法打开此安装包.请与应用程序供应商联系以验证这是否是有效的Windows Installer程序包.
理想情况下,我会创建一个小得多的msp路径文件,但为了简单起见,我可以使用MSI文件.如何使用Visual Studio执行此操作,或者,是否需要下拉到命令行并使用candle.exe,light.exe,torch.exe和pyro.exe?
WiX代码看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Patch
AllowRemoval="yes"
Classification="Update"
Comments="Some Patch for v 1.0.0"
Description="Updates Some Software to v 1.0.1"
DisplayName="Some software Patch 03/07/2011"
Manufacturer="MyMfg"
TargetProductName="SomeProduct">
<Media Id="1000" Cabinet="Inspect.cab">
<PatchBaseline Id="SomeBaseLine" />
</Media>
<PatchFamily
Id="SomeFamily"
Version="1.0.1.0"
ProductCode="<GUID>"
Supersede="yes">
<ComponentRef Id="ComponentsToPatch" />
</PatchFamily>
</Patch>
</Wix>
Run Code Online (Sandbox Code Playgroud) 我正在为大型企业服务基础架构创建构建和部署基础架构.我们将Build Server用于构建服务器,Visual Studio 2012用于生成WPP部署包,MSDeploy 2.1用于执行实际部署.(我们不能使用MSDeploy 3,因为它有很多错误 - 使用WMSvc等破坏了NTLM身份验证).
我创建了一个"Project.wpp.targets"文件并添加了以下属性:
<DeployOnBuild Condition="$(DeployOnBuild) == '' And '$(OutDir)' != '$(OutputPath)' ">true</DeployOnBuild>
<WebPublishMethod>Package</WebPublishMethod>
<DeployManagedPipelineMode>Integrated</DeployManagedPipelineMode>
<Disable_CopyWebApplication>True</Disable_CopyWebApplication>
Run Code Online (Sandbox Code Playgroud)
当编译在构建服务器上发生时,OutDir将与OutputPath不同,并且将激活WPP.构建输出以下文件:
Project.zip
Project.SetParameters.xml
Project.SourceManifest.xml
Project.deploy.cmd
Project.deploy-readme.txt
Run Code Online (Sandbox Code Playgroud)
project.zip里面是:
Archive.xml
Parameters.xml
systemInfo.xml
Run Code Online (Sandbox Code Playgroud)
问题1 - 什么是SourceManifest.xml文件,为什么它不在zip包中?似乎为部署创建zip文件包的全部原因是它完全自包含.SourceManifest文件是"松散的" - 我们不能再将zip文件放在我们的部署文件共享上了.为什么不在包中?它还指向构建服务器上的特定路径!
问题2 - 什么是Archive.xml文件?对SourceManifest.xml来说似乎有些多余 - 我看到了一个提供者,一些提供者等.在Microsoft文档中,他们在包中提到了"manifest.xml".此文件看起来像清单,但它被称为"archive.xml".文件名是否重要?manifest.xml与archive.xml不同吗?它们如何与SourceManifest.xml相关,它看起来类似但同时又不同?
问题3 - systemInfo.xml是什么?它似乎列出了在构建服务器上为IIS角色安装的所有组件.例如,如果我在本地计算机上运行build at命令行,它会列出已安装.NET 2.0和4.0以及我机器上各种IIS组件的许多True/False值.问题是这些设置与我实际想要部署的内容无关!MSDeploy是否会查看此文件?它可以被禁用吗?我绝对不希望构建服务器的配置工件影响生产!
自从我在QT 5.0.1(来自http://qt-project.org/downloads)和模块qtsingleapplication(最后一个版本来自http://qt.gitorious.org/qt-solutions)上移动后,我无法在Windows上编译).
在Linux下,编译仍然有效(Qt 4.8.2)
我不明白为什么.这是qtcreator的详细输出.
09:57:58:Exécutiondesétapespourle projet Wahoo ...
09:57:58:配置inchangée,étapeQMakesautée.
09:57:58:Débute:"D:\ Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe"D:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile.Release
mingw32-make [1]:输入目录'C:/ Documents and Settings/crazy/Bureau/Kowmedia.Wahoo/src /内置上映/发行"克++ -c -pipe -fno-保持-直列DLLEXPORT -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I. ...\wahoo -I"....\wahoo\qtsingleapplication\src"-I"D:\ Qt\Qt5.0.1\5.0.1\mingw47_32\include"-I"D:\ Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtWebKit"-I"D:\ Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtWidgets"-I"D:\ Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtXml"-I"D:\ Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtNetwork"-I"D:\ Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtGui" - 我"D:\ Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" - 我"释放"-I"." -一世"." -I"D:\ Qt\Qt5.0.1\5.0.1\mingw47_32\mkspecs\win32-g ++"-o release\qtsingleapplication.o ....\wahoo\qtsingleapplication\src\qtsingleapplication.cpp
克++ -pipe -fno-保持-直列DLLEXPORT -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB …
在以下程序中,输出始终为零或未定义的行为?
#include<iostream>
int main()
{
int i= i ^ i ;
std::cout << "i = " << i << std::endl;
}
Run Code Online (Sandbox Code Playgroud)
用gcc 4.8.0这段代码编译成功,输出为0.
想象一下,你有一个AFloat64类型的3维Julia数组size(A) = (2, 3, 3).
你如何使用二维数组一次分配这个数组的块?例如,假设我想A[1, :, :]成为单位矩阵.我会想到做这样的事情:
A = Array(Float64, 2, 3, 3)
A[1, :, :] = eye(3)
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我收到以下错误:
ERROR: argument dimensions must match
in setindex! at array.jl:592
Run Code Online (Sandbox Code Playgroud)
我知道那是因为size(A[1, :, :]) = (1, 3, 3),但我无法弄清楚如何:1)获得此片是公正(3, 3)那么eye(3)适合或2)请eye(3)也(1, 3, 3)符合切片的形状A.
有什么建议?
我学到了两件新东西:
A沿着另外两个维度中的任何一个进行切片,则结果是二维数组而不是三维数组,其中前导维度为1.A[1, :, :] = reshape(eye(3), (1, 3, 3)).这是次优的,我希望有一个更好的解决方案.所以这是我在使用表达式和函数时观察到的奇怪行为.
public int Age { get; set; }
public EyeColor EyeColor { get; set; }
public int Weight { get; set; }
public Func<Person, bool> AgeAndEyesMatch
{
get { return IsPersonYoung().Compile() + PersonHasRightEyeColor().Compile(); }
}
public Func<Person,bool> AgeAndWeightMatch
{
get { return IsPersonYoung().Compile() + IsPersonInShape().Compile(); }
}
private Expression<Func<Person, bool>> PersonHasRightEyeColor()
{
return person => person.EyeColor == EyeColor;
}
private Expression<Func<Person, bool>> IsPersonYoung()
{
return person => person.Age <= Age;
}
private Expression<Func<Person, bool>> IsPersonInShape()
{
return person => person.Weight …Run Code Online (Sandbox Code Playgroud) 对于大多数人(熟练的程序员)来说,标题听起来不太好,但我正在学习C#基础知识的第3周,我无法弄清楚如何解决下一个任务.我将为一堆城市存储一些温度,首先向用户询问cityName,然后询问该城市的实际温度.所有这些东西都应保存在列表<>中,我将使用Class和Constructor.当我尝试打印出结果(使用foreach)时,它打印出我的命名空间的名称和我的类的名称,如"Task_5.City"我的代码错误:
public class City //class
{
public string CityName { get; set; }
public int Temperature { get; set; }
public City(string name, int temp)//konstruktor
{
this.CityName = name;
this.Temperature = temp;
}
}
class Program
{
static void Main(string[] args)
{
var cityList = new List<City>();
Console.WriteLine("What is your city?");
string cityName = Console.ReadLine();
Console.WriteLine("What temperature for this city?");
int temp = Convert.ToInt32(Console.ReadLine());
City myCity = new City(cityName, temp);
cityList.Add(myCity);
foreach (var item in cityList)
{
Console.WriteLine(item);
}
Console.ReadLine(); …Run Code Online (Sandbox Code Playgroud) 当使用MSTest进行单元测试时,我创建了一个WPF窗口.此窗口关闭时,Visual Studio显示InvalidComObjectException:
COM object that has been separated from its underlying RCW cannot be used.
Run Code Online (Sandbox Code Playgroud)
它在退出后引发[TestMethod],并且堆栈仅包含外部代码(否InnerException).这就是我所拥有的:
StackTrace:
at System.Windows.Input.TextServicesContext.StopTransitoryExtension()
at System.Windows.Input.TextServicesContext.Uninitialize(Boolean appDomainShutdown)
at System.Windows.Input.TextServicesContext.TextServicesContextShutDownListener.OnShutDown(Object target, Object sender, EventArgs e)
at MS.Internal.ShutDownListener.HandleShutDown(Object sender, EventArgs e)
DeclaringType:
{Name = "TextServicesContext" FullName = "System.Windows.Input.TextServicesContext"}
Assembly:
{PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
Run Code Online (Sandbox Code Playgroud)
这是创建窗口的代码:
var myWindow = new SomeWindow(errors);
myWindow.ShowDialog();
Run Code Online (Sandbox Code Playgroud)
该窗口包含两个ListViews,其中包含一些文本元素和复选框
我有一个wix booststrapper项目,不能像普通的WiX项目那样进行本地化.如果我从booststrapper.wxs文件中提取硬代码字符串,那么编译器输出错误:
Light.exe:错误LGHT0100:本地化标识符xxx已在多个位置复制.请解决冲突
有没有人在boostrapper国际化方面有一些经验?
你能提一些建议吗?
我已经GetEnumerator为一个简单的类实现了这个方法,并且很惊讶我无法使用linq命令枚举器(调用this.OrderBy(x => x)无效).有人可以解释一下这里发生了什么吗?我做错了什么或只是想要迭代的调查员?
class Test
{
private Dictionary<int, string> dict
= new Dictionary<int, string>();
public IEnumerator<int> GetEnumerator()
{
return dict.Keys.GetEnumerator();
}
public Test()
{
dict[1] = "test";
dict[2] = "nothing";
}
public IEnumerable<int> SortedKeys
{
get { return this.OrderBy(x => x); } // illegal!
}
public void Print()
{
foreach(var key in this)
Console.WriteLine(dict[key]);
}
}
Run Code Online (Sandbox Code Playgroud) c# ×4
c++ ×2
wix ×2
dispatcher ×1
enumerator ×1
exception ×1
expression ×1
func ×1
julia ×1
linq ×1
msbuild-wpp ×1
msdeploy ×1
operators ×1
qt5 ×1
tfsbuild ×1
unit-testing ×1
votive ×1
windows ×1
wpf ×1