Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何设置全局拦截 而不是程序及拦截 #96

Open
wuzxc1230123 opened this issue Dec 30, 2024 · 4 comments
Open

如何设置全局拦截 而不是程序及拦截 #96

wuzxc1230123 opened this issue Dec 30, 2024 · 4 comments
Labels
question Further information is requested

Comments

@wuzxc1230123
Copy link

// 在程序集级别进行代理,所有标记了 ObsoleteAttribute 的方法都将应用 ObsoleteProxyMoAttribute
[assembly: MoProxy(typeof(ObsoleteAttribute), typeof(ObsoleteProxyMoAttribute))]

@inversionhourglass
Copy link
Owner

你是说整个解决方案吧,这个目前不支持,Rougamo 是项目级 AOP 组件,运行依赖项目本身的 MSBuild 任务。

不过你可以自己编写一个 SourceGenerator,为每个项目生成这样一段代码。

@inversionhourglass inversionhourglass added the question Further information is requested label Dec 30, 2024
@wuzxc1230123
Copy link
Author

wuzxc1230123 commented Dec 30, 2024 via email

@inversionhourglass
Copy link
Owner

tag文件是什么

@wuzxc1230123
Copy link
Author

targets 文件会在引用 package 的项目里尝试自动添加 attribute

https://github.com/pengweiqhca/Xunit.DependencyInjection/blob/main/src/Xunit.DependencyInjection/Xunit.DependencyInjection.csproj#L46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants