System.Security.Cryptography.CryptographicException" occurred in w3wp.exe - c#

Any help for how to get out of this error?
An unhandled exception "System.Security.Cryptography.CryptographicException" occurred in w3wp.exe
I'm getting this error whenever I browse for the site I have setup in IIS
(version 7.5.7600.16385)
Other info:
.Net framework: 2.0
PipeLine mode: integrated
AppPool ID: NetworkService
Load User Profile : true
Any help/suggestions appreciated.
Thanks
UPDATE:
I'm just trying to load default page.
System.Security.Cryptography.CryptographicException was unhandled
Message=The system cannot find the path specified.
Source=mscorlib
StackTrace:
at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
at System.Security.Cryptography.SafeKeyHandle._FreeHKey(IntPtr pKeyCtx)
at System.Security.Cryptography.SafeKeyHandle.ReleaseHandle()
at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
at System.Runtime.InteropServices.SafeHandle.Finalize()
InnerException: null

Try this:
Sitecore - System.Security.Cryptography.CryptographicException
Not sure what the problem is - but it sounds similar

Related

copilot error : [Error] An error occurred for 'ReturnKeyCommandArgs'?

When I want to use comments an error is displayed :
[Error] An error occurred for 'ReturnKeyCommandArgs': StreamJsonRpc.RemoteInvocationException: Request getCompletions failed with message: The operation was aborted. à StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__143`1.MoveNext()
I have already reinstalled vs 2022 and copilot.
Thanks in advance
I was having the same issue. Updating VS fixed it (in my specific case, to 17.2.5).

why asp.net website dont work after publishing?

I made asp.net website, that work well on local (run debug in VS). But after I succesfully publish it (using VS) to a webhosting, the website does not work.
Problems started after I added references to some 3rd party DLLs and using them.
Did I miss something when referencing these DLLs?
Thank you for your time!
Error message is:
Server Error in '/' Application.
Request timed out.
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.Web.HttpException: Request timed out.
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:
[HttpException (0x80004005): Request timed out.]
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4075.0

Method not found: 'Void System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)'

I'm migrating a site from one web server running IIS 7.5 on Windows Server 2008 R2 Standard to one IIS 8.5 on Windows Server 2012 R2. I'm currently receiving the message below. I know System.Security.Claims is supposed to be in the mscorlib.dll and that seems to be in place. I'm not really certain what else would be helpful in even asking this question, but if anyone has ideas to point me in the right direction, that would be great! Thanks!
Server Error in '/profile' Application.
Method not found: 'Void System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)'.
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:
'Void
System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)'.
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:
[MissingMethodException: Method not found: 'Void System.Security.Claims.ClaimsIdentity..ctor(System.Security.Claims.ClaimsIdentity)'.]
System.Web.Security.FormsIdentity..ctor(FormsIdentity identity) +0
System.Web.Security.FormsIdentity.Clone() +35
System.Security.Principal.GenericPrincipal.AddIdentityWithRoles(IIdentity identity, String[] roles) +57
System.Web.Security.FormsAuthenticationModule.OnAuthenticate(FormsAuthenticationEventArgs e) +338
System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +88
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.6.1069.1
I was facing the same issue in one of our windows 2012 r2 servers. MVC applications built using forms identity were throwing errors.
We found out that a particular Microsoft update patch (KB3098785) was causing the issue.
We unistalled the patch, rebooted the server ans voila..everything was running fine
I can think of three causes:
You've missed a DLL that the application needs. Maybe a library or framework needs to be installed onto the server.
Maybe your two servers are running different versions of the .NET framework. Check both servers and see what versions they have, all the details are found on this MSDN article: https://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx
It might be a security/permissions thing. Try changing the app pool in IIS to run as an admin, and if the problem goes away, it's a permissions problem.

System.Web.Http.HttpConfiguration.get_ServiceResolver() not found

i've updated to the new mvc 4 RC version released this week and after deployment to azure, i got the error message:
Method not found: 'System.Web.Http.Services.DependencyResolver System.Web.Http.HttpConfiguration.get_ServiceResolver()'.
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.Http.Services.DependencyResolver System.Web.Http.HttpConfiguration.get_ServiceResolver()'.
I'm using the GlobalConfiguration.Configuration object to configure all the stuff and everything works on my machine.
Could you help me with this please?
Thanks!

Why is My ASP Web Application Attempting to Write to C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files?

I am encountering issues while deploying an ASP web application to HostMySite. The application has previously been deployed to their servers that are on different platforms without issues. However, for the current domain and server I continue to get the server error below.
Server Error in '/PropertyManagement' Application.
The current identity (ADSAFESECUREWEB\C116018-fhmonlinea) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files'.
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.Web.HttpException: The current identity (ADSAFESECUREWEB\C116018-fhmonlinea) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files'.
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. I know that the code is not explicitly attempting to write to the .NET temporary directory but, I was wondering if the application is somehow using that directory during run-time. The host keeps telling me that I have to configure my application to not use the temporary directory since they will not provide read/write access to it. Can someone please tell me why my application might be attempting to use this directory and what I can do to configure it to use a different directory that I have access to. I am new to ASP development and need help. Thanks!
Stack Trace:
[HttpException (0x80004005): The current identity (ADSAFESECUREWEB\C116018-fhmonlinea) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files'.]
System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +11650831
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +323
[HttpException (0x80004005): The current identity (ADSAFESECUREWEB\C116018-fhmonlinea) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11612256
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4842149
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
The CLR copies all your assemblies to that directory and compiles your .aspx/.asmx/etc files and puts the compiled version in Temporary ASP.NET Files.
This must be writable so that your site can be compiled at runtime.
Edit: Here is an MSDN article explaining it.
As discussed in the comments, if the provider refuses to let you write to that directory, you can override it by putting the following in your web.config, 'system.web' section:
<compilation tempDirectory="c:\path\to\directory\you\can\write" />
Add your application pool's identity to the server's IIS_IUSRS group.
I had to set the Application Pool identity to NETWORKSERVICE
And then add the user connecting to my website (the user you 'connect as' in IIS settings under Basic Settings for your website) to the IIS_IUSRS group
I had this error when I set the Physical Path Credentials (in Advanced Settings) to my application pool's account.
In my case the fix was to reset Physical Path Credentials to "Application user", and to fix my original error using this answer, i.e. to reset anonymous authentication to Application Pool identity, which for this specific site was IUSR, a user that did not have access to the application path (since we're using a specific user for the app pool identity).
Also can reinstall asp.net, find the steps from below :
cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
aspnet_iis -i

Categories