ls -R或dir/s可以列出提交/分支中的所有文件.我试图在C#中创建动态元标记,但它给出以下错误:
无法修改Controls集合,因为控件包含代码块(即<%...%>)
这是我添加的代码:
HtmlMeta meta = new HtmlMeta();
meta.Name = "keywords";
meta.Content = "book,paper";
Page.Header.Controls.Add(meta);
Run Code Online (Sandbox Code Playgroud)
非常感谢你.
我在BuildAgent上运行持续集成构建,但我无法正常工作.我最近将代码库更改为C#6.0,并将项目更改为ToolsVersion 14.
我在Build Server(TFS 2012)上安装了Visual Studio 2015.如果我现在检查C#6.0代码,则构建在第一个项目上失败("$"是意外的或"某事")
BuildTemplate是"DefaultTemplate.11.1"如果我检查日志文件,构建调用错误的csc.exe(C:\ Windows\Microsoft.NET\Framework64\v4.0.30319\Csc.exe)
如果我使用没有任何开关的项目启动MSBuild/14.0/Bin/MSBuild可执行文件,则构建成功.为什么TFS BuildAgent不使用ToolsVersion,如何让TFS 2012构建我的Visual Studio 2015解决方案
如果我添加MSBuildArgument /tv:14.0它仍然失败.因为它称为MSBuild的第12版,它是Visual Studio 2015附带的.NET 4.6 RC Framework的一部分.
如果我尝试运行我的UnitTest,更改MSBuild Activity的ToolsPath确实可以使Build工作但是吐出子弹.我得到了一个Missing dll"Microsoft.VisualStudio.TestPlatform.Utilities.dll"异常.(VS2012也在Build Server上安装).
更新:我现在在单元测试中遇到了不同的错误:
TF900548: An error occurred publishing the Visual Studio test results.
Details: 'Method not found:
'System.Collections.Generic.IEnumerable<System.String>
Microsoft.VisualStudio.TestPlatform.Utilities.InferSettingsHelper.MergeRunSettingsAndFindCompatibleSources(Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture
ByRef,
Microsoft.VisualStudio.TestPlatform.ObjectModel.FrameworkVersion
ByRef, System.String, System.String,
System.Collections.Generic.IDictionary`2<System.String,System.Collections.Generic.KeyValuePair`2<Microsoft.VisualStudio.TestPlatform.ObjectModel.Architecture,Microsoft.VisualStudio.TestPlatform.ObjectModel.FrameworkVersion>>,
System.Xml.XPath.IXPathNavigable, System.String ByRef)'.'
Run Code Online (Sandbox Code Playgroud) 如何在TFS 2012上使用C#6.0功能构建Visual Studio 2015解决方案,而无需在构建代理上安装Visual Studio 2015(使用Microsoft Build Tools 2015 RC)
我已经安装了MSBuild工具,但我仍然有例外.如何告诉我的构建模板使用MSBuild 14(仅适用于一个项目)
为什么我的TFS 2012编译异步并等待(c#5.0)而BuildAgent只安装了Visual Studio 2012而没有任何问题?
我尝试将BuildProcessTemplate的ToolPath更改为MSBuild/14.0 /但是我遇到了构建错误:
C:\ Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316):"csc2.exe"已退出,代码为-532462766.
安装Microsoft.Net.Compilers 1.0.0-rc2编译器会出现相同的错误.
如果我使用命令行编译项目,我会得到完全相同的错误/尽管在使用具有完全相同参数的命令行时我的开发机器上没有错误.
这是我在命令行中获得的异常:
C:\Program Files (x86)\MSBuild\14.0\bin\csc2.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /highentro.....
Unhandled Exception: System.InvalidProgramException: Common Language Runtime detected an invalid program.
at System.Collections.Immutable.SecurePooledObject`1.Use[TCaller](TCaller& caller)
at System.Collections.Immutable.SortedInt32KeyNode`1.Enumerator.PushLeft(SortedInt32KeyNode`1 node)
at System.Collections.Immutable.SortedInt32KeyNode`1.Enumerator..ctor(SortedInt32KeyNode`1 root)
at System.Collections.Immutable.ImmutableDictionary`2.Enumerator..ctor(SortedInt32KeyNode`1 root, Builder builder)
at Microsoft.CodeAnalysis.RuleSet.GetDiagnosticOptionsFromRulesetFile(Dictionary`2 diagnosticOptions, String resolvedPath, IList`1 diagnosticsOpt, CommonMessageProvider messageProviderOpt)
at Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser.Parse(IEnumerable`1 args, String baseDirectory, String additionalReferencePaths)
at Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser.CommonParse(IEnumerable`1 args, String baseDirectory, String …Run Code Online (Sandbox Code Playgroud) 我想使用Mono + Restsharp在Raspberry上执行HttpPost.
我尝试在代码中重现的Httpie调用看起来像这样:
http POST https://XXXXX.azurewebsites.net/api/report key=value
Run Code Online (Sandbox Code Playgroud)
这是C#代码:
RestClient nodeRed = new RestClient("http://XXXXX.azurewebsites.net/");
var request = new RestRequest("api/report", Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddBody(new { Timestamp = DateTime.Now, Data = "Test" });
request.Timeout = 5000;
var response = nodeRed.Execute(request);
Run Code Online (Sandbox Code Playgroud)
代码运行正常,它只是无法正常工作.响应不包含任何内容(在httpie/MS .NET Framework上具有"成功"的服务器响应).
我已经在Mono上发现了证书的内容.运行
sudo certmgr -ssl -v -m "https://XXXXX.azurewebsites.net"
Run Code Online (Sandbox Code Playgroud)
告诉我它第一次添加两个证书.再次运行它会再次添加第一个证书(并再次),因为它不起作用.
X.509证书v3发布自:C = IE,O =巴尔的摩,OU = CyberTrust,CN = Baltimore CyberTrust Root颁发给:C = US,S =华盛顿,L = Redmond,O = Microsoft Corporation,OU = Microsoft IT, CN = Microsoft IT SSL SHA2有效期:19/12/2013 20:07:32有效期至:19/12/2017 …
我在InitializeComponent-method 获得了文件加载器异常(第一次机会),或者调试器在x:Class多个WPF用户控件的xaml-root属性处断开.尽管异常减慢了导航的速度,但一切都运行良好.
这是异常消息:
无法加载文件或程序集'Company.Solution.UserInterface,Version = 0.1.5568.25577,Culture = neutral,PublicKeyToken = 45069ab0c15881ce'或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(HRESULT异常:0x80131040)
这是Fusion日志:
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable D:\Development\Product\Main\src\Company.Product \bin\Debug\Product.vshost.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Company.Product .UserInterface, Version=0.1.5568.25577, Culture=neutral, PublicKeyToken=45069ab0c15881ce
(Fully-specified)
LOG: Appbase = file:///D:/Development/Product/Main/src/Company.Product/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Development\Product \Main\src\Company.Product \bin\Debug\Product .vshost.exe.Config
LOG: Using …Run Code Online (Sandbox Code Playgroud) 我正在开发一个应该能够自动更新的客户端应用程序(.NET).将使用Simple WiX/MSI安装程序部署该应用程序.
我需要的是:
有没有合适的框架/模式来存档?
我发现/尝试了以下内容:
是否有任何积极的开发和可靠的解决方案(他们不需要是免费的,也不需要OpenSource)?
我昨天刚开始玩 AWS CDK,发现了一些非常奇怪的东西。
首先,我将 TypeScript 用于我的 CDK 应用程序(我曾经cdk init --language typescript生成项目文件并尝试导入aws-ec2模块,所以这就是我所做的:
import cdk = require('@aws-cdk/core');
import ec2 = require('@aws-cdk/aws-ec2');
export class vpcStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
//.... all other codes go here....
Run Code Online (Sandbox Code Playgroud)
但是,以这种方式导入 aws-ec2 模块时,在尝试部署堆栈时出现此错误:
? Unable to compile TypeScript:
lib/cdk-type_script-stack.ts:2:22 - error TS2307: Cannot find module '@aws-cdk/aws-ec2'.
2 import ec2 = require('@aws-cdk/aws-ec2');
~~~~~~~~~~~~~~~~~~
Subprocess exited with error 1
Run Code Online (Sandbox Code Playgroud)
这很奇怪,因为这里的API 文档清楚地说明这是我应该在打字稿中导入aws-ec2模块的方式
我错过了什么吗?任何帮助将不胜感激,也提前致谢!
在我们的应用程序中,我们使用async/await和Tasks工作了很多.因此它确实使用Task.Run很多,有时使用内置的取消支持CancellationToken.
public Task DoSomethingAsync(CancellationToken cancellationToken)
{
return Task.Run(() =>
{
while (true)
{
if (cancellationToken.IsCancellationRequested) break;
//do some work
}
}, cancellationToken);
}
Run Code Online (Sandbox Code Playgroud)
如果我现在使用CancellationToken取消执行,则执行会在下一个循环开始时停止,或者如果Task根本没有启动,则会抛出异常(Task.Run中的TaskCanceledException).现在的问题是为什么Task.Run使用Exception控制成功取消而不是仅返回已完成的Task.是否有任何具体原因MS没有坚持"不要使用例外来控制执行流程"规则?
如何在一个完全无用的try catch(TaskCancelledException)块中避免使用Boxing支持取消(这很多)的每个方法?
我最近迁移了一个项目,其中.NET 4引入.NET 4.7.2了 WinForms DataGridView 标头的更改。
如您所见,我当前单击的单元格的标题未被选中。迁移后,相同的 DataGridView 如下所示:
我在发行说明
中找不到任何提及 WinForms DataGridView 更改的信息
我尝试使用以下代码设置颜色, 如何更改 winform DataGridview 标头的颜色?
this.dgvUserFields.ColumnHeadersDefaultCellStyle.BackColor = System.Drawing.SystemColors.ControlDark;
this.dgvUserFields.EnableHeadersVisualStyles = false;
Run Code Online (Sandbox Code Playgroud)
但代码似乎没有改变任何东西。
一些资源是否确认了重大更改,以及如何修复它?
c# ×6
msbuild ×2
tfs ×2
tfs2012 ×2
.net ×1
amazon-ec2 ×1
async-await ×1
auto-update ×1
aws-cdk ×1
datagridview ×1
deployment ×1
git ×1
module ×1
mono ×1
probing ×1
raspberry-pi ×1
restsharp ×1
roslyn ×1
ssl ×1
winforms ×1
wpf ×1