如何从F#dll重建F#程序集签名(How to reconstruct F# assembly signature from F# dll)
我想从编译的F#dll访问F#签名数据。
我知道我可以使用FSharp.Compiler.Service库从源文件中获取签名数据。 我找不到一种方法来使用该库从没有源的dll生成签名信息。
我看到两个选项,但我认为可能有一个更简单的解决方案。 我知道的两个选项是:
在Fll中嵌入F#源代码,并使用FSharp.Compiler.Service从嵌入式资源中提取信息。 然后,我可以通过名称中的对应关系来反映元数据。 除非我做错了什么,否则FSharp.Compiler.Service无法解释.fsi签名文件,因此似乎需要嵌入整个源才能使其正常工作。
从反射元数据重建F#签名。 这种方法似乎必然不足,因为某些数据无法通过反射(例如类型别名)恢复。
我的问题是:
有没有比我建议的更好的方法来访问F#签名数据并将其与反射元数据相关联?
另一种看待这个可能使其更具体的问题的方法是,“鉴于已编译的F#程序集,我如何确定可用于引用项目的所有类型别名(及其所指对象)?”
I want to access F# signature data from a compiled F# dll.
I understand that I can get the signature data from the source files using the FSharp.Compiler.Service library. I could not find a way to use that library to produce signature information from a dll without sources.
I see two options, but I think it's possible there may be a simpler solution. The two options I'm aware of are:
Embed the F# source code in the dll and use FSharp.Compiler.Service to extract information from the embedded resource. I could then make any associations to reflection metadata from correspondence in name. Unless I did something wrong, FSharp.Compiler.Service can't interpret an .fsi signature file, so it seems that the whole source would need to be embedded for this to work.
Reconstruct the F# signature from reflection metadata. This approach seems necessarily insufficient because some data is not recoverable through reflection (e.g. type aliases).
My question is:
Is there a better way to access F# signature data and associate it with reflection metadata than I have suggested?
Another way to look at this question that might make it a little more concrete is, "Given a compiled F# assembly, how can I determine all the type aliases (and referents thereof) that would be available to referencing projects?"
原文:https://stackoverflow.com/questions/35308249
最满意答案
SharePoint提供名为SharePoint Diagnostics(
diagnostics.asmx
)的Web服务,此Web服务使客户端应用程序能够将诊断报告直接提交到ULS日志,请按照从JavaScript写入SharePoint统一日志记录服务以获取更多详细信息。SharePoint JavaScript库(
init.js
)包含以下用于使用诊断Web服务的函数:function ULSOnError(msg, url, line) { return ULSSendExceptionImpl(msg, url, line, ULSOnError.caller); } function ULSSendException(ex) { var message = ex.message; if (typeof message == "undefined") message = ex.toString(); ULSSendExceptionImpl(message, location.href, 0, ULSSendException.caller); }
例
var ctx = SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getByTitle(listTitle); ctx.load(list); ctx.executeQueryAsync(function() { //... }, function(sender,args){ ULS.enable = true; //ensure ULS logging is enabled ULSOnError('An error occured while getting list' + args.get_message(), location.href, 0); });
SharePoint provides a web service named SharePoint Diagnostics (
diagnostics.asmx
), this web service enables a client application to submit diagnostic reports directly to the ULS logs, follow Writing to the SharePoint Unified Logging Service from JavaScript for a more details.SharePoint JavaScript library (
init.js
) contains the following functions that consume Diagnostics web service:function ULSOnError(msg, url, line) { return ULSSendExceptionImpl(msg, url, line, ULSOnError.caller); } function ULSSendException(ex) { var message = ex.message; if (typeof message == "undefined") message = ex.toString(); ULSSendExceptionImpl(message, location.href, 0, ULSSendException.caller); }
Example
var ctx = SP.ClientContext.get_current(); var list = ctx.get_web().get_lists().getByTitle(listTitle); ctx.load(list); ctx.executeQueryAsync(function() { //... }, function(sender,args){ ULS.enable = true; //ensure ULS logging is enabled ULSOnError('An error occured while getting list' + args.get_message(), location.href, 0); });
相关问答
更多-
SharePoint提供名为SharePoint Diagnostics( diagnostics.asmx )的Web服务,此Web服务使客户端应用程序能够将诊断报告直接提交到ULS日志,请按照从JavaScript写入SharePoint统一日志记录服务以获取更多详细信息。 SharePoint JavaScript库( init.js )包含以下用于使用诊断Web服务的函数: function ULSOnError(msg, url, line) { return ULSSendExcepti ...
-
附加新的问题(problem with appending new uls)[2022-08-17]
我想我看到了几个问题。 首先,您从li元素中获取ID: $("li").live("click", function() { auflisten($(this).attr("id")); // ID of the- }); ...将它传递给auflisten : function auflisten(start) { ...将该ID分配给ul元素: .append("
- }); ...将它传递给auflisten : function auflisten(start) { ...将该ID分配给ul元素: .append("
-
首先只匹配一个元素,尝试使用:first-child代替。 虽然这只匹配一个元素,但是:第一个孩子可以匹配多个元素:每个父级一个。 http://api.jquery.com/first-selector/ First only matches one element, try using :first-child instead. While this matches only a single element, :first-child can match more than one: One for ...
-
好吧,我很久以前使用javascript promises修复了这个问题。 当检索到1级时,我们可以调用该函数等... Ok, i fixed this a long time ago using javascript promises. When level 1 is retrieved, we can then recall the function etc...
-
Soooo,我找到了答案,从观点来看,它最终是非常愚蠢的。 Windows服务上的跟踪服务在本地服务帐户上运行。 而服务器上的用户组性能日志用户中不存在相同的帐户。 其中包含一些管理Sharepoint帐户。 所以,我更喜欢通过上面提到的一个Sharepoint帐户更改跟踪服务上的本地服务帐户,重新启动该服务,并且日志已经开始再次运行! 对于遇到相同问题的任何人,这里有帮助我的链接: 记录用户帐户 Soooo, I found the answer, it was pretty dumb finally a ...
-
是的,添加脚本编辑器Web部件并在其中添加您的代码。 我认为您甚至可以使用内容编辑器Web部件 yes, add a script editor web part and add your code in there. I think you can even use a content editor web part for this
-
您可以使用ULS Viewer: http : //ulsviewer.codeplex.com/ 或者您可以使用SPDiagnosticsService编写自己的日志记录服务 http://msdn.microsoft.com/en-us/library/gg512103.aspx 从评论中编辑: 要直接读取文件,您可以: try { // Create an instance of StreamReader to read from a file. // ...
-
你可以混合使用CSOM和JSOM。 我建议您可以使用SharePoint跨域JavaScript库(CDL)从远程托管的网页访问SharePoint数据,而无需OAuth令牌。 有关代码示例,请参阅以下链接: https : //github.com/OfficeDev/SharePoint-Add-in-JSOM-CrossDomain 我已经在CSOM OAuth身份验证Web应用程序中测试了代码,它运行正常。 You could mix CSOM and JSOM . I would suggest ...
-
li的高度受到限制,因此子菜单无法正常显示。 另外,您没有使用JQuery next语句选择任何内容。 如评论中所述,如果li需要高度,则可以用min-height代替height 。 $(document).ready(function() { $('.big').click(function() { $(this).next('ul').slideToggle(); }); }); * { margin: 0; box-sizing: border-box; } ...
-
SharePoint加载项JSOM创建列表项错误。(SharePoint Add-IN JSOM Create List Item Error. “this” is undefined)[2022-03-13]
在你的情况下似乎this是未定义的,我会避免使用this关键字替换创建列表项的函数: function addListItem(list,itemProperties,success,error) { var ctx = list.get_context(); var itemCreateInfo = new SP.ListItemCreationInformation(); var listItem = list.addItem(itemCreateInfo); f ...