我想为Provider"Microsoft-Windows-HttpService"检索清单xml文件.
我正在使用Microsoft.Diagnostics.Tracing库来使用我的.Net应用程序中的ETW事件.
该库有一些内置的解析器,如KernelTraceEventParser,ClrTraceEventParser.但它没有解析器Http Service.我正在尝试为此创建新的解析器.
我尝试下面的命令来生成清单
perfView /onlyProviders=*Microsoft-Windows-HttpService collect
Run Code Online (Sandbox Code Playgroud)
从生成的.zip文件,运行以下命令生成清单.
perfView /noGui userCommand DumpEventSourceManifests PerfViewData.etl.zip
Run Code Online (Sandbox Code Playgroud)
现在使用TraceParserGen生成CSharp代码
TraceParserGen ManifestFileName
Run Code Online (Sandbox Code Playgroud)
但这给了我错误:读取清单文件Microsoft-Windows-HttpService.manifest.xml错误:错误Microsoft-Windows-HttpService.manifest.xml(42):未定义Id SrvdFrmCache
我也尝试为少数事件创建手动类,它会读取事件但无法读取有效负载.
请告诉我如何为此提供程序生成正确的清单并生成解析器.
有人可以解释一下 ATOM 服务和 REST 服务之间的区别吗?
ATOM 服务格式是一种基于 XML 的数据格式,但想知道它与 REST 服务有何不同。
谢谢。
我在我的页面上显示了一组数据.我正在为每一行显示标签和文本框.
以下是我的视图中的示例代码:
@using (Html.BeginForm())
{
<input type="submit" value="Ok" />
@for (int index = 0; index < Model.Persons.Count; index++ )
{
@Model.Persons[index].Name
@Html.TextBoxFor(m => Model.Persons[index].Amount)
}
}
Run Code Online (Sandbox Code Playgroud)
在Post Action中,我是更新金额(比如增加5).
[HttpPost]
public ActionResult Persons(PersonList presenter)
{
for (int index = 0; index < presenter.Persons.Count; index++)
{
presenter.Persons[index].Amount += 5;
}
return View(presenter);
}
Run Code Online (Sandbox Code Playgroud)
此更新金额未反映在页面上.但是,如果我使用下面的代码,那么它会正确显示,如
@Model.Persons[index].Amount
Run Code Online (Sandbox Code Playgroud)
要么
<input type="text" id=@("Persons_" + index + "__Amount") name="Persons[@index].Amount " value="@Model.Persons[index].Amount" ></input>
Run Code Online (Sandbox Code Playgroud)
我想这种行为的原因是为什么会发生这种情况?
任何帮助,将不胜感激.
我想创建两个基于URI中的查询字符串参数而变化的Rest方法.
喜欢
[WebGet(UriTemplate = "Guest/{guestId}?day={day}&type={type}")]
[OperationContract(Name = "GetDetailByDayAndActivity")]
public GuestDetail GetDetail(string guestId, DateTime day, string type)
[WebGet(UriTemplate = "Guest/{guestId}?day={day}")]
public GuestDetail GetDetail(string guestId, DateTime day)
Run Code Online (Sandbox Code Playgroud)
这给出了错误:
"Operation 'GetDetailByDayAndActivity' in contract 'IRestService' has a UriTemplate that expects a parameter named 'TYPE', but there is no input parameter with that name on the operation. "
访问仅具有day参数的方法时: http://testserver/GuestService/Guest/0?day=2011-10-20
怎么能实现这一目标?
我在下面的方法中得到代码分析错误.
public static OracleCommand CreateStoredProcedureCommand(string name,
OracleConnection connection)
{
return new OracleCommand(name, connection) { CommandType = CommandType.StoredProcedure };
}
Run Code Online (Sandbox Code Playgroud)
CA2000:Microsoft.Reliability:在方法'StoredProcedureHelper.CreateStoredProcedureCommand(string,OracleConnection)'中,对象'command'未沿所有异常路径放置.在对所有引用超出范围之前,调用System.IDisposable.Dispose对象'command'
如何在不压制这个的情况下解决这个问题?