Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何创建一个动态类并将其添加到项目中(创建自)?
我可以在我的项目的构建和重建中创建类吗?我的意思是我可以在我的项目中处理构建和重建事件吗?
谢谢
您可以将静态文件添加到您的项目中,例如 dynamicclass.cs 并修改其内容Project/Properties/BuildEvents/Pre-build event command line
Project/Properties/BuildEvents/Pre-build event command line
您可以创建动态组件,然后使用反射器或平滑工具为其创建源。然后,您可以使用宏或插件将它们添加到您的项目中,或者修改 csproj 文件。