首页 \ 问答 \ 如何从F#dll重建F#程序集签名(How to reconstruct F# assembly signature from F# dll)

如何从F#dll重建F#程序集签名(How to reconstruct F# assembly signature from F# dll)

我想从编译的F#dll访问F#签名数据。

我知道我可以使用FSharp.Compiler.Service库从源文件中获取签名数据。 我找不到一种方法来使用该库从没有源的dll生成签名信息。

我看到两个选项,但我认为可能有一个更简单的解决方案。 我知道的两个选项是:

  1. 在Fll中嵌入F#源代码,并使用FSharp.Compiler.Service从嵌入式资源中提取信息。 然后,我可以通过名称中的对应关系来反映元数据。 除非我做错了什么,否则FSharp.Compiler.Service无法解释.fsi签名文件,因此似乎需要嵌入整个源才能使其正常工作。

  2. 从反射元数据重建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:

  1. 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.

  2. 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
更新时间:2023-05-25 06:05

最满意答案

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 ...
  • 我想我看到了几个问题。 首先,您从li元素中获取ID: $("li").live("click", function() { auflisten($(this).attr("id")); // ID of the
  • }); ...将它传递给auflisten : function auflisten(start) { ...将该ID分配给ul元素: .append("
      ") 所以现在看来你有2 ...
  • 首先只匹配一个元素,尝试使用: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; } ...
  • 在你的情况下似乎this是未定义的,我会避免使用this关键字替换创建列表项的函数: function addListItem(list,itemProperties,success,error) { var ctx = list.get_context(); var itemCreateInfo = new SP.ListItemCreationInformation(); var listItem = list.addItem(itemCreateInfo); f ...
  • 相关文章

    更多
  • 单词f
  • “应用程序或DLL C:\WINDOWS\system32\PNCRT.dll为无效的windows映像”的解决方法
  • Python内建函数(F)
  • 如何卸载assembly?或者class
  • windows下最好的豆瓣fm软件——K.F.storm豆瓣电台,没有之一
  • INSERT INTO blog_appitem (user_id,appid,app_secret,is_valid) VALUES (1, 'wxf415741de036114c','48e1e345fd5f11c93af18ff1714c7f78',1)
  • 用java把“真”这个字符转换为十六进制为“771f”,这是ascii还是unicode
  • 问下 myeclipse中快捷键 Shift+Alt+J 和 Ctrl+F11 有什么区别 谢~
  • solr 自定义 dismax查询方式
  • 分享之测试WebService小工具 STORM
  • 最新问答

    更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)