Generated project view.dll)我尝试了几个产品——dotPeek、JustDecompile 和 .Net Reflector,它们都擅长从 dll 中反编译 cs 文件。但是,我正在寻找可以从 dll 中提取 View (cshtml 文件)的工具。
有什么办法,我可以取回 View ,我得到的只是 (view)dll。
谢谢
最佳答案
昨天发生在我身上,这是我所做的:
使用 ILSpy 反编译我的 .Views.dll
- 在 Views_Home_index 上使用“保存代码...”并获得 AspNetCore.Views_Home_Index.cs
文件。
在文本编辑器中打开文件并从公共(public)override async Task ExecuteAsync()
方法开始 - 有一堆WriteLiteral()
和__tagHelperExecutionContext.AddHtmlAttribute()
基于您的 .cshtml 文件制作的方法,它看起来很糟糕,但最终很容易“反编译”。主要是您只需复制 WriteLiteral()
中的所有内容,并将 .AddHtmlAttribute()
替换为文件顶部定义的属性。
我的 View 很小,里面主要有 html/js,所以没花很长时间。
关于c# - 如何从 dll 中反编译/提取 (cshtml--(razor view)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59558011/