How to use ORM Profiler....? Must be something so simple that I have missed/

Discussion of issues, suggestions and bugs of LINQ Insight, Visual Studio add-in for design-time executing LINQ statements, that simplifies debugging LINQ
EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Mon 30 Jun 2014 13:34

Hi,

I have just downloaded the trial version of LINQ Insight. I can run LINQ queries with it and get SQL no problem, via "Run LINQ Query". However I cannot find the ORM Profiling with all of the timing data etc.

How do I access the ORM Profiling feature?

The odd learning tutorial is often using for this type of thing, to get a good overview. Just some feedback.

Many thanks,

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Mon 30 Jun 2014 13:55

Hi,

I have progressed a little.

I discovered it under View/Other Windows/ LINQ Profiler. However it will not run for me.

I am guessing the way to use it is to click the start profiling button , then start one's application from within VS2013(iisexpress).

My application crashes on startup. Seems to be some clash with old style membership services.

see here:

Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Code: Select all

Exception Details: System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

Source Error:

Code: Select all

Line 93:         public CurrentUser (bool IsGuiDetailsRequired=false)
Line 94:         {
Line 95:             if (Membership.GetUser() != null)
Line 96:             {
Line 97:                 _UserId = (Guid)Membership.GetUser().ProviderUserKey;
As soon as I stop the profiler, and rerun the code, all is well.

I start the profiler then run the code.

I am using VS2012, asp.net 4.5, mvc 3, EF5, C#

Many thanks,
Ed

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Mon 30 Jun 2014 14:12

I tried to run it in release mode, got:

Code: Select all

FatalExecutionEngineError was detected
Message: The runtime has encountered a fatal error. The address of the error was at 0x73adeaa7, on thread 0x1acc. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
then when I click through, I get another error:

Code: Select all

System.ExecutionEngineException was unhandled
  HResult=-2146233082
  Message=Exception of type 'System.ExecutionEngineException' was thrown.
  InnerException: 
I then get an "Unable to connect message" and my iisexpress instance had crashed.

Thoughts?

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by MariiaI » Tue 01 Jul 2014 08:45

We couldn't reproduce these errors in our environment.
Please specify these issues in more details. For example, please specify the full stack traces of the exceptions you have mentioned in your posts and provide us with a test project, with which these issues can be reproduced.

Looking forward to your reply.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Tue 05 Aug 2014 12:01

Just tried the latest version, and the issue is still present. I believe it is to do with Membership.GetUser(). I have seen some references to 64bit systems, but this was with .NET2, and I am using .Net4.5, although I am using 64bit Win7.

In essence:

return Membership.GetUser();

is tripping up the ORM Profiler.

My exception is:

System.IO.FileLoadException was unhandled by user code
HResult=-2146233343
Message=Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
Source=System.Data
StackTrace:
at System.Data.SqlClient.SqlConnection.Open()
at System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate)
at System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation)
at System.Web.Security.SqlMembershipProvider.GetUser(String username, Boolean userIsOnline)
at System.Web.Security.Membership.GetUser(String username, Boolean userIsOnline)
at System.Web.Security.Membership.GetUser()
at Smarts.MVC3.ED.Bouncer.get_GetUser() in d:\xxxxxxx\Helpers2.cs:line 94
at SmartS.MVC3.ED.MvcApplication.Application_Error(Object sender, EventArgs e) in d:\xxxxxxx\Global.asax.cs:line 672
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.HttpApplication.RaiseOnError()
InnerException:

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Tue 05 Aug 2014 23:08

On further research, this seems to be a particular issue with profilers and using multiple app domains.... I think this is correct. Anyway here is a very comprehensive link:

http://social.msdn.microsoft.com/Forums ... om-hresult

Also I have tried adding, to the web.config :

<system.web>
<trust level="Full" originUrl="" legacyCasModel="false" />

To no avail.

So totally puzzled.

