我正在尝试为解决方案中的所有项目创建XML文档,即使未在项目属性中选中该选项(这是关键点).
我正在使用TFS 2010 SP1并在我的构建定义的"MSBuild Arguments"字段中尝试使用"/ p:TreatWarningsAsErrors = true/p:GenerateDocumentation = true".它不会产生任何结果.
我也尝试使用/p:DocumentationFile=foo.xml,它确实可以工作但是我假设文件被最后编译的项目覆盖了,所以我尝试使用变量但是没有运气,我尝试了
/p:DocumentationFile=$(Project).xml,
/p:DocumentationFile=$(localProject).xml
/p:DocumentationFile=$(localBuildProjectItem).xml
Run Code Online (Sandbox Code Playgroud)
有没有办法为MSBUILD中的所有项目创建XML文档,即使项目中未选中该选项?
PS:是的,我已经看到了另一个与此类似的线程,但我不想修改项目,这就是用MSBUILD做的全部内容.
谢谢你的时间
我正在制作一个使用一些数据连接到数据库的组件,这个数据包括用户ID和密码,它将这些值存储在私有变量中,但任何程序员都可以在初始化后看到调试器中的值,所以我想知道SqlConnection如何隐藏该值,当我看到属性ConnectionString的值时,我看到除了密码之外的所有信息,它将它存储在某个地方,但它没有让它可见,即使在调试器中我也看不到任何存储的变量密码,我知道我可以使用SecureString保护密码,但我想知道如何实现SqlConnection对象.
谢谢.
胡安扎穆迪奥
我不确定我是否应该在这里问这个但是我们去了,而单元测试一个私有静态方法,其参数为short我只有在这个参数为0时才会得到一个MissingMethodException.
我正在使用针对Framework 4的VS 2010 SP1(完整版),这里是重现此错误的最小代码(我们正在升级VB6代码,所以不要粗鲁):
[DataContract]
public enum NotificationResult
{
[EnumMember]
Success,
[EnumMember]
StoredError,
[EnumMember]
InvalidId,
[EnumMember]
OperationError,
}
public sealed class NotificationContext
{
private static NotificationResult GetExecuteResult(short result)
{
NotificationResult executeResult;
switch (result)
{
case 0:
executeResult = NotificationResult.Success;
break;
case 1:
executeResult = NotificationResult.StoredError;
break;
case 2:
executeResult = NotificationResult.InvalidId;
break;
default:
executeResult = NotificationResult.OperationError;
break;
}
return executeResult;
}
}
Run Code Online (Sandbox Code Playgroud)
以下是我测试代码的方法:
PrivateType privateHelperType = new PrivateType(typeof(NotificationContext));
var actual = (NotificationResult)privateHelperType.InvokeStatic(
"GetExecuteResult", (short)1);
var actual2 = (NotificationResult)privateHelperType.InvokeStatic(
"GetExecuteResult", …
Run Code Online (Sandbox Code Playgroud) 我有一个这样定义的组件:
public class MyClass
{
public MyClass(ILogger<MyClass> logger)
{
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道使用此组件的开发人员是否会使用 application.json 或环境变量来配置记录器。
有没有办法获取记录器的当前 LogLevel,而不是尝试使用 IsEnabled 方法进行猜测?
我的目标是.NET 3.5 SP1,我正在使用CommentChecker验证我的XML文档,一切正常,直到我进入这样的类:
/// <summary>
/// documentation
/// </summary>
public sealed class MyClass {
/// <summary>
/// documentation
/// </summary>
public void Method() {
}
}
Run Code Online (Sandbox Code Playgroud)
在上面的例子中,据我所知,编译器为我的类生成一个默认构造函数.这个问题是CommentChecker会生成警告,告诉我构造函数缺少注释.
我试图修改程序以检测这种特殊情况并忽略它但我被卡住了,我已经尝试过IsDefined(typeof(CompilerGeneratedAttribute), true)
但是没有用.
简而言之,我如何使用反射检测默认构造函数?
首先让我说我知道动态,没有PIA,命名和可选参数,最后是协方差和逆变.
在我的项目中99%的时间我的代码都在C#中,我几乎从不做Office自动化,我不打算很快使用任何动态语言,除了对Office自动化是必要的,我认为命名和可选参数是错误的(不,重载不计,如果你有很多重载问题是在设计中,而不是语言).
因此,whats那里在静态类型的世界C#的家伙?唯一似乎是协方差和逆变,这听起来不错,但我希望更多的东西.我很兴奋尝试的唯一比特是Linq的并行扩展,但这是关于它的(并且[可用于3.5 作为CTP).
你为什么退出C#4?
我们有一个与TFS 2010交互的WCF服务,我们计划迁移到TFS 2012,因此我们安装了一个服务器来测试它,服务器安装了以下内容:
Windows Server 2012
SQL Server 2012
SharePoint 2013
TFS 2012
Run Code Online (Sandbox Code Playgroud)
我为我的服务创建了一个站点并试图运行,我收到以下消息:
Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Run Code Online (Sandbox Code Playgroud)
所以我将游泳池改为32位,但后来我受到了欢迎:
The Module DLL 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\isapi\spnativerequestmodule.dll' could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture.
Run Code Online (Sandbox Code Playgroud)
并且知道我被卡住了我用谷歌搜索但没有找到任何东西,我创建了一个带有vanilla HTML页面的新站点,只加载64位池.
我在服务器上检查了由TFS和SharePoint创建的站点,并且都是64位.
我最好的猜测是它与SharePoint 2013有关,但我不确定.
有关如何使网站在32位池上运行的任何想法?
谢谢
c# ×4
.net ×2
.net-4.0 ×2
ado.net ×1
constructor ×1
iis ×1
msbuild ×1
reflection ×1
tfs2010 ×1
tfs2012 ×1