项目加载时 运行 资源生成器的 VS 2019 扩展
VS 2019 extension to run resource generator on project load
我们想从我们的存储库中排除从 RESX 文件生成的 designer.cs 文件。
为此,我们需要让 VS 运行 成为项目加载时的资源生成器(因为资源生成工具在更改 RESX 文件时仅 运行s)。
这引发了两个问题:
- 是否已经有执行此操作的扩展程序(找不到)。
- 如果没有,我可以连接到哪个 SDK class/event 以便在项目加载时 运行 资源生成器? (很高兴我将不得不遍历项目中的文件)。
Is there already an extension which does this (can't find one)
我们可以在 VS marketplace 中搜索扩展。他们中的大多数目前都是免费的。但似乎没有这样的扩展来执行您预期的行为。
If not, which SDK class/event can I hook into so I can run the
resource generator when a Project loads? (I appreciate I'm then going
to have to iterate through the files in the project).
也许您正在寻找的事件是 IvsSolutionEvents3. The IVsSolutionEvents3.OnAfterLoadProject or IVsSolutionEvents3.OnAfterOpenProject 方法可以提供帮助。
此外:有关如何检测和管理解决方案和项目加载的主题,请参阅 here。
我们想从我们的存储库中排除从 RESX 文件生成的 designer.cs 文件。
为此,我们需要让 VS 运行 成为项目加载时的资源生成器(因为资源生成工具在更改 RESX 文件时仅 运行s)。
这引发了两个问题:
- 是否已经有执行此操作的扩展程序(找不到)。
- 如果没有,我可以连接到哪个 SDK class/event 以便在项目加载时 运行 资源生成器? (很高兴我将不得不遍历项目中的文件)。
Is there already an extension which does this (can't find one)
我们可以在 VS marketplace 中搜索扩展。他们中的大多数目前都是免费的。但似乎没有这样的扩展来执行您预期的行为。
If not, which SDK class/event can I hook into so I can run the resource generator when a Project loads? (I appreciate I'm then going to have to iterate through the files in the project).
也许您正在寻找的事件是 IvsSolutionEvents3. The IVsSolutionEvents3.OnAfterLoadProject or IVsSolutionEvents3.OnAfterOpenProject 方法可以提供帮助。
此外:有关如何检测和管理解决方案和项目加载的主题,请参阅 here。