Domanda

I get exceptions during debug when using Glimpse:

The SELECT permission was denied on the object 'XXX', database 'YYY', schema 'dbo'.

Background:

  • We have an MVC3 web application using Linq2Sql to access the database (the connection string is not in web.config but set programmatically)
  • The metadata tab is not filled properly in the Glimpse panel
  • The sql tab is filled properly in the Glimpse panel, both using Glimpse.ADO and FlexLabs.Glimpse.Linq2Sql
  • Dbo does not (and should not) have access to specified object and database. For database access we set a connection string programmatically that specifies the user

So the problem seems to be that Glimpse is trying to fill the metadata tab in the Glimpse panel by using dbo to access the database - that will not work in our case.

Is there any way to programmatically specify a connection string that Glimpse should use, or can we turn of the metadata tab to avoid this problem. A setting would in our case not be useful as we cannot have the connection string in web.config.

È stato utile?

Soluzione

You can disable the metadata tab by adding the following ignore rule to the Glimpse configuration

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <tabs>
        <ignoredTypes>
            <add type="Glimpse.Mvc.Tab.Metadata, Glimpse.Mvc3" /><!-- or Glimpse.Mvc4 -->
        </ignoredTypes>
    </tabs>
    ...
</glimpse>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top