我有一个使用WiX的项目.它在我的本地计算机上工作正常,但是当我发布到构建服务器时,构建会以下面的内容爆炸.
从MSBuild日志
Using "HeatDirectory" task from assembly "C:\Program Files (x86)\WiX Toolset v3.6\bin\\WixTasks.dll".
Task "HeatDirectory"
Command:
C:\Program Files (x86)\WiX Toolset v3.6\bin\Heat.exe dir "C:\Builds\3\Project\Foo Bar - CI\Sources\Company.Foobar.UI\obj\BuildServer\Package\PackageTmp\\" -cg Company.Foobar.UI_Project -dr INSTALLLOCATION -scom -sreg -srd -var var.WebServiceProjectDir -ag -sfrag -out web\Company.Foobar.UI.wxs
Could not load file or assembly 'file:///C:\Program Files (x86)\WiX Toolset v3.6\bin\Heat.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean …Run Code Online (Sandbox Code Playgroud) 是否可以进行不显眼的验证以使字段成为必需字段,但仅在其他属性发生变化时?
例如
[Required]
public Decimal Income {get; set;}
[Required]
public Decimal Tax {get; set;}
//Required if tax or income changes
public string ChangeReason {get; set;}
Run Code Online (Sandbox Code Playgroud)
我想过有多个后备存储字段并编写自定义验证器来比较这些,但是想知道是否有人有更好的建议?
假设上课
public class Foo
{
public List<Bar> Bar = new List<Bar>();
public string Something;
public TStatus Status;
}
Run Code Online (Sandbox Code Playgroud)
Bar是一个定义为的类
public class Bar
{
public string Code;
public string Message;
public TStatus Status;
}
Run Code Online (Sandbox Code Playgroud)
我需要迭代列表栏,但我不能使用foreach因为我需要实现IEnumerable我是一个新手,我很难解决如何实现它,任何帮助赞赏.