I'm trying to decipher the meaning on the P1...P10 parameters associated with a clr20r3 that is written to the event log when my application experiences an exception.
The best I've been able to find is:
P1: the hosting process (e.g. w3wp.exe)
P2: the hosting process version (e.g. 6.0.3790.1830)
P3: ??? (e.g. 42435be1)
P4: the assembly from which the exception was raised (e.g. mrtables.webservice)
P5: the assembly version (e.g. 2.1.2.0)
P6: ??? (e.g. 4682617f)
P7: ??? (e.g. 129)
P8: ??? (e.g. 50)
P9: the exception type raised (e.g. system.argumentexception)
P10: ??? (e.g. NIL)
Googling for clr20r3 provides thousands of sample parameter values, from which someone can try to derive a pattern.
But I'm hoping for documentation on the parameter meanings, as opposed to educated guesses.
Edit: While I can hope for canonical documentation, really I'd be happy to see the exception being thrown, at what line, complete with a stack trace.
Bonus Reading
Unhandled exception that caused the application to crash with "EventType clr20r3, P1 w3wp.exe" in the log, but no details there (asking for help with a problem, while we're asking for a canonical explanation of what the parameters mean)
P7 and P8 are the important ones to find out where the P9 exception was raised. Use P4 to know what assembly to look for. Run ildasm.exe and open that assembly. File + Dump, tick the "Token values" checkbox, OK and save the .il file somewhere.
Open the file in a text editor. P7 gives you the method token, it starts with 0x06, producing token value "06000129". Search for:
.method /*06000129*/
Which gives you the method name, look up from there to find the .class, that gives you the class name.
P8 gives you the IL offset. From the found .method, look for IL_0050 for the instruction that raised the exception. Mapping it back to your source code is a bit tricky but you'll probably figure it out. Use Reflector if necessary.
In general, write an event handler for AppDomain.UnhandledException to avoid the pain of reverse-engineering these Watson crash buckets. Log the value of e.ExceptionObject.ToString() to get both the exception message and a stack trace.
Here is the information on Watson Buckets
Exe File Name
Exe File assembly version number
Exe File Stamp
Exe file full assembly name
Faulting assembly version
Faulting assembly timestamp
Faulting assembly method def
Faulting method IL Offset within the faulting method
Exception type
And also here is a MSDN article on the same.
Sample:
Problem Signature 01: devenv.exe
Problem Signature 02: 11.0.50727.1
Problem Signature 03: 5011ecaa
Problem Signature 04: Microsoft.VisualStudio.SharePoint.Project
Problem Signature 05: 11.0.60226.0
Problem Signature 06: 512c2dba
Problem Signature 07: 18a8
Problem Signature 08: 1d
Problem Signature 09: System.NullReferenceException
Related
I've encountered a NullReferenceException that is not handled by the MVC global error event handler (Application_Error). This is only happening in production. The IIS application pool shuts down after five failures due to the Rapid-Fail Protection IIS settings. There's only one application in the pool.
Below is a snippet from a .wer (Windows Error Reporting) file. It contains information about the unhandled exception. My understanding is Sig[6] contains the important value. I used the value e3 (227 in decimal) to find the method signature in IL code.
EXE File name: Sig[0].Value=w3wp.exe
EXE File Assembly Version: Sig[1].Value=7.5.7601.17514
EXE File Stamp: Sig[2].Value=4ce7afa2
EXE File Full Assembly Version: Sig[3].Value=System.Web
Faulting Assembly Version: Sig[4].Value=4.7.3282.0
Faulting Assembly Timestamp: Sig[5].Value=5bd8e3e7
Faulting Assembly Method Def: Sig[6].Value=e3
Faulting Method IL Offset: Sig[7].Value=25
Exception Type: Sig[8].Value=System.NullReferenceException
The value of Sig[6] translates to the token 06000227. The instructions for translating from e3 to 06000227 can be found here.
.method /*06000227*/ private hidebysig newslot specialname virtual final
instance bool System.Web.HttpApplication.IExecutionStep.get_IsCancellable() cil managed
{
.override System.Web.HttpApplication/*0200003A*//IExecutionStep/*0200003F*/::get_IsCancellable /*0200003F::0600020B*/
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldc.i4.0
IL_0001: ret
} // end of method MapHandlerExecutionStep::System.Web.HttpApplication.IExecutionStep.get_IsCancellable
Provided I did the translation correctly, why would IsCancellable throw/cause a NullReferenceException? Is there more for me to trace up the call stack? The fact that the error is coming from System.Web is confusing me.
Other event handlers used in the global.asax:
Application_PreRequestHandlerExecute
Application_BeginRequest
Application_AuthenticateRequest
Please let me know if you need more details.
Thank you for your help.
I am trying to track down an error occurring on a target machine running Windows 7 64-bit for a C# WinForms application written in Visual Studio 2008. All I have to go on is the Windows Error Reporting output from the Event Viewer. I found a lot of helpful information here: http://www.codeilove.com/2012/09/debugging-using-windows-error-reporting.html.
Problem signature:
P1: myprogram.exe // filename of the executable
P2: 1.44.0.0 // assembly version for the executable in P1
P3: 560be2df // assembly timestamp for the executable in P1
P4: mscorlib // assembly where the fault occurred
P5: 2.0.0.0 // assembly version for the assembly in P4
P6: 4ca2b889 // assembly timestamp for the assembly in P4
P7: c43 // token for the method where the fault occurred
P8: 59 // IL offset into the method specified in P7
P9: System.FormatException // name of the exception that caused the fault
From the link it appears that P7, P8, and P9 are the most important, and that I should be able to find the method def for "c43" using ILDASM by looking for 06000c43. In C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll I find the following in System.Number:
.method /*06000C43*/ assembly hidebysig static
uint64 ParseUInt64(string 'value',
valuetype System.Globalization.NumberStyles/*020003B6*/ options,
class System.Globalization.NumberFormatInfo/*020003B5*/ numfmt) cil managed
Based on this information there is a System.FormatException occurring in System.Number.ParseUInt64, right? I have searched through my project in Visual Studio, and I can't find any instances where my code calls this function. Where do I go from here?
I have a top-level exception handler for Application.ThreadException that logs unhandled exceptions to a file. In this case I am getting an application crash and nothing in my log file. Is it safe to assume this Exception is happening in a thread other than my UI?
Starting with Vista SP1 you can configure Windows Error Reporting to collect local crash dumps. Just set registry settings on the target machine as described in that article and wait till your program crashes again. After that, check the directory that you've configured as DumpFolder. You should find a .dmp file in there. Open it in WinDbg or with Visual Studio and you should be able to see a full stack trace of where the exception happened.
I have a C# class which calls a .Net assembly built from a Matlab function. I am able to call this function from a simple C# console application with no problems.
However if I try to run a unit test from NUnit I get the following exception:
ClassLibrary1.Tests.UnitTests.TestPerformOptimization:
System.Reflection.TargetInvocationException : Exception has been
thrown by the target of an invocation. ----> System.Exception :
Error marshalling .NET object. 'Message: Unable to find assembly
'ClassLibrary1, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'. Source: mscorlib HelpLink: '
I get the same error if I try to call the class from either the standalone NUnit console, from ReSharper's test runner or if I try to call the function from say Excel (using Excel-DNA).
When calling my compiled Matlab component I actually wrap up a C# method (in an MWObjectArray object) and inject it in. I think the problem is happening when the compiled Matlab component tries invoking this injected method.
The only workaround I've found is to simply place a copy of my class (containing the method that is injected) in the same location as the NUnit test runner, the ReSharper test runner or Excel. However this is simply not a practical solution going forward as I need to install this application onto users machines. The other option which I can't use is copying the files to my %DEVPATH% for the same reason.
Is there a way I can tell the Matlab component where to find the assembly of my injected method/class?
SAMPLE PROJECT DOWNLOAD
There is a sample project available for download here. Just follow the instructions in the README.txt file located in the zip file.
Update 1
I manage to get my unit test to recognise my assembly by modifying my class to include the following in its constructor:
AppDomain.CurrentDomain.AssemblyResolve +=
(sender, args) => typeof(OptimizationFunction).Assembly;
However now I get the following exception:
Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. ---> System.Exception:
Error marshalling .NET object. 'Message: Could not load file or
assembly 'dotnetcli, Version=1.0.5488.33915, Culture=neutral,
PublicKeyToken=da1231a838c93da4' or one of its dependencies. A
strongly-named assembly is required. (Exception from HRESULT:
0x80131044) Source: mscorlib HelpLink: ' at
dotnetcli.throwNetExceptionID(BaseMsgID* msgId) at
dotnetcli.DeployedDataConversion.GetMxArrayFromObject(Object data)
--- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[]
arguments, Signature sig, Boolean constructor)
So now it has a problem resolving the dotnetclli.dll (See Fusion log/exception below) which as far as I know should reside only in C:\Program Files (x86)\MATLAB\MATLAB Runtime\v85\bin\win32.
Here's an excerpt from the Fusion Log:
=== Pre-bind state information ===
LOG: DisplayName = ClassLibrary1 (Partial)
WRN: Assembly Name: ClassLibrary1 | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token. > WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = nunit-agent-x86.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file:
C:\Insight\TFS\Asg\ConsoleApplication4\packages\NUnit.Runners.2.6.3\tools\nunit-agent-x86.exe.Config
LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication4/packages/NUnit.Runners.2.6.3/tools/ClassLibrary1.DLL.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/ClassLibrary1/ClassLibrary1.DLL.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/lib/ClassLibrary1.DLL.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/lib/ClassLibrary1/ClassLibrary1.DLL.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/addins/ClassLibrary1.DLL.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/addins/ClassLibrary1/ClassLibrary1.DLL.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/ClassLibrary1.EXE.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/ClassLibrary1/ClassLibrary1.EXE.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/lib/ClassLibrary1.EXE.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/lib/ClassLibrary1/ClassLibrary1.EXE.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/addins/ClassLibrary1.EXE.
LOG: Attempting download of new URL
file:///C:/XXXXX/ConsoleApplication1/packages/NUnit.Runners.2.6.3/tools/addins/ClassLibrary1/ClassLibrary1.EXE.
LOG: All probing URLs attempted and failed.
WRN: Partial binding information was supplied for an assembly: How come my console app can resolve this assembly by my NUnit test cannot?
Update 2
I got the following response from Matlab when I contacted them:
As far as I know this is the default .NET behavior when it comes to
deserializations. The application which deserializes the class looks
for the assembly in its own current folder and GAC where it cannot
find it. It is similar to (when you read this replace MATLAB with
Nunit)
http://www.mathworks.com/matlabcentral/answers/101695-why-can-my-assembly-not-be-found-when-deserializing-a-net-object-in-matlab-7-10-r2010a
You example does not represent the situation when MATLAB is involved.
MATLAB sends the class across APPDomains. Your example does not do
that.
Use Fuslogvw to have a look at the binding. You will see that it is
not MATLAB which cannot find the assembly it’s the calling application
which is unable to resolve the dependency (in your case
nunit-agent-x86.exe).
Make sure all needed files are produced by the compilation of ConsoleApplication4 and placed besides the executable (e.g. any needed assembly DLL, runtime DLL, .config file, etc.)
Once you are sure this happens, start NUnit with the --no-shadow-copy command line switch, or set it as a configuration parameter from your GUI tool. As Bush said, NUnit usually copies the files under test to a separate directory, and may leave behind important files.
If the class created by Matlab needs some sort of specific runtime, make sure it is correctly installed in the computers where you are running the tests / using Excel/ReSharper.
I would not try to fiddle, at this level, with the Assembly resolution process: please sum up the content at the article you linked, because it's paywalled, and try with NUnit's no-shadow-copy setting.
A propos first problem:
Run regedit
go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
Add DWORD ForceLog = 1
Add DWORD LogFailures = 1
Add DWORD LogResourceBinds = 1
Add String LogPath = C:\log\ (last \ must be there)
Create a directory for logs (c:\logs for example)
It will log where your app looked for assemblies and how it failed. It probably means that working directory of nunit was different from working directory used by your console application.
A propos second error: strongly named assembly is required means that the library you have tried to use was not signed. If it's your assembly you simply have to use visual studio's sign the assembly from project properties. If it's not your assembly you can decompile it and compile it with strong name (with this method), but provider of third party dll should give you a strong-named assembly.
My guess this issue comes from an .NET CLR version incompatibility. Some client's (I mean client who calls your assembly) loads different versions of the CLE, then the resolved assembly may incompatible with that loaded CLR. This could cause not found error, because a compatible assembly really not found.
Try to check/play with both client's versions (the console app) and the server's version (your assembly) and diagnose what is changing.
Also check your assembly reference has "Copy to the output directory" is checked in all projects
You will want to study how the probing operation happens at .NET load time. Here's the rules for that: https://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.110).aspx
Outside of including the bin in the assembly you are publishing, it's the loader that decides if the support cast of DLLs are loadable. If it cannot find it using the rules above then you are simply out of luck.
We have seen issues similar to this in the past, some developer says to system admin, here's the Dlls you need to get the app running. System Admin follows instructions and boom, the application fails at load time.
Reason: Some child of a child in the assembly referred to a dll that's NOT on the system based on the probing rules.
Solution
1) Get the (child of the child) dll to include all dependencies in its assembly
2) Change the newer Main assembly to include all the dependencies (if the children assemblies cannot be changed).
3) Manually copy them in.
4) Create an installer that does it all.
Is the assembly in the Global Assembly Cache (GAC) or any place the might be overriding the assembly that you think is being loaded? This is usually the result of an incorrect assembly being loaded, for me it means I usually have something in the GAC overriding the version I have in bin/Debug.
My guess this issue comes from an .NET CLR version incompatibility. Some client's (I mean client who calls your assembly) loads different versions of the CLE, then the resolved assembly may incompatible with that loaded CLR. This could cause not found error, because a compatible assembly really not found.
Try to check/play with both client's versions (the console app) and the server's version (your assembly) and diagnose what is changing.
Also check your assembly reference has "Copy to the output directory" is checked in all projects
I have written an application and I used Crystal Report for reporting . when I install on client PC ... exception occurred when report was generating
i guess may be my CrystalReport Runtime has problem.I installed "CRforVS_redist_install_32bit_13_0_12"
Exception Information :
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: Test.exe
Problem Signature 02: 0.60.0.89
Problem Signature 03: 54a7ef37
Problem Signature 04: PresentationFramework
Problem Signature 05: 4.0.30319.34209
Problem Signature 06: 5348b261
Problem Signature 07: 67e5
Problem Signature 08: 13
Problem Signature 09: System.ArgumentNullException
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1065
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Client spec : Windows 7 32bit
What should I do?
I have developed an application using .net 3.5 and have deployed it as an .exe on a number of machines with the same environment.
However, on one particular machine I get the following error. Stack Trace:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\WINDOWS\TEMP\wz58eig4.0.cs' could not be found
error CS2008: No inputs specified
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
at SSOClient..ctor()
at sc.tradesvc.SSOManager..ctor()
at sc.tradesvc.SSOManager.get_Inst()
at sc.cashflowgenerator.Controls.LoginForm.btnLogin_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.PerformClick()
at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.TextBoxBase.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
Loaded Assemblies:
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
CashflowGenerator
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/DATA/DEVEL/Output/CashflowGenerator.exe
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.21022.8 built by: RTM
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
System.Web.Services
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Could someone help me with this?
As I am new to .net could someone also tell me when why a temporary class needs to be created in the first place?
I just spent a lot of time searching for the answer to this so I thought I'd add it here to save some headache for others. If you use the xsd.exe tool to generate your cs it may have added double arrays [][] where an array should be []. Replace all [][] with [] in your generated cs file and retry.
XML Serialisation works by generating code to perform the serialisation. This is done in a temporary assembly created for that purpose the first time it is needed.
However this relies on being able to write the assembly to disk.1
Your options are either to (1) given the user account which is running the process write permission (for an ASP.NET application this is likely to be a bad idea). (2) Use the SDK tool (sgen.exe) to pre-generate (at development/compile time) the serialisation assembly, and then use (and deplot) that assembly.
1Open question: the APIs exist to create assemblies dynamically in memory: why not do that?
You only have to give the List Folder Contents and Read permissions on %windir%\Temp.
I found this post when trying to fix my problem, and didn't have to give my user account write access.
From Microsoft
You Need to give the permission to the temp folder which is in windows folder. And Your Problem is Solved...........
You need to add *IIS_IUSR* user with read write permission to C:\Windows\Temp folder.
NOTE: Everyone user will not work with full control.
Surfacing #grzenio's comment a bit further for recent users:
If you go to Project Properties -> Build -> Generate serialization assembly -> On, it forces the generation of the XML serializers assembly at compile time, eliminating the need to do so at runtime.
In turn, this means you don't need to change filesystem permissions (useful if you're, for example, hosting on Windows Azure Web Sites, where that isn't an option).
It may be also just some simple error in the serialized class (typically a result of some copy/paste). For example the following class will cause this error:
public class Foo
{
private string[] contexts;
/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("Context",
typeof(Property), IsNullable = false)]
public string[] Contexts
{
get { return this.contexts; }
set { this.contexts = value; }
}
}
Notice that typeof(Property) parameter in XmlArrayItem attribute is not compatible (most likely) with string causing similar exception:
System.InvalidOperationException:
Unable to generate a temporary class (result=1).
If typeof(Property) is replaced with typeof(string) serialization will work again.
the APIs exist to create assemblies dynamically in memory: why not do that?
Just a wild guess: I assume this possibility did not exist yet in .NET 1.0, or at least when the XmlSerializer was created and MS doesn't like changing existing behavior...
Give Read/Write Privileges to 'C:\WINDOWS\TEMP' folder. It will work.
It may be bacause you are switching application pooling identity in IIS
to be password instead of predefined
so you have one off the following
return to predefined
give prmission full control to user IWAM_WBSRV-01 on the windows temp folder
In case this helps anyone, my problem was coming from an inherited class used in the serialization. The problem went away when I made a full copy/paste of my class I was serializing and quit using ineritance. Unfortunately, the advantages of inheritance went away, but that is better than having this problem. (Hey, at least I'm pretty sure that's what solved it. Happened to do a reboot in there somehwere too.)
Windows 10 has Virus and threat protection - if you have Ransomware protection (controlled folder access) it will block sgen.exe by default. Add sgen.exe it to exception list.
sgen.exe is located here: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools
Folder name may vary depending on your Framework version