I debug a site. I need to identify the .NET and ASP.NET version of the running site (on a local IIS).
When I have an .NET Error, the a page is displayed, like this:
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: Unrecognized attribute 'requestValidationMode'.
Note that attribute names are case-sensitive.
Source Error:
Line 120: Line 121: Line
122: Line 123: Line
124:
Source File: C:\mysite\opt\root\web.config Line: 122
Version Information: Microsoft .NET Framework Version: 4.0.30319;
ASP.NET Version: 4.6.1038.0
Is there a way to obtain that data in other way than a error message, to be able to identify that versions at demand?
I would like to stress that .NET and ASP.NET are different, and I need both of them.
PS. I would prefer, if possible do not have to modify the code, but rather via IIS...
You can try either of this below
typeof(Page).Assembly.GetName().Version; //ASP.NET Version
This gives your running ASP.NET version which in my case 4.0.0.0. You can find the same information if you expand your Reference folder -> find System.Web dll -> right click and choose properties -> check the Version information.
System.Environment.Version.ToString(); //Framework Version
This gives the version information of the CLR.
.NET Framework - registry check?
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full
https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx
Environment.Version
should give you the ASP.NET version
Related
Using an existing .NET 5 MVC Web App, I attempted to upgrade to .NET 6, but encountered this error. I am also using IIS for Windows Authentication--now setup in .NET 6 as "profiles" under Properties -> Debug -> hyperlink (Open debug launch profiles UI). I also included the newer "Microsoft.AspNetCore.Authentication.Negotiate" Nuget package (and associated code) to handle the newer Windows Authentication library.
When the web app launches, I get the following error:
An unhandled exception occurred while processing the request.
InvalidOperationException: Cannot find compilation library location for package 'System.Security.Cryptography.Pkcs'
Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths(ICompilationAssemblyResolver resolver, List assemblies)
Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths()
Microsoft.AspNetCore.Mvc.ApplicationParts.AssemblyPartExtensions+<>c.b__0_0(CompilationLibrary library)
System.Linq.Enumerable+SelectManySingleSelectorIterator<TSource, TResult>.MoveNext()
...
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
This does NOT go away if I add the package listed: System.Security.Cryptography.Pkcs
I needed to remove at least 1 Nuget package:
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation -- I removed this one second, but it started working after I did.
Microsoft.Extensions.Hosting -- I removed this one first, but this alone did not fix it. I don't know if this "also" needed to be removed. I assume not, but I'm including, just in case. Removing it did not hurt anything.
Edit: As a WARNING, this will lose the abilities given by Razor.RuntimeCompilation. However, there appears to be a code incompatibility with, I believe, IIS and Razor in .NET 6.
I get this error only when running application (piranha cms) inside docker container.
I had to remove razor runtime compilation to make it work.
// comment out or delete this line
// options.AddRazorRuntimeCompilation = true;
Our team right now is upgrading our BizTalk 2009 server to 2010 and one of the process we need to undertake is to convert our codes from .Net Framework 2.0 to 4.0, but when we tried to test the newly converted codes, we hit this error that was not encountered when we are still using .Net Framework 2.0.
A message received by adapter "FILE" on receive location RL.CMSO.CHTR.WebService.SubmitOrder" with URI D:\Data\CMSO\CHTR\WebService\Retry\SubmitOrder*.xml" is suspended.
Error details: There was a failure executing the receive pipeline: CMSO.CHTR.Pipelines.ReceiveRequest, CMSO.CHTR.Pipelines, Version=10.7.1.0, Culture=neutral, PublicKeyToken=32f1cdb63bb6ffdb"
Source: "OrderUID Pipeline Component"
Receive Port: "RP.CMSO.CHTR.WebService.SubmitOrder"
URI: D:\Data\CMSO\CHTR\WebService\Retry\SubmitOrder*.xml"
Reason: Error initilalizing AssignOrderUID Execute method.
Exception Details: Object reference not set to an instance of an object.
MessageId: {B1A1A514-CD9E-4164-8767-BF9BB4788EA0}
InstanceID: {892341D0-CC5C-4AF6-A6F2-D8AF49D6E077}
Please be reminded that before we upgraded our BizTalk we can use our system successfully, the error was encountered after the conversion. Can someone help us identifying the root cause of this issue?
While trying to run a Visual Studio 2012 website on local iis I receive the following in the browser after a successful build.
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: The compiler failed with error code
-1073741511.
Show Detailed Compiler Output:
c:\windows\system32\inetsrv>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\vbc.exe"
/t:library /utf8output ...
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.6.81.0 1073741511
What could be causing this?
The answer to my problem came from both of the comments above. I repaired the installation using isos for VS2012 and update 5. And, there was an incorrect dll version. I would like to give credit to antlersoft and Paul Zahra. How do I do that?
Logged into a customer environment today to check logs and just generally do an inspection, only to notice some tasks had failed in one application.
Application is written in c# .net v4 running inside of IIS and exports to Sharepoint 2007.
I can't be 100% sure if .net or SharePoint is the culprit. These are the errors I got:
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\qbckfur1.dll'.
Export 26.05.2011 15:00:21 Failure
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\2shjg2xb.dll'.
Export 26.05.2011 15:30:13 Failure
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\b7utp199.dll'.
Export 26.05.2011 16:00:15 Failure
Task Failed: Server was unable to
process request. ---> Could not find
file 'C:\Windows\TEMP\ozr2umkm.dll'.
Does this look familiar to anyone?
This is a problem with XmlSerialization (beleive it or not). I ran into this with a custom ASP.NET MVC app. Apparently, when you call Serialize or Deserialize on types marked as "Serializable", .NET will generate an assembly on-the-fly to support the serialization and it attempts to write that assembly into 'c:\windows\temp'.
Even if Everyone has full control access to that directory I have still seen this occur when running an app from within an IIS App Pool. Especially in applications that has a lot of serialization activity.
If this sounds like your problem, the solution is to "pre-compile" the Serialization assembly and include it in your application with sgen, part of the Windows SDK.
This post highlights a similar issue: Serialization issue on MSDN Social
Here is the MSDN article on the tool: sgen reference
Final Note: There is a separate version of the Tool for .NET 4.0 so make sure you are using the correct version when generating your assembly.
I've inherited a C# .net WPF application from a now ex-employee and am having some difficulties running the application. It all builds fine without a single error or warning, but before the GUI appears I get an error:
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Corrupt .resources file. Name position for index '156' is outside of name section '0xab02'.
Any suggestions on how to identify which .resources file it is and/or how to re-create them (I've tried rubuilding all which made no difference).
Okay, so it turned out that although Visual Studio was set up to use v3.5 of the .net framework you need to seperately install v3.5 of the framework - it seems I only had v2 installed. Let this be a lesson for anyone else struggling with the same problems!