草庐IT

global-required

全部标签

c# - Global.asax 中 FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters) 的目的是什么

关闭。这个问题需要更多focused.它目前不接受答案。想改进这个问题吗?更新问题,使其只关注一个问题editingthispost.关闭8年前。Improvethisquestion我读过类似的问题WhatisthepurposeofRegisterGlobalFilter但无法得到答案,这个问题在某种程度上也围绕着一些其他的东西,而答案对我来说似乎并不完整。我的问题是:-MVC5FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);中global.asax中这一行的目的是什么为什么需要它?添加/注册的目的是什么过滤器?过

C# 错误 : "An object reference is required for the non-static field, method, or property"

我有两个类,一个用于定义算法参数,另一个用于实现算法:1类(算法参数):usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceVM_Placement{publicstaticclassAlgorithmParameters{publicstaticintpop_size=100;publicstaticdoublecrossover_rate=0.7;publicstaticdoublemutation_rate=0.001;publicstaticintchrom

c# - Global.asax.cs 文件在哪里?

我正在使用VS2008。我从文件->新建->网站->Asp.net网站创建了一个新的Asp.net网站项目。现在我想将Global.asax和.cs文件添加到项目中。所以我右键单击项目->添加新项->全局应用程序类。然后我点击了添加按钮。添加了如下内容的Global.asax文件voidApplication_Start(objectsender,EventArgse){//Codethatrunsonapplicationstartup}voidApplication_End(objectsender,EventArgse){//Codethatrunsonapplicationsh

c# - 为什么我会收到 411 Length required 错误?

这就是我使用.NET调用服务的方式:varrequestedURL="https://accounts.google.com/o/oauth2/token?code="+code+"&client_id="+client_id+"&client_secret="+client_secret+"&redirect_uri="+redirect_uri+"&grant_type=authorization_code";HttpWebRequestauthRequest=(HttpWebRequest)WebRequest.Create(requestedURL);authRequest.C

c# - "ASP.global_asax does not exist in the namespace ASP"

我在App_Code上创建了一个RazorFunctions.cshtml文件@functions{publicstaticstringGetActiveClassIf(stringcontrollerName,stringactionName=null){varrouteData=@HttpContext.Current.Request.RequestContext.RouteData;stringcurrentController=routeData.Values["controller"].ToString();stringcurrentAction=routeData.Valu

c# - 为什么我得到 'One or more types required to compile a dynamic expression cannot be found.' ?

我有一个我从中更新的项目.NET3.5MVCv2到.NET4.0MVCv3编译当我尝试使用或设置@ViewBag.Title属性时出现错误。Oneormoretypesrequiredtocompileadynamicexpressioncannotbefound.AreyoumissingreferencestoMicrosoft.CSharp.dllandSystem.Core.dll?我做了以下事情已关注upgradesteps在Project/Properties/Application选项卡中将目标框架设置为.NETFramwework4添加了System.Core框架man

c# - 编译错误 : The type 'ASP.global_asax' exists in both DLLs

我刚刚将另一个项目页面及其dll集成到我现有项目的Bin/文件夹中。我的项目框架是3.5。当我尝试构建项目或解决方案时,它抛出以下错误:"Thetype'ASP.global_asax'existsinboth'c:\Windows\Microsoft.NET\Framework\v2.0.50727\TemporaryASP.NETFiles\timesheet\15a75c54\898b48b9\assembly\dl3\58b062b2\00ceda54_c98cc801\App_global.asax.DLL'and'c:\Windows\Microsoft.NET\Frame

c# - 修复 : The Global element 'configuration' has already been declared

我使用了第二种解决方案Howtoresolve"Couldnotfindschemainformationfortheelement/attribute"?即使用按钮创建了一个XSD来创建一个方案。我将app.config中的样式表更改为app.xsd但现在我收到警告:全局元素'configuration'已经在app.xsd中声明即使更改名称也会显示警告。有人对此有解决方案吗? 最佳答案 重新启动对我不起作用,所以我想分享有效的方法。首先,我刚升级到Windows8。之前没有出现过这个问题。而且这个问题只发生在我的一个app.co

c# - 多次抛出 "Missing compiler required member"错误,几乎没有更改代码

今天,在对我运行的C#MVC站点进行一些更改后,我返回进行更多修改并遇到此错误:MissingcompilerrequiredmemberSystem.Runtime.CompilerServices.ExtensionAttribute..ctor错误有点含糊(显然除了它的描述)因为它没有给我一个文件、行或列来引用,只有项目。此外,它总共抛出20次错误。从部署(当时它完全可用)到现在,我只对代码进行了三处更改。我恢复了我的更改,它仍然抛出同样的错误,这对我来说毫无意义。除了thisguys之外,我在SO或Google上没有找到很多关于此错误的信息解决方案和一些对一些Mono项目错误的

c# - asp.net中global.asax的作用是什么

我们如何在asp.net中使用global.asax?那是什么? 最佳答案 MSDNhasanoutlineglobal.asax文件的用途。实际上,global.asax允许您编写响应“系统级”事件(例如应用程序启动、session结束、应用程序错误发生)而运行的代码,而无需尝试将代码塞进您网站的每一页。您可以通过在VisualStudio中选择“添加”>“新项”>“全局应用程序类”来使用它。添加文件后,您可以在列出的任何事件下添加代码(默认情况下创建,至少在VisualStudio2008中是这样):应用程序_开始申请_结束Se