I'm trying to figure this out for a few day now, i have custom membership and role providers for my project and it works perfectly on my dev machine, but on production it throws the following error for the web.config
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Exception has been thrown by the target of an invocation.
Source Error:
Line 24: <providers>
Line 25: <clear />
Line 26: <add name="FeelSafeRoleProvider" type="FeelSafe.Helpers.FeelSafeRoleProvider, FeelSafe" connectionStringName="FeelSafeEntities" />
Line 27: </providers>
Line 28: </roleManager>
Source File: (...)\web.config Line: 26
I've read about people having simmilar issues because they hadn't named their connectionstrings but my connectionstring is defined as follows
<connectionStrings>
<add name="FeelSafeEntities" connectionString="metadata=res://*/Models.FeelSafe.csdl|res://*/Models.FeelSafe.ssdl|res://*/Models.FeelSafe.msl;provider=System.Data.SqlClient;provider connection string="Data Source=PLESK-23\SQLEXPRESS;Initial Catalog=FeelSafe;Persist Security Info=True;User ID={user};Password={password};MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
any toughts on what's going on here?
if you need any more info just ask and i'll provide.
thanks for any help
OK, found out that the problem wasn't directly with the role provider classes nor the connectionstring, the version of the MySQL connector was old, updating it solved this error.
Related
My application is in Asp.Net MVC3, my application was running perfectly but all of a sudden i'm getting an error in my Web.Config in my role manager tag.
Below is my RoleManager tag of web.config
<roleManager defaultProvider="MASSIARoleProvider" enabled="true" cacheRolesInCookie="true">
<providers>
<clear />
<add name="MASSIARoleProvider" type="MASSIA.Helpers.MASSIARoleProvider, MASSIA" connectionStringName="MASSIAEntities" />
</providers>
</roleManager>
Below is the error i'm getting directly when i run my application:
[updated Error Image]
I have a file MASSIARoleProvider.cs in my solution in the directory Helper.
Below is Heirarchy of my RoleProvider file.
--> Massia --> Helpers --> MASSIARoleProvider.cs
My solution was executing perfectly but i'm getting this error all of a sudden.
<roleManager defaultProvider="MASSIARoleProvider" enabled="true" cacheRolesInCookie="true">
<providers>
<clear />
<add name="MASSIARoleProvider" type="MASSIA.Helpers.MASSIARoleProvider" connectionStringName="MASSIAEntities" />
</providers>
</roleManager>
Attemp 2:
Check for your MASSIARoleProvider file and see whether the Solution name and references used are perfectly correct.
Attempt 3:
The last and least recommended.
Create a new solution, if and only if your solution is in the beginning stage and try to reconfigure the RoleProvider. Once it solved the issue for me, I made a new solution, added the existing files to the news solution and executed the new solution and it executed perfectly. I did not made any change to the code, i just included the existing files from the old solution to the new one.
I have an MVC 3 application that uses a Custom Role provider.
public class MyRoleProvider : System.Web.Security.RoleProvider
I have this setup in the web.config as follows
<roleManager defaultProvider="MyRoleProvider" enabled="true" cacheRolesInCookie="true">
<providers>
<clear />
<add name="MyRoleProvider" type="Namespace.MyRoleProvider, NameSpace" connectionStringName="MembershipDBConnStrName" />
</providers>
</roleManager>
This was all working fine until, well I decided to install MVC 4 to playaround with it.
Now my mvc 3 app is not loading with a configuration error that points to my custom role provider
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Exception has been thrown by the target of an invocation.
Line 81: <providers>
Line 82: <clear />
Line 83: **<add name="MyRoleProvider" type="Namespace.MyRoleProvider, Namespace" connectionStringName="MembershipDBConnStrName" />**
Line 84: </providers>
Line 85: </roleManager>
Doing some reading I see some huge changes around membership (namely the simplemembership provider) but I am hoping there is a quick fix for my stuff to continue to work.
Try delete all constructors from "MyRoleProvider" class.
I am trying to set up Combres on an Asp.Net MVC 3 site following this tutorial from their documentation.
I followed all of the steps, but when I run I get the following error:
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: CS1061: 'System.Web.Mvc.UrlHelper' does not contain a definition for 'CombresLink' and no extension method 'CombresLink' accepting a first argument of type 'System.Web.Mvc.UrlHelper' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 5:
Line 6: #Sprite.ImportStylesheet("~/App_Sprites/")
---> Line 7: #Url.CombresLink("siteJs")
Line 8: <script src="#Url.Content("~/Scripts/excanvas.js")" type="text/javascript"></script>
Line 9: #RenderSection("HeadScripts", required: false)
siteJs is my javascript resourceSet reference in the conbres.xml file.
In my web config I have:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add type="Microsoft.Web.Samples.ImageOptimizationModule" name="Microsoft.Web.Samples.ImageOptimizationModule" />
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</modules>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
(This is using a different version of System.Web.Routing.UrlRoutingModule than the one referred to in the tutorial. If I try to reference the version from the tutorial I cannot because I don't have the older DLL.)
How do I set this up properly?
in the View have you included
#using Combres.Mvc
In my web.config file I have:
<siteMap defaultProvider="MvcSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="MvcSiteMapProvider"
type="MvcSiteMapProvider.DefaultSiteMapProvider, MvcSiteMapProvider"
siteMapFile="~/Mvc.Sitemap"
securityTrimmingEnabled="true"
cacheDuration="5"
enableLocalization="false"
scanAssembliesForSiteMapNodes="true"
excludeAssembliesForScan=""
includeAssembliesForScan=""
attributesToIgnore=""
nodeKeyGenerator="MvcSiteMapProvider.DefaultNodeKeyGenerator, MvcSiteMapProvider"
controllerTypeResolver="MvcSiteMapProvider.DefaultControllerTypeResolver, MvcSiteMapProvider"
actionMethodParameterResolver="MvcSiteMapProvider.DefaultActionMethodParameterResolver, MvcSiteMapProvider"
aclModule="MvcSiteMapProvider.DefaultAclModule, MvcSiteMapProvider"
siteMapNodeUrlResolver="MvcSiteMapProvider.DefaultSiteMapNodeUrlResolver, MvcSiteMapProvider"
siteMapNodeVisibilityProvider="ekmProspector.web.SiteMapProviders.AuthenticatedVisibilityProvider, ekmProspector"
siteMapProviderEventHandler="MvcSiteMapProvider.DefaultSiteMapProviderEventHandler, MvcSiteMapProvider"
/>
</providers>
</siteMap>
I also have project reference to the MvcSiteMap library dll, a sitemap named mvc.sitemap.
The pages namespaces also look like:
<pages>
<namespaces>
...
<add namespace="MvcSiteMapProvider.Web.Html"/>
<add namespace="MvcSiteMapProvider.Web.Html.Models"/>
</namespaces>
</pages>
However, whenever I browse to any page in my MVC3 project I get the following error:
Configuration Error Description: An
error occurred during the processing
of a configuration file required to
service this request. Please review
the specific error details below and
modify your configuration file
appropriately.
Parser Error Message: Value cannot be
null. Parameter name: type
And the source error is pointing to this line:
Line 91: <clear />
Line 92: <add name="MvcSiteMapProvider"
Line 93: type="MvcSiteMapProvider.DefaultSiteMapProvider, MvcSiteMapProvider"
Why am I getting this error?
I eventually found out myself what the problem was. The MvcSiteMap provider library uses the reflection Activator.Createinstance() method to call into the provider you set-up in the sitemap file. If the format of the provider is incorrect, Activator fails with the above message.
For example, the value in the sitemap for a visibilityprovider should be "fullqualifiednamespace.ProviderClass, AssemblyName".
e.g. "MyApplicationNamespace.AuthenticationVisibilityProvider, MyApplication"
I have a problem in setting the chartHttpHandler in web.config for windows azure
Initially I added a chartHttpHandler on my web.config file
<remove name="ChartImageHandler"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
under system.webServer section
Then I got an error stating
Invalid temp directory in chart handler configuration [c:\TempImageFiles\].
Then I found that I should change in
From
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
To
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
I am not able to find this section in my web.config file. So I tried to add it under section but it gave me error that it is an invalid child
Likewise, I tried adding it under section, it too gave the same error...
So, I added sepeartely, Then I am not able to see anything.. The webpage is just blank...
What should I have to do.. Can anyone tell me "how to solve it"
Looks like you need to add it in appSettings... http://blogs.msdn.com/deliant/archive/2008/12/02/managing-chart-generated-images-with-chart-image-handler.aspx
(No personal knowledge about this, but that's the first link I found via Bing.)