How can I view a profiling session saved to the database using SqlServerStorage? - mvc-mini-profiler

I've configured MiniProfiler to use the SqlServerStorage. Does MiniProfiler have a built in way to view these saved profiling sessions in a similar way that you would view them at the time they were generated?

No, there is not built in way at the moment to browse the list of old profiling sessions.
However, we plan to build a sampling profiler at some point in the future and this would be included in the work.

Related

Configure datasource type at runtime

I have an application that uses a relational database and the database type is selected when the application is installed (between mysql, mariadb, mssql and oracle). The property quarkus.datasource.db-kind can only be defined at compile-time, so I don't really know how to get there without having to compile four copies of the same application. Any suggestion?
I understand why this should not be possible for a native image, but why is not possible even for a JIT artifact?
Marco.
As you have guessed correctly, this has been done to fully optimize the native executable case but it also allows for some optimizations in the JVM case.
For now, that's not something we are willing to change but you could open an enhancement request on our GitHub and see how many votes this gets.

Telerik Data Access generate classes automatically

Until the recent release I was happily using Telerik Data Access in a database first way:
Created the database schema in external DB designer
Generated a fluent model in Visual Studio
Whenever I did a database change I either re-ran the generation or updated models via visual designer depending on the magnitude of the change
After the last release the templates I used for the generation are gone (as is the visual designer) and any attempt at Googling the solution takes me to a Telerik documentation page saying the info is deprecated.
I'm working with large existing databases (100+ tables) and there's no way I'm coding the models by hand.
What are the current options for auto generating the models?
I got a reply on Telerik forums. Simply said there's nothing I can do now and have to wait til/if they develop a solution. For all that are interested, please vote on the feature request.
Here's the reply:
Thank you for your feedback.
We have already created a new feature request (http://feedback.telerik.com/Project/114/Feedback/Details/163155-generation-of-fluent-models-with-data-access-q2-2015-and-higher) to create a code generating tool to create your fluent models based on your database schema. You are welcome to cast your support vote for the item.
I cannot give you any time frame when we will be able to ship such tool, but I will make sure to notify you as soon as we have a public release.
Regards,
Viktor Zhivkov
Telerik
The feature is still not available. But maybe this is an alternative to being stuck with VisualStudio 2013.
Owners of VisualStudio Enterprise have another option. They can modify the code generation templates and generate the fluent metadata and context code from an UML class diagram.
I invested in checking the MSDN documentation and created a VS extension which I open-sourced.
Please check https://github.com/bdongus/UMLExtensions for details. Feel free contribute.

Logic tests for OS X using Xcode 6

I want to implement unit testing in my Xcode project, and would like to run tests without requiring the application to be started.
Reasons for this are, I have a core data based document app, that also uses a cvdisplay link to control continuous rendering in a background thread.
It strikes me that I do not need a running application to test core data datamodel functionality, this should be distinct from view stuff anyway. Also I would like to isolate and performance test my background rendering processes, something that seems very difficult with the app running, but could easily do without the application running, just getting the right classes and feed it the correct data.
I've seen other questions that have answers for Xcode versions before six, but the answers don't seem to work for the current version.
The docs now make a distinction between application and library tests. Library tests are run against library targets.
I'm not sure i want to reorganise my code into distinct libraries at the moment, and would prefer to avoid it or fake it somehow.
I saw somewhere an openradar relating to this in ios, but I'm interested in osx.
Has anyone any insight into this?
EDIT : Learning to cope with the existing setup for now, testing with full app running, I can run some checks on that, then I close all documents and shut down the display link.
I can then run tests creating my own persistent store coordinator, in memory datastore and context, as well as testing my rendering classes without fear of conflict with the other display thread.
I'm now running into troubles with linking sources, I just can't seem to get it right, I fiddle with settings, it seems to work for a bit, then suddenly stops building again with Undefined symbols for architecture x86_64: errors, either that or problems linking with 3rd party private frameworks. I look through the web, change a few things, it starts working again. Then I add some tests, importing more of my classes, things stop working again.,.. Infuriating
EDIT 2: Pretty much all sorted now, but maybe not terribly efficient. For each test case class, I either open or close documents and start or stop the display link in the +(void)setup method. I don't do anything in the +(void)tearDown, and let the setup decide how to proceed based on the current state.
Although this means it's possible to flow from one test class to another minimizing document opens and closes, there doesn't seem to be a way to order the tests so that I could group them together.
BTW, I also solved my mentioned linking troubles (XCode 6 Testing Target Troubles), not really relevant to this question though.
It sounds like you landed on the standard solution: Give your app a way to tell when it's being stood up for testing rather than use, and then have applicationDidFinishLaunching: not do any of your usual launch-time behaviors, but leave it to specific tests to provide any setup they need.
You might benefit from creating multiple test suites to deal with different expected conditions, like all the tests that work around a specific document being open.

How to tell what is trying to load a specific assembly?

I have an MVC project that is failing once I deploy to Azure because it's trying to load an MVC4 assembly. I have upgraded the project to MVC5.
I am trying to find what has a dependency on the MVC4 dll.
How would I go about finding what is causing it to try and load the MVC4 dll?
Fusion logs are the way to go for something like this. Here's a handy little blog that sums up the registry changes you need to add to capture the log on your instance. Add this as part of a startup task. In this post he also gives the location to the log viewer (on your local dev machine) that you can use to view the log.
Is this the same issue that you asked a week ago and received an answer for? https://stackoverflow.com/questions/19716911/web-role-fails-on-azure-after-upgrading-from-mvc4-to-mvc5/19733292#19733292
Rick's Fusion Logs option is also a great way to determine this.

How to use a different data model with EF

I am not even sure how to ask this question. I am absolutely willing to research this myself, but I don't even know what exactly my options are.
I'm fairly new to programming in general, and I'm the sole developer on an ASP.NET MVC3 web application. We're about to upgrade to a new version which has a lot of addition to the data model. There are a couple new entities and some of the old entities have new properties/columns.
We've finished beta testing and now we're going to try to get everyone moved over to the new version running parallel to the current version, that way if there are show-stopping problems, users can easily switch back to the old version. The problem is that we can't hook both up to the same db because of the data model differences.
Can I make the old version use the new version's schema or something? I'm not really sure what my options are. I'm not asking you to write this for me; I'm just looking for some direction. Thanks!
You should be able to disable the metadata checks and then use two versions against the DB assuming the models use a schema that is compatible between both.
http://revweblog.wordpress.com/2011/05/16/ef-4-1-code-first-disable-checking-for-edmmetadata-table/
Another option is to use entity framework 4.3 code first migrations and actually use an upgrade script that it will generate for you. If it fails you can roll back the script to a prior version and use your prior code base. This would imply you upgrade to 4.3 first before doing anything else though although you could still disable metadata checks.

Resources