Configuring the Runtime Policy in Glimpse MVC4 , EF6 - glimpse

I used the runtimepolicies element in my web.Config file to configure the runtime policy.
But when run the application give a run-time exception like below.
Parser Error Message: Unrecognized element 'runtimepolicies'.
Please give me your support to configure the runtime policy in the Glimpse correctly.

The easiest way to do this, is by going to [yoursite]/glimpse.axd and use the configuration tool on the right side.
You can then check and uncheck wanted or unwanted runtime policies, tabs,... and it will show you the config changes you need to apply.
Updated answer to show correct configuration based on comment below
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
<runtimePolicies>
<ignoredTypes>
<add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"></add>
</ignoredTypes>
</runtimePolicies>
</glimpse>

Related

String was not recognized as a valid Boolean. in mvc5 show error in #using in razor

I am using mvc5 for application my local system application is working properly. but I upload publish file then server shows error show
Would be nice if anyone helps about it
Without seeing more code, it is hard to tell, but at a guess, you may want to look into your config file(s) and particularly the transformation side of this value in app settings.
<add key="ClientValidationEnabled" value="true" />
It may have an incorrect value which cannot be parsed, which is why the error is occurring down the stack after "get_clientvalidationenabled" is called.

Does dot(.) in project name cause "No owin.Enviroment" error?

After almost two hours struggling with No owin.Environment error, I am now wondering if the dot . in the project name causes the error.
My project name is XXX.Web.
In my Startup.cs, there is attribute
[assembly: OwinStartup(typeof(WVCCIS.Web.Startup))]
In the Web.Config, I added
<add key="owin:AppStartup" value="XXX.Web.Startup, XXX.Web" />
<add key="owin:AutomaticAppStartup " value="false" />
It works fine in VS2013 IIS Express, even without the appSettings keys added. But I have never figured out why it failed in the production site, hosed on an IIS7.
The error message is: No owin.Environment item was found in the context.
I found in the article login crashes - no owin.Environment
Some comment says,
I can reproduce this bug with MVC5 project by changing namespace to one which contains dots. For example WebApplication1 works, Company.ABC.WebApplication1 doesn't.
If that is the case, how can I fix it for some project name that contains a dot? How come it works when debugging in VS, but failed in the production site?
Thanks for any assistance.

Configuration exception thrown when ServiceStack RegisterLicense method is called

When invoking this method, Licensing.RegisterLicense(licenseKey);, I get a initialization exception with the following inner error:
Message=Unrecognized configuration section DbProviderFactories. (C:\Actevis\Development\Actevis.Cloud\SqlLiteTestBed\bin\Debug\SqlLiteTestBed.vshost.exe.Config line 16)
Here is the offending config section:
<DbProviderFactories>
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
I have tried adding an appsetting section to the app.config file but the same error still appears. Since the DbProviderFactories are not present in the app.config file I assume that the section is injected by ServiceStack.
I am trying to use ServiceStack.Ormlite.SQLite32. This is the nuget package that was installed. I have copied the license file a few times to make sure that there was not problem there.
Thanks
Thanks for your reply. I was able to figure out what was happening:
When installing the ServiceStack.Ormlite.Sqlite32 package, Entity framework and EntityFramework for SQLServer is also installed. There seems to be an issue when using Sqlite and EntryFramework for Sql Server together. I deleted all the entity framework related DGG's from the project and removed the sections from the app.config file. This has fixed the problem.
The issue is that you're Web.config is invalid and the error gets thrown when first trying to access the Web.config, which is what ServiceStack does when it looks for the servicestack:license app setting.
Note: the <DbProviderFactories> should be declared inside <system.data> tags:
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
</DbProviderFactories>
</system.data>
This was caused by the Web.config.transforms in the dependent System.Data.SQLite.x86 package. This could also be a bug in NuGet's web.config.transform as the rule says to add it under <system.data>...</system.data> but it's being added to the top-level creating an invalid Web.config configuration.
The entire config isn't needed for OrmLite so can be removed. I've also reached out to the SQLite maintainer to notify him about this issue so hopefully will be resolved in future issues.
Whilst I'm looking at making changes to OrmLite's Sqlite packages to embed the dlls and remove the dependency to the Sqlite packages that's causing this error.

Asp.net application error running with Sitecore 6.4.1

I have Sitecore as site root (which is running ok) and under it I need to have a bunch of asp.net applications running.
So far, created a virtual directory for the child application, turned it into an app. But as soon as I browse the child app it comes with this error message.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'Sitecore' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 3264: </providers>
Line 3265: </roleManager>
Line 3266: <profile defaultProvider="sql" enabled="true" inherits="Sitecore.Security.UserProfile, Sitecore.Kernel">
Line 3267: <providers>
Line 3268: <clear/>
It seems that the child asp.net app is inheriting Sitecore settings which are coming from Sitecore web.config.
Any ideas?
This should be possible. You'll have to author a web.config for that non-Sitecore application in virtual directory, and overwrite the sections under <system.web> and <system.webserver> which reference Sitecore classes. This includes:
httpModules / httpHandlers (for these you should "remove all" and add those of that web app)
security section (put the default ASP.NET provider classes back)
in Sitecore main web.config add the path of this web app to IgnoreUrlPrefixes setting to let Sitecore know it should not handle requests to those
It might be something else, but you should get the general idea.
This answer is similar to Yan, but is different enough for a separate answer. Hope it helps.
Go into IIS and select the Child Application. Select Modules. Remove all the Sitecore related modules that are present. Don't worry, the parent Sitecore app will still retain these modules.
When you do this, you are actually changing the child app web.config, so you will see the elements removed in the web.config file like so.
<remove name="SitecoreConfigWatcher" />
<remove name="SitecoreHttpModule" />
You also may have to clear out some other inherited settings.
<profile enabled="false"><providers><clear/></providers></profile>
<roleManager enabled="false"><providers><clear /></providers></roleManager>

Session management in Azure application

link textI developed a simple cloud application with default webrole and implemented the following steps.
1.Created new cloud service application with one default Webrole1
2. Extracted “ AspProviders.dll” and added as reference to the current Webrole1.
3. Added to new web form to the existing web role and named it as Login.aspx
4. The design page of Login.aspx is edit as below
5. Below line is added in Page Load event of Default.aspx
Response.Write("Hello, " + Server.HtmlEncode(User.Identity.Name));
6. Edited web.config with the following changes
.................
<!--Below lines are added to avoid error occured related to Insecure end points connection -->
.................
.................
................
................
.................
<sessionState mode="Custom" customProvider="TableStorageSessionStateProvider">
<providers>
<clear />
<add name="TableStorageSessionStateProvider"
type="Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider"
applicationName="SampleCloudApp"/>
</providers>
</sessionState>
<!--End-->
.................
...............``
..............
7. Executed the application in local DevFabric
But I am getting run time error like "Value Cannot be null" and the stack trace is like the following
Let me know the solution for this
Thanks.
Not sure how you pasted in the changes you made to web.config or the stack trace, but I don't see them - maybe try again.
Also have you read this post that mentions the same error?
Note also that AspProviders is just sample code - I found it took a bit of tweaking to get it to work the last time I tried to use it and I seem to remember there was a problem with the role provider. Not sure if that was fixed or if you're using the June 2010 Azure SDK (hint: you should be.)

Resources