我的项目使用Sandcastle和Sandcastle帮助文件生成器生成文档.
我们使用的是自定义版本的script_manifold.js,它可以跨页面保留用户的语言首选项(默认版本会重置每个页面的语言首选项).
目前,该脚本位于Sandcastle\presentation\VS2005\scripts文件夹中.
有没有办法用自定义版本覆盖此脚本,而不必混淆Sandcastle安装?也就是说,我可以将一个文件与我的源代码一起检入源代码控制,并以某种方式使用SHFB而不是默认的Sandcastle文件?
祸患,祸患和祸患.为什么Wix难以安装.NET程序集SOOOOOO!
我正在安装一个在.NET中实现的COM Inprocess Server,在我的Wix安装中我需要为它创建注册表项.我不想这样做,我宁愿Wix有一个相当于RegAsm,但他们让我手动这样做.我厌倦了因为暗示这有点神秘而受到抨击,所以我放弃并试图以声明的方式做这件事,就像一个好孩子.那么,这就是我的注册表内容现在的样子:
<File Id="filDriverAssembly" Source="$(var.TiGra.Astronomy.AWRDriveSystem.TargetPath)" KeyPath="yes" Vital="yes" Assembly=".net">
<!--<Class Context="InprocServer32" Description="$(var.InstallName)" Id ="$(var.DriverGuid)" ThreadingModel ="both" >
<ProgId Description="$(var.InstallName)" Id ="$(var.DriverId)" />
</Class>-->
</File>
<RegistryKey Root="HKCR" Key="$(var.DriverId)" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="$(var.DriverTypeName)"/>
<RegistryKey Key="CLSID">
<RegistryValue Type="string" Value="$(var.DriverGuid)" />
<RegistryKey Key="$(var.DriverGuid)">
<RegistryValue Type="string" Value="$(var.DriverTypeName)"/>
<RegistryKey Key="InprocServer32">
<RegistryValue Type="string" Value="mscoree.dll" />
<RegistryValue Type="string" Name="ThreadingModel" Value="Both"/>
<RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/>
<RegistryValue Type="string" Name="Assembly" Value="!(bind.AssemblyFullName.filDriverAssembly)"/>
<RegistryValue Type="string" Name="RuntimeVersion" Value="2.0.50727"/>
<RegistryValue Type="string" Name="CodeBase" Value="file:///[#filDriverAssembly]" />
<RegistryKey Key="!(bind.fileVersion.filDriverAssembly)" >
<RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/>
<RegistryValue Type="string" Name="Assembly" …Run Code Online (Sandbox Code Playgroud) 这是我的一个类中的构造函数:
public SemanticVersion(string version)
{
Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(version));
Contract.Ensures(MajorVersion >= 0);
Contract.Ensures(MinorVersion >= 0);
Contract.Ensures(PatchVersion >= 0);
Contract.Ensures(PrereleaseVersion != null);
Contract.Ensures(BuildVersion != null);
var match = SemanticVersionRegex.Match(version);
if (!match.Success)
{
var message = $"The version number '{version}' is not a valid semantic version number.";
throw new ArgumentException(message, nameof(version));
}
MajorVersion = int.Parse(match.Groups["major"].Value, CultureInfo.InvariantCulture);
MinorVersion = int.Parse(match.Groups["minor"].Value, CultureInfo.InvariantCulture);
PatchVersion = int.Parse(match.Groups["patch"].Value, CultureInfo.InvariantCulture);
PrereleaseVersion = match.Groups["prerelease"].Success
? new Maybe<string>(match.Groups["prerelease"].Value)
: Maybe<string>.Empty;
BuildVersion = match.Groups["build"].Success
? new Maybe<string>(match.Groups["build"].Value)
: Maybe<string>.Empty;
}
Run Code Online (Sandbox Code Playgroud)
Code Contracts static checker标记错误: …
我需要将一些ANSI C代码导入到我正在处理的项目中.由于我不想进入的原因,我想将代码重构为C#而不是尝试包装原始代码.我可能需要花几天的时间手工完成这项工作,但在我开始之前,是否有一个自动化工具可以帮助我完成大部分工作?我是一个小气鬼,我正在做的工作是无偿的,所以只有免费的工具.
我正在实现一组类和相应的接口,我希望每个类都有一组公共属性和一组仅特定于该类的专用属性.所以,我正在考虑按以下方式定义接口:
interface ICommon {...} // Members common to all widgets
interface IWidget1 {...} // specialized members of widget type 1
interface IWidget2 {...} // specialized members of widget type 2
Run Code Online (Sandbox Code Playgroud)
我试图在接口或类中继承.所以,具体来说,我可以这样做:
interface IWidget1 : ICommon {...}
interface IWidget2 : ICommon {...}
class Widget1 : IWidget1 {...}
class Widget2 : IWidget2 {...}
Run Code Online (Sandbox Code Playgroud)
......或者像这样......
class Widget1: ICommon, IWidget1 {...}
class Widget2: ICommon, IWidget2 {...}
Run Code Online (Sandbox Code Playgroud)
是否有任何令人信服的理由去某种方式?
更新:如果类必须COM可见,它会影响答案吗?
我让MSpec与ReSharper 6一起工作时遇到了麻烦.我刚刚从NuGet包中安装了MSpec:

