I have configured 'SessionAuthenticationModule' based on the instructions from http://www.wiktorzychla.com/2014/11/forms-authentication-revisited-for-net.html. My application is in .Net 3.5 so I changed the library mappings based on "Namespace Mapping between WIF 3.5 and WIF 4.5". When I run it, it is throwing the exception shown below.
"
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.IdentityModel.Web.SessionAuthenticationModule.InitializePropertiesFromConfiguration(String serviceName) +16
Microsoft.IdentityModel.Web.SessionAuthenticationModule.InitializeModule(HttpApplication context) +124
Microsoft.IdentityModel.Web.HttpModuleBase.Init(HttpApplication context) +30
"
Major configuration settings are shown below.
<section name="Microsoft.IdentityModel" type="Microsoft.IdentityModel.Configuration.SystemIdentityModelSection, Microsoft.IdentityModel"/>
<section name="Microsoft.IdentityModel.Protocols" type="Microsoft.IdentityModel.Web.Configuration.SystemIdentityModelServicesSection, Microsoft.IdentityModel.Protocols.WSFederation"/>
</configSections>
<Microsoft.IdentityModel></Microsoft.IdentityModel>
<Microsoft.IdentityModel.Protocols>
<federationConfiguration>
<cookieHandler requireSsl="false"/>
</federationConfiguration>
</Microsoft.IdentityModel.Protocols>
Anything wrong with my configurations? Please help me.
You seem to lack the SAM in web.config.
<httpModules>
<add name="SessionAuthenticationModule"
type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
Take a look at my old tutorial that aims at .NET 3.5
http://www.wiktorzychla.com/2011/08/quest-for-customizing-adfs-sign-ing-web.html
Related
while deploying Nopcommerce on server facing this issue,
Method 'ExecuteAsync' in type 'System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy' from assembly 'EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' does not have an implementation.
>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.TypeLoadException: Method 'ExecuteAsync' in type 'System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy' from assembly 'EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' does not have an implementation.
>Source Error:
>The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
>1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%# Page Language="C#" Debug="true" %>
>or:
>2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
I get the following error when deploying my Web API Project that is targeting the .NET 4.5 Framework. I have made sure that all the referenced DLL's are in the bin folder.
Please have a look below and see the error:
Server Error in '/' Application.
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: The 'targetFramework' attribute in the element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, ''). The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework. Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework.
Source Error:
Line 22: </appSettings>
Line 23: <system.web>
Line 24: <compilation debug="true" targetFramework="4.5" />
Line 25: <httpRuntime targetFramework="4.5" />
Line 26: <authentication mode="None" />
Source File: C:\inetpub\wwwroot[website folder name]\web.config Line: 24
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
If i comment out line 24 and 25 i get a different error:
Server Error in '/' Application.
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: Could not load file or assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
Source Error:
Line 109: <add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Line 110: <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Line 111: <add assembly="*" />
Line 112: </assemblies>
Line 113: <buildProviders>
Source File: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config Line: 111
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Net.Http' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Are there two related in anyway?
How do i go about solving this problem?
Any help would be greatly appreciated.
Activate the feature WCF HTTP Activation for .NET 3.5 and 4.5 and try again:
My team tried some time ago to start using to Castle Windsor (3.2.0) for IoC goodness. Our trial runs on development boxes went peachy, but when we tried to run the code on the production server, it failed with the following exception
Application: XXXX
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
at System.Signature.GetSignature(Void*, Int32, System.RuntimeFieldHandleInternal, System.IRuntimeMethodInfo, System.RuntimeType)
at System.Reflection.RuntimeMethodInfo.get_Signature()
at System.Reflection.RuntimeMethodInfo.GetParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParameters()
at Castle.MicroKernel.ModelBuilder.Inspectors.PropertiesDependenciesModelInspector.IsValidPropertyDependency(System.Reflection.PropertyInfo)
at System.Linq.Enumerable+WhereArrayIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
at System.Linq.Enumerable.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
at Castle.MicroKernel.ModelBuilder.Inspectors.PropertiesDependenciesModelInspector.InspectProperties(Castle.Core.ComponentModel)
at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ForEach(System.Action`1<System.__Canon>)
at Castle.MicroKernel.ModelBuilder.DefaultComponentModelBuilder.BuildModel(Castle.MicroKernel.ModelBuilder.IComponentModelDescriptor[])
at Castle.MicroKernel.Registration.ComponentRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Castle.MicroKernel.Registration.IRegistration.Register(Castle.MicroKernel.IKernelInternal)
at Castle.MicroKernel.DefaultKernel.Register(Castle.MicroKernel.Registration.IRegistration[])
at Castle.Windsor.WindsorContainer.Register(Castle.MicroKernel.Registration.IRegistration[])
at Sproom.Web.Infrastructure.WindsorInstaller.Install(Castle.Windsor.IWindsorContainer, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore)
at Castle.Windsor.Installer.AssemblyInstaller.Install(Castle.Windsor.IWindsorContainer, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore)
at Castle.Windsor.Installer.CompositeInstaller.Install(Castle.Windsor.IWindsorContainer, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore)
at Castle.Windsor.WindsorContainer.Install(Castle.MicroKernel.Registration.IWindsorInstaller[], Castle.Windsor.Installer.DefaultComponentInstaller)
at Castle.Windsor.WindsorContainer.Install(Castle.MicroKernel.Registration.IWindsorInstaller[])
This was a showstopper for us and proved quite difficult to google. I recently had some time to throw at the issue, and successfully debugged it down to the fact that a component had an explicit reference/dependency (C#, not windsor) on a MVC 3 dll. The server was a newly commissioned one, and had only MVC 4 installed. All dev boxes had MVC 3 installed, making the problem only reproducible on production.
I debugged this by binary commenting out component registration code, converting mass registrations to per-component registration, and then staring at the offending component until I clicked the right place and had an epiphany.
My question is now, was there a better way that I could have debugged this? Could I have had Windsor give better information? And why was this a problem for Windsor when it was not in the normal non-Windsor case? I and the team are a bit leery of using Windsor now, given the nastyness of non-googlable errors only reproducible on production, so I hope I missed some nice ways of addressing this problem.
May be this answer help you to get better information while debugging stuff: https://stackoverflow.com/a/9539679/1158735
I have a website with .net framework 4 and telerik 2012, when i uploaded my web site on the server one of my page has this error.
The entry 'ConnectionString' has already been added.
for solving this err i use this solution:
<remove name="ConnectionString" />
and after this line ,define my connection in web config. but this err apear :
** Method not found: 'System.Web.UI.ScriptResourceDefinition System.Web.UI.ScriptResourceMapping.GetDefinition(System.String)'.
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.MissingMethodException: Method not found:
'System.Web.UI.ScriptResourceDefinition
System.Web.UI.ScriptResourceMapping.GetDefinition(System.String)'.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
**
{Note : this err just occurred on the server not in local }
and when i removed this line : <remove name="ConnectionString" /> the first err apear again : The entry 'ConnectionString' has already been added.
What can I do now?
Please check framework version on your web server, it should be 4.5. In 4.0 GetDefinition function do not have overload which accpet a string param only. Keep following entry in web.config as it has nothing to do with other error you are getting.
<remove name="ConnectionString" />
I get the following error when I tried to run a 'Published' local website.
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +54
System.Environment.ExpandEnvironmentVariables(String name) +650
cc..cctor() +88
Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927
After reading some blogs, I added the following in Web.config, but still have the same error.
<system.web>
<trust level="Full"/> ...
Is there any settings in IIS to configure the trust level? I would like to overcome the error without changing code behind files.
If you have an access to the IIS Manager (inetmgr), you can set the trust level of you application :
start > run > inetmgr
select your web site
click on ".NET Trust Levels"
select "Full Trust" in the drop down list
To change this configuration at a global level of your iis server use the following command line on the server :
appcmd set config /commit:WEBROOT /section:trust /level:Full
Here is the MSDN source for that info : http://technet.microsoft.com/en-us/library/cc753658(WS.10).aspx
If setting trust level to full does not work, you can try changing the application pool user to a user that has access to the path.