草庐IT

amnesia_application

全部标签

c# - ClickOnce 应用程序错误 : Deployment and application do not have matching security zones

我在IE中使用FireFox和Chrome的ClickOnce应用程序时遇到问题,它工作正常。异常的详细信息是:PLATFORMVERSIONINFOWindows:6.1.7600.0(Win32NT)CommonLanguageRuntime:4.0.30319.239System.Deployment.dll:4.0.30319.1(RTMRel.030319-0100)clr.dll:4.0.30319.239(RTMGDR.030319-2300)dfdll.dll:4.0.30319.1(RTMRel.030319-0100)dfshim.dll:4.0.31106.0(M

c# - 设计 : How to inform controllers about data modification across application

在基于mvc的大型系统中,有负责编辑数据的View和显示该数据的View。示例:UserManagementView和UserSelectionView.每个子系统都应该知道自己是否需要更新数据,在另一个子系统对相同数据进行更改后,以便其Controller知道是否需要更新数据。我对此的想法有点像观察者模式(有点集成在c#中),所有Controller都将成为监听器,并最终会收到发生数据操纵的通知。BindingList例如提供ListChanged事件。同样,可以为每个数据结构创建一个接口(interface),并将更改通知Controller。这会增加开销(IMO),而且我发现这种

c# - 响应消息的内容类型 application/xml;charset=utf-8 与绑定(bind)的内容类型不匹配 (text/xml; charset=utf-8)

我尝试使用独立应用程序使用WCFWeb服务。我可以使用InternetExplorer查看此服务,也可以在VisualStudio服务引用中查看。这是我遇到的错误Thecontenttypetext/html;charset=UTF-8oftheresponsemessagedoesnotmatchthecontenttypeofthebinding(text/xml;charset=utf-8).如何更改它以使用正确的内容类型?这是我的配置文件这是堆栈{System.ServiceModel.ProtocolException:Thecontenttypeapplication/xm

c# - 将 VB 转换为 C# - My.Application.Info.DirectoryPath

以下VB(VB.NET、VisualBasic)语句的最佳C#(csharp)等价物是什么:My.Application.Info.DirectoryPathMy.Computer.ClipboardMy.Computer.Audio.PlaySystemSound()My.Application.Shutdown() 最佳答案 应用程序.ExecutablePath系统.Windows.Forms.剪贴板系统.媒体.*应用程序.退出 关于c#-将VB转换为C#-My.Applicati

c# - 无法处理消息,因为内容类型 'application/json; charset=utf-8' 不是预期的类型 'text/xml; charset=utf-8'

我在通过ajaxjson调用WCF服务时收到上述响应。我的调用代码是:$(document).ready(function(){$.ajax({type:"POST",contentType:"application/json;charset=utf-8",url:"http://localhost:90/WebServices/UserService.svc/Calculate",data:"{}",timeout:10000,dataType:"json",success:function(response){alert(response)},error:function(xhr,

c# - 不能包含 Microsoft.Security.Application?

我不能包含Microsoft.Security.ApplicationusingMicrosoft.Security.Application;给出这个错误:Thetypeornamespacename'Security'doesnotexistinthenamespace'Microsoft'(areyoumissinganassemblyreference?)是的,我点击了Bin->AddReference...->AntiXSSLibrary.dll并将其添加到包含AntiXSSLibrary.xml的Bin文件夹中。我重建了整个网站,但仍然一无所获。我正在使用ASP.NET3.5

c# - 全局异常过滤器或 Application_Error 都没有捕获未处理的异常

我有一个名为LogErrorAttribute的全局异常过滤器:publicclassLogErrorAttribute:IExceptionFilter{privateILogUtilslogUtils;publicvoidOnException(ExceptionContextfilterContext){if(this.logUtils==null){this.logUtils=StructureMapConfig.Container.GetInstance();}this.logUtils.LogError(HttpContext.Current.User.Identity.G

c# - SharePoint 错误 : Web application at xxxx could not be found

当我尝试执行这段代码时:SPSitesiteCollection=newSPSite(@"http://sp-devxxx:10000/");它抛出以下错误:TheWebapplicationathttp://sp-devxxx:10000couldnotbefound.VerifythatyouhavetypedtheURLcorrectly.IftheURLshouldbeservingexistingcontent,thesystemadministratormayneedtoaddanewrequestURLmappingtotheintendedapplication.我可以

c# - 将 Application Insights 与单元测试结合使用?

我有一个MVC网络应用程序,我正在使用SimpleInjectorforDI。单元测试几乎覆盖了我所有的代码。但是,现在我已经在一些Controller中添加了一些遥测调用,我在设置依赖项时遇到了问题。遥测调用用于将指标发送到MicrosoftAzure托管的ApplicationInsights服务。该应用程序不在Azure中运行,只是一个带有ISS的服务器。AI门户告诉您有关应用程序的各种信息,包括您使用遥测库发送的任何自定义事件。因此,Controller需要一个Microsoft.ApplicationInsights.TelemetryClient的实例,它没有接口(inte

c# - 如何公开 Application.Properties.Settings 并保持这种状态

我正在将我的应用程序设置集中到一个位置,我选择使用我的公共(public)库中的设置集合来完成此操作。我已将所有这些设置移动到它们自己的文件中,该文件使用配置源拉入我的app.config中:这让我可以使用VisualStudio的“添加链接”功能,在我的Web和测试应用程序中使用导入的配置文件覆盖默认库设置。现在,我希望能够从我的其他库中访问所有这些很棒的设置值,并且发现我可以通过公开生成的类来简单地做到这一点:文件:Common.Properties.SettingspublicsealedpartialclassSettings:global::System.Configurat