接下来,我从Visual Studio退出,打开一个提升的命令提示符并从packages\tools文件夹运行安装脚本:

最后,重新加载Visual Studio.没有骰子!在ReSharper选项中,文本编辑器中没有图标,也没有插件.

我究竟做错了什么?MSpec网站说这应该工作:(
最近我在TeamCity构建中运行我的MSpec测试时遇到了问题.这发生在两个不同的(不相关的)项目上.一切都在本地工作正常,但是当TeamCity构建运行时,我得到一些MSpec类型的MissingMethodExceptions.
然后构建继续运行我的规范的所有5(到目前为止),所有这些都通过.虽然构建失败,因为该步骤以错误结束.
如果它有所不同,我的目标是.NET 4.5并使用mspec-clr4.exe在TeamCity服务器上运行测试.我使用MSpec 0.5.9并使用TeamCity的NuGet安装程序直接从NuGet中获取它.我们在TeamCity 7.1上
这是我的构建步骤配置

这是日志文件输出的一部分:
[04:27:12]Step 3/4: Unit test and Code Coverage (MSpec) (47s) [04:27:12]Starting: C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit [04:27:12]in directory: C:\BuildAgent\work\13af8c5b6a6273c6 [04:27:22]JetBrains dotCover Console Runner v2.0.425.72. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved. [04:27:22] [04:27:39][JetBrains dotCover] Coverage session started [15/10/2012 04:25:58] [04:27:45]Running specifications. [04:27:47] System.MissingMethodException: No parameterless constructor defined for this object. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& …
我有一个集合,特别是一个IList<T>.我知道集合中的两个元素,startElement和endElement.
是否有一个LINQ查询将从返回枚举startElement到endElement,包容性?
我想过使用sequence.SkipWhile(p=>p!=startElement).TakeWhile(q=>q!=endElement)但是错过了最后一个元素......
我最近尝试将存储库导入 GitHub(来自 Bitbucket),但导入失败。GitHub 技术支持通知我,他们在存储库中发现了“错误日期”问题,我应该git fsck在存储库上运行。所以我从 BitBucket 克隆它并运行git fsck,这就是我得到的:
git fsck Checking object directories: 100% (256/256), done.
error in commit fda45b4b6b06f6b815341c1f26de827c769f48b6: badDate: invalid
author/committer line - bad date error in commit
636d259fd0ac343af2a5561ff799a54a6aeb9b1c: badDate: invalid
author/committer line - bad date error in commit
41dc786816992e3c42c904e8c848aa1078475386: badDate: invalid
author/committer line - bad date error in commit
c55a0fa0d98e02aa4621be202d7b7d21ed2ff2ab: badDate: invalid
author/committer line - bad date error in commit
e6ad8f5ea7cf6441b6ea6ab5583117113a8f49fb: badDate: invalid
author/committer line - bad date error in commit
4aea97fdd999484319a9fbbc4dc42b024e1eba80: badDate: …Run Code Online (Sandbox Code Playgroud) 我有一个接口,沿着这些方向定义:
Interface foo
{
int someProperty {get; set;}
Dictionary<string, object> Items;
}
Run Code Online (Sandbox Code Playgroud)
实现此接口的具体类需要为COM Interop注册.一切都编译好,程序集似乎注册正常,但是当试图创建COM对象时(例如从PowerShell)我得到一个错误.
这似乎与我正在使用的通用Dictionary <>类有关.所以这是一个问题: