-
Notifications
You must be signed in to change notification settings - Fork 607
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
The types registered for MvcOptions and MvcViewOptions conflicts with other libraries. #162
Comments
@DamianEdwards Do you have any input here? This seems like it'd be a conflict with every library doing it...what's the best way to share and play nice? |
I'll try switching Mvc to DiagnosticListener, totally avoiding the issue here. Leaving this as a place to track. Will tackle it as soon as time allows., but definitely before we get to beta, etc. |
@NickCraver Since those classes are now internal, is there a alternative workaround beside copying the classes to my project? |
So unfortunately I ran into aspnet/Mvc#6222 which is a pretty hard blocker on moving strictly to DiagnosticSource. Hopefully the MVC team can provide some insight soon here. |
I talked with the Diagnostic guys at Microsoft and hopefully we'll see some improvement here (concrete types in ASP.NET diagnostic events, since they removed the adapter from 2.x as well). If that happens, it should remove the blocker from using those events and removing the wrapping. |
I checked again today, unfortunately this still hasn't happened. You can see the anonymous types here: https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Internal/MvcViewFeaturesDiagnosticSourceExtensions.cs#L88-L99 and note that DiagnosticAdapter is still only I'll tale a peek at forking this behavior for |
This adds timings based on the DiagnosticListener bits overhauled in dotnet/aspnetcore#11730 with some further cleanup in dotnet/aspnetcore@b23ea5b This would also resolve #162 and #322.
Since concrete types are now in - this is unblocked! I'm working on it over in #475. |
This adds timings based on the `DiagnosticListener` bits overhauled in dotnet/aspnetcore#11730 with some further cleanup in dotnet/aspnetcore@b23ea5b This would also resolve #162 and #322. Entirely possible there are more efficient ways to do the correlation tracking (I hope!) - putting this up for more eyes. Example profiling: ![image](https://user-images.githubusercontent.com/454813/79678735-784f5d00-81cc-11ea-93fc-11516b77ea59.png)
AddMiniProfiler registers a type for MvcOptions and MvcViewOptions that can override or be overidden by another library.
Depending on what library is called first, the last registered type is used by MVC.
For example, FluentValidation does the same and conflicts with MiniProfiler, preventing ProfilingViewEngine from being used.
https://github.com/JeremySkinner/FluentValidation/blob/237ccfd581dcecf72209acdaabd4c41122fad98d/src/FluentValidation.AspNetCore/FluentValidationMvcExtensions.cs#L63
A workaround could be to register the ViewEngine using IServiceCollection.Configure()
The same thing applies to MvcOptions which adds ProfilerActionFilter to the Filters collection. Here is my current workaround.
The text was updated successfully, but these errors were encountered: