草庐IT

angularjs-compile

全部标签

c# - Expression<TDelegate>.Compile 和垃圾收集

当我将表达式编译成可执行代码并获取委托(delegate)时-如果不再存在对该委托(delegate)的引用,代码是否会被垃圾收集?有这方面的文档吗?因为我在MSDN中没有找到任何有用的东西。 最佳答案 是的,代码可以被垃圾回收。当您对T的表达式调用编译时,代码将编译为DynamicMethod,并且那些有资格进行垃圾收集。确实在MSDN上没有说明,但您可以查看DLR中Expression.Compile的实现,这是.net4.0附带的内容:http://dlr.codeplex.com/SourceControl/changese

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# - 当我尝试重命名方法时,为什么 Visual Studio 告诉我有 "compiler generated references"?

我有一个名为FormattedJoin()的方法在名为ArrayUtil的实用程序类中.我尝试重命名FormattedJoin()只是Join()因为它的行为类似于.NET的string.Join()所以我认为使用相同的名称是有意义的。但是,当我尝试使用VisualStudio重命名该方法时,我收到此警告:Thismembermayhavecompilergeneratedreferenceswiththesamename.Refactoringthememberwillnotupdatethesereferences,whichmayintroducesemanticchangesa

c# - AngularJS 与 Asp.net Web API : $http post returning XMLHttpRequest cannot load: Response for preflight has invalid HTTP status code 405

当尝试使用$http将jsonPOST到Asp.netwebAPI服务器时,它返回以下错误XMLHttpRequestcannotloadhttp://localhost:62158/api/video/add.ResponseforpreflighthasinvalidHTTPstatuscode405但是从$.ajax发出相同的请求是工作文件。$HTTP代码$http.post(url,data,config).success(function(data,status,headers,config){defered.resolve(data);}).error(function(d

c# - "Edits were made which cannot be compiled"。在 vs2010 中选中零错误和启用并编辑并继续

我能够在Debug模式下编辑我的代码,但随后弹出显示错误Editsweremadewhichcannotbecompiled.Executioncannotcontinueuntilthecompileerrorsarefixed但错误列表为空,我已选中启用编辑并继续。我使用的是vs2010。清理重启也没有解决问题。 最佳答案 当您的工作区损坏时,可能会出现此问题。只需关闭VisualStudio,删除(或者最好先重命名).vs文件夹,然后再次启动VisualStudio。它甚至可以在VS2017中发生。

c# - AngularJs、WebAPI、JWT,带有(集成的)Windows 身份验证

我问了一个question之前给出的答案是正确的,但我越深入这个兔子洞,我就越意识到;我不认为我在问正确的问题。让我用最简单的术语解释一下...我有一个AngularJS单页应用程序(客户端),它指向一个asp.netwebapi(OWIN)站点(资源服务器?),以及一个单独的asp.net“授权/认证”服务器。authserver将为多个应用程序提供身份验证和授权。我需要能够在资源服务器中使用Authorize属性,以及从Angular获取token。我还需要对所有内容使用Windows身份验证(集成),没有用户名或密码。声明信息存储在数据库中,需要添加到token中。我在asp.n

c# - 接口(interface)继承多个接口(interface) : how is this handled by a C# compiler?

最近我发现C#允许Aninterfacecaninheritfromoneormorebaseinterfaces.例如,Caliburn.Micro中的IScreen在http://caliburnmicro.codeplex.com/SourceControl/latest#src/Caliburn.Micro/IScreen.cs中执行此操作namespaceCaliburn.Micro{publicinterfaceIScreen:IHaveDisplayName,IActivate,IDeactivate,IGuardClose,INotifyPropertyChangedE

c# - 如何修复 'compiler error - cannot convert from method group to System.Delegate' ?

publicMainWindow(){CommandManager.AddExecutedHandler(this,ExecuteHandler);}voidExecuteHandler(objectsender,ExecutedRoutedEventArgse){}错误1​​参数2:无法从“方法组”转换为“System.Delegate” 最佳答案 我猜有多个具有不同签名的ExecuteHandler。只需将您的处理程序转换为您想要的版本:CommandManager.AddExecuteHandler(this,(Action)

c# - 带有 Web API 2 和 AngularJS 的 MVC5.1

我正在做一个业余项目来自学AngularJS和WebAPI以及这两者如何很好地协同工作。我有很好的ASP.NETMVC知识,但我仍然无法理解AngularJS和WebAPI以及这三者如何协同工作。目前,我有一个带有以下代码的WebAPIController:publicclassPlanController:ApiController{[Route("api/thing")]publicHttpResponseMessagePost(ThingVMmodel){HttpResponseMessageresponse;if(ModelState.IsValid){using(varcon

c# - 协变/逆变 : how to make the following code compile

更新:以下代码仅在C#4.0(VisualStudio2010)中有意义看来我对协变/逆变有一些误解。谁能告诉我为什么以下代码无法编译?publicclassTestOne{publicIEnumerableMethod(IEnumerablevalues)whereTDerived:TBase{returnvalues;}}编译时:(!!!)publicinterfaceIBase{}publicinterfaceIDerived:IBase{}publicclassTestTwo{publicIEnumerableMethod(IEnumerablevalues){returnva