-
Notifications
You must be signed in to change notification settings - Fork 220
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
.NET 3.5 support #94
base: master
Are you sure you want to change the base?
.NET 3.5 support #94
Conversation
FYI, I took a fresh copy of the trunk last Friday (Sept 6 2013) and created a .NET 3.5 fork. I’ve been testing it out with a 3.5 Webforms project I’m supporting, and it seems to work well. https://github.com/mmooney/miniprofiler/tree/DotNet35 I skipped most of the MVC stuff, because that is not 3.5-friendly. Sure, I could have tried to port that to and older MVC, but that would be a much larger undertaking I really needed it for Webforms (I can’t test it in a real app that I’m supporting, I don’t want to claim to have done it :)) Anyhow, I’m not going to submit it back as a pull request, but it would really just make the trunk ugly, and this is just a hack until all of the 3.5 stuff finally dies. Sure that will be years, but I wouldn’t want to clutter up the trunk with all of those legacy compiler switches and custom implementations of Guid.TryParse etc. I tried to minimize the changes to the structure of the code, and wrap everything in compiler switches, so hopefully it will be easy to pull the latest trunk changes moving forward. I also put a copy of the latest build out on NuGet, and I’ve been using that NuGet version in my testing. https://www.nuget.org/packages/MiniProfilerDotNet35/ If you see any issues, let me know at @MooneyDev. Cheers, Mike Mooney |
@mmooney : I tried adding this to a .net 3.5 Web Forms project, and got the following error when running Inner Exception: Could not load file or assembly 'System.Threading, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Stack Trace:
Any idea why this would be happening, or if there are any special config settings that need to be done in order to get this working on a .net 3.5 web forms project? |
Ah, sorry about that, I was missing the NuGet dependency for the Task Parallel Library (which is needed to get a 3.5 implementation of ConcurrentDictionary). I just pushed a fix and published an update to NuGet (0.35.2). Updating to the latest NuGet package should pull in Task Parallel Library and fix your issue. |
@mmooney That fixed the problem with
When I try to retrieve data from the DataContext, or Insert, I get an exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. StackTrace:
Any insights into why this wouldn't work with the 3.5 framework project? |
Something else not working (turned off db profiling for the time being). Added System.Web.Routing to the project, and then added the MiniProfiler handler to web.config, per instructions on miniprofiler.com. However, the mini profile script that loads up points at a location like this: |
Hi @yellis, can you check if you have this in your web.config? You may need to enable the routing handler/modules, especially if it's web forms (yes I need to write up a blog post on this :) ). I'll have to setup a test case to recreate the Linq to SQL issue. Of course, if you want to take a crack at it, the branch is here: https://github.com/mmooney/MiniProfiler/tree/DotNet35 |
@mmooney Adding the module/handler settings per the msdn article fixed the routing. Thanks. I have tried to use the code in your branch to test out the L2S issue, but am unable to do so. When I try to run Sample.Webforms in the solution, I get an error message:
I have tried forcing it to use the 2.0 runtime (setting it up as a site in IIS and running it off of a 2.0 app pool) but that didn't help. I am not sure why it is trying to use EntityFramework, as that is only present in the StackExchange.Profiling.EntityFramework project, which is not reference din StackExchange.Profiling or Sample.Webforms. But it still looks like the sample project is trying to reference it, leading to this error. The error itself is interesting. It is happening on this line:
In the |
Hi @yellis, I just pushed a fix for the _inProgress[id] issue. The problem was that the index of that dictionary is a Tuple<T1,T2>, which is one of the classes I had to recreate in 3.5, and I hadn't overridden the Equals and GetHashCode methods so it was not comparing the objects by value. Anyhow, I implemented those methods and added a LinqToSqlTest.aspx page in the Sample.WebForms project. Here's the fix: Thanks for your help on debugging this, and for the PR this morning. Not sure if @SamSaffron is going to get annoyed that we're cluttering up this thread, so if you run into any other issues, you want to log them over on the branch repo? I just enabled the issue list over there: https://github.com/mmooney/MiniProfiler/issues Thanks again |
@mmooney That fixed it. Thanks. I'll post all subsequent issues to your branch. |
@SamSaffron could you please close this PR? |
MiniProfiler classes are moved to a new .NET 3.5 class library project. .NET4.0 Profiler references this .NET 3.5 project.
ADO.NET profiling objects moved to a new project.
.NET3.5 can run profiled ADO.NET commands and use MiniProfiler.