Edward

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Wed 06 Aug 2014 00:31

Hi,

Have been doing more research. Proving very difficult. Have not resolved. It would also be difficult to provide code as application is big, and confidential. However I think it may be possible for you to provide advice on how to avoid this issue, since I see it is recorded in the fixes for 3.2.529, so you must be aware of this issue.

I have only ever since this error when using LINQ Insight.

Hopefully you can provide some advice.

Edward

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Wed 06 Aug 2014 00:39

More information in case it helps:

I am using :

VS2012
ASP.NET 4.5
MVC3
EF6.1.1
SQL Server 2008 SP2
64 Bit Win7
IISExpress when running web application from VS.
Seperate Model project for Database access.
Membership in seperate SQL Server 2008 DB SP2.

Edward

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by MariiaI » Thu 07 Aug 2014 08:56

Thank you for the response and additional information. We will investigate the issue in more details. We will definitely contact you as soon as any results are available.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Mon 18 Aug 2014 12:11

Just wondering how you are getting on with this.

I decided to purchase the standard version, on the assumption that this would be fixed, as the tool looks very useful. I hope I was not too rash.

I uninstalled the trial version, and reinstalled the full standard version. However I still get the same error.

Are you working on this at present? When do you expected to have a fix?

Many thanks,

Edward

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by MariiaI » Wed 20 Aug 2014 07:04

Unfortunately, we still couldn't reproduce the issue with a similar application as you have specified.
However I think it may be possible for you to provide advice on how to avoid this issue, since I see it is recorded in the fixes for 3.2.529, so you must be aware of this issue.
This fix doesn't related to your scenario, so we couldn't determine the reason of this behavior.
We would be very much obliged to you if you provide us with a test project, with which this behaviour could be reproduced so that we are able to investigate it in more details and find the solution for you in a shortest time. It is not necessary to send us the whole project, you could exclude those parts of the project that should not affect the main scenario.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Wed 20 Aug 2014 08:11

Hi,

Thanks for this.

I will prepare a stripped down project for you to test.

Ed

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Tue 25 Nov 2014 11:26

I have just installed the latest version of LINQ Insight, and this is still an issue, sadly.

This Issue affects LINQ Profiler.

1) I start my profiler session in VS2012
2) I run my application in debug mode from within VS2012 using iisexpress.
3) My application attempts to run then crashes with the error below.

**************************************************************

Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

Source Error:


Line 93: public CurrentUser (bool IsGuiDetailsRequired=false)
Line 94: {
Line 95: if (Membership.GetUser() != null)
Line 96: {
Line 97: _UserId = (Guid)Membership.GetUser().ProviderUserKey;

***********************************************************************]

I have tried adding " <trust level="Full" originUrl="" />" to system.web in my web.config as advised my MS, but without success.

Thoughts?

Thanks,
Last edited by EdB on Tue 25 Nov 2014 11:47, edited 1 time in total.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Tue 25 Nov 2014 11:33

Just a thought. I am using 64bit Windows 7. Has LINQ Insight been compiled for work on 64bit as well as 32bit?

Thanks.

EdB
Posts: 91
Joined: Mon 15 Oct 2012 09:24

Re: How to use ORM Profiler....? Must be something so simple that I have missed/

Post by EdB » Tue 25 Nov 2014 13:06

Hi,

I have now surprisingly got this working. What I did was:

1) Change vs2012 to use devserver rather than iisexpress.
2) I use Glimpse, and as soon as I tried to used devserver I got a glimpse error message which was corrected by adding the following to the web.config.

add key="Glimpse:DisableAsyncSupport" value="true" />

I think there is still an issue. Hopefully the above will provide clues, perhaps it is around the use of iisexpress? Also I found it useful to stop the profiler, do a rebuild, then restart the profiler and then restart the debug session. It is amazing how easy it is to do a rebuild when the profiler is still going, and get weird symptoms.

Thanks.

Post Reply