如何在不使用 msbuild 的情况下使用 Fody 来编织已编译的 dll?
How can Fody be used to weave compiled dll's without using msbuild?
我知道默认情况下 Fody 将程序集编织为 Visual Studio 中的 post 构建步骤。
但是我有一个自定义工具可以使用 csc.exe(Roslyn 编译器)直接编译项目。是否可以 运行 Fody 作为 executable/service 而不是 post-构建步骤?
像这样:fody.exe target.dll fody_settings.xml
试试这个
- 写一个exe。
- 在该 exe 中引用包含在 nuget 中的 fody dll
- 使用此 class 并传入所需的属性 https://github.com/Fody/Fody/blob/master/FodyIsolated/InnerWeaver.cs
- 您可以在此处看到此 class 的用法 https://github.com/Fody/Fody/blob/master/Fody/Processor.cs#L139 请注意,在控制台应用程序中,您可以忽略远程处理用法
免责声明:虽然这些 class 是 public,但这不被视为暴露的 API。所以在次要版本发布中,这些 classes 可能会改变。
我知道默认情况下 Fody 将程序集编织为 Visual Studio 中的 post 构建步骤。
但是我有一个自定义工具可以使用 csc.exe(Roslyn 编译器)直接编译项目。是否可以 运行 Fody 作为 executable/service 而不是 post-构建步骤?
像这样:fody.exe target.dll fody_settings.xml
试试这个
- 写一个exe。
- 在该 exe 中引用包含在 nuget 中的 fody dll
- 使用此 class 并传入所需的属性 https://github.com/Fody/Fody/blob/master/FodyIsolated/InnerWeaver.cs
- 您可以在此处看到此 class 的用法 https://github.com/Fody/Fody/blob/master/Fody/Processor.cs#L139 请注意,在控制台应用程序中,您可以忽略远程处理用法
免责声明:虽然这些 class 是 public,但这不被视为暴露的 API。所以在次要版本发布中,这些 classes 可能会改变。