草庐IT

application_name

全部标签

c# - 管理 Application Insights Cookie

我想知道应用程序洞察力如何与cookie一起使用,因为我想了解用户和session跟踪,所以我一直在研究并...这里简单介绍一下这个理论:WheneverApplicationInsightsSDKgetarequestthatdoesn’thaveapplicationinsightsusertrackingcookie(setbyApplicationInsightsJSsnippet)itwillsetthiscookieandstartanewsession.(fromapmtips)2.UserTelemetryInitializerupdatestheIdandAcquis

c# - 如何使用 AutomationProperties.Name?

问题任何人都可以解释(最好使用代码示例)AutomationProperties.Name属性如何以编程方式和声明方式与XAML一起使用吗?解释我了解到,例如,VisualStudio2010中的编码UI生成器将窗口的名称作为SearchProperty。由于我的窗口名称发生变化,我希望有一个常量SearchProperty,我的编码UI测试可以依赖它。在下面的代码示例中,我不希望窗口标题被硬编码为“管道1的属性”,因为它发生了变化。代码示例[GeneratedCode("CodedUITestBuilder","10.0.30319.1")]publicclassUIListView

c# - MVC 全局错误处理 : Application_Error not firing

我正在尝试在我的MVC应用程序中实现全局错误处理。我的Application_Error中有一些逻辑重定向到ErrorController但它不起作用。我在Global.aspx的Application_Error方法中有一个断点。当我强制异常时,断点没有被击中。有什么想法吗? 最佳答案 您可以尝试使用这种方法进行测试:protectedvoidApplication_Error(objectsender,EventArgse){varerror=Server.GetLastError();Server.ClearError();R

c# - Visual Studio 变得疯狂 : 'The directory name is invalid' error when trying to compile

出于一些非常奇怪的原因,我的VisualStudio2008在尝试编译C#项目时尝试将可执行文件的输出写入与可执行文件同名的目录,至少看起来这就是错误所在消息暗示。在我的任何项目上运行编译后,CSC.EXE报告以下编译器错误:Couldnotwritetooutputfile'D:\Projects\Examples\StringBuilderVsString\obj\Release\StringBuilderVsString.exe'--'Thedirectorynameisinvalid.'当我查看obj\Release或obj\Debug时,所有中间资源(如StringBuild

c# - "Both use the XML type name X, use XML attributes to specify a unique XML name and/or namespace for the type"怎么解决?

我有以下枚举定义...namespaceItemTable{publicenumDisplayMode{Tiles,Default}}namespaceEffectiveItemPermissionTable{publicenumDisplayMode{Tree,FullPaths}}...然后我有以下类(class)...publicclassTablewhereTDisplayMode:struct{//publicpublicTDisplayModeDisplayMode{get{returnmDisplayMode;}set{mDisplayMode=value;}}//pri

c# - 路由 : How to hide action name in url?

在MVC默认路由中routes.MapRoute("Default",//Routename"{controller}/{action}/{id}",//URLwithparametersnew{controller="Home",action="Index",id=UrlParameter.Optional}//Parameterdefaults);每当访问索引操作时,当访问“索引”操作时,url不会显示操作名称。我想在另一个Controller上获得该行为,该Controller正在检索单个项目的数据。我希望将默认操作命名为“get”,对于此操作,我希望url不显示操作名称,只显示

c# - "Service X has zero application endpoints"除非我在代码中添加端点 - 为什么?

我关注了thisMSDNarticle彻底创建托管在托管NT服务中的WCF服务。当我在服务控制台中单击“开始”时,我会在事件查看器中看到以下内容:Servicecannotbestarted.System.InvalidOperationException:Service'MyServiceNamespace.RequestProcessorImpl'haszeroapplication(non-infrastructure)endpoints.Thismightbebecausenoconfigurationfilewasfoundforyourapplication,orbecau

c# - 无法从传输连接读取数据 : The connection was closed error in console application

我在控制台应用程序中有这段代码,它在一个循环中运行try{HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create(search);request.Headers.Add("Accept-Language","de-DE");request.Method="GET";request.Accept="text/html";using(HttpWebResponseresponse=(HttpWebResponse)request.GetResponse()){using(StreamReaderreader=newStreamRead

c# - new FileInfo(path).Name 与 Path.GetFileName(path)

哪个更好用,为什么?我的意思是这两个命令在哪些方面不同以及如何不同?性能、可读性……newFileInfo(path).Name或Path.GetFileName(path) 最佳答案 因为您不必为使用Path.GetFilename()创建新对象,所以性能会更好。这是两者的比较:代码:Path.GetFileName("G:\\u.png")IL:IL_0000:ldstr"G:\u.png"IL_0005:callSystem.IO.Path.GetFileName代码:newFileInfo("G:\\u.png").Name

c# - 如何使用 EF6 获取 Controller 中任何属性的 [Display(Name ="")] 属性中的值

我正在开发MVC5应用程序。我想在我的Controller方法中为任何类的任何属性获取[Display(Name="")]属性中的值。我的模型如下:publicpartialclassABC{[Required][Display(Name="TransactionNo")]publicstringS1{get;set;}}我看过answertothisquestion,但这是一个有点冗长的过程。我正在寻找现成的和内置的东西。所以,我试过这个:MemberInfoproperty=typeof(ABC).GetProperty(s);//sisastringtypewhichhasthe