The type initializer for 'DevExpress.XtraTreeList.TreeList' threw an exception
Now this is a problem I have _a_lot_ . no matter what I do (Find usages, refactor->implement missing members) and afterwards it crashes my VS2008 so I have to restart it.
I have entered this exception a few times in the JIRA http://www.jetbrains.net/jira/browse/RSRP-89591 and http://www.jetbrains.net/jira/browse/RSRP-99326
only to found out that each issue is closed with no real explanation! Why are these closed?
Can someone please explain what this problem is please? And how I can solve this?
If you cannot simulate this, I'm more then willing to help you on this.
I'm feeling sad about this, because I really like R# but this isn't workable, I haven't tried DevExpress CodeRush yet, but now I'm forced, even if it doesn't offer the same functionality, at least it will offer some and perhaps will not crash me to the desktop, I hope.
We are a team of 20 developers who all tried R# but because of these problems, they all dropped it. Perhaps 20 dev is not big enough for you, but for us it is.
TIA
System.Runtime.Serialization.SerializationException: Attempting to deserialize an empty stream.
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at System.ComponentModel.Design.DesigntimeLicenseContextSerializer.Deserialize(Stream o, String cryptoKey, RuntimeLicenseContext context)
at System.ComponentModel.Design.RuntimeLicenseContext.GetSavedLicenseKey(Type type, Assembly resourceAssembly)
at DevExpress.Utils.About.DXLicenseProvider.GetSavedLicenseKey(LicenseContext context, Type type)
at DevExpress.Utils.About.DXLicenseProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)
at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
at System.ComponentModel.LicenseManager.ValidateInternal(Type type, Object instance, Boolean allowExceptions, License& license)
at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
at DevExpress.XtraTreeList.TreeList..cctor()
--- End of inner exception stack trace ---
System.TypeInitializationException: The type initializer for 'DevExpress.XtraTreeList.TreeList' threw an exception. ---> System.Runtime.Serialization.SerializationException: Attempting to deserialize an empty stream.
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at System.ComponentModel.Design.DesigntimeLicenseContextSerializer.Deserialize(Stream o, String cryptoKey, RuntimeLicenseContext context)
at System.ComponentModel.Design.RuntimeLicenseContext.GetSavedLicenseKey(Type type, Assembly resourceAssembly)
at DevExpress.Utils.About.DXLicenseProvider.GetSavedLicenseKey(LicenseContext context, Type type)
at DevExpress.Utils.About.DXLicenseProvider.GetLicense(LicenseContext context, Type type, Object instance, Boolean allowExceptions)
at System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
at System.ComponentModel.LicenseManager.ValidateInternal(Type type, Object instance, Boolean allowExceptions, License& license)
at System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
at DevExpress.XtraTreeList.TreeList..cctor()
--- End of inner exception stack trace ---
at DevExpress.XtraTreeList.TreeList..ctor()
at JetBrains.UI.TreeView.TreeModelView..ctor(ITreeViewController controller) in c:\Agent\work\18999c274dda3ce5\Platform\src\UI\src\TreeView\DevExpress\TreeModelView.cs:line 88
at JetBrains.UI.TreeView.TreeModelView..ctor(TreeModel model, ITreeViewController controller) in c:\Agent\work\18999c274dda3ce5\Platform\src\UI\src\TreeView\DevExpress\TreeModelView.cs:line 105
at JetBrains.UI.TreeView.TreeModelViewChecked..ctor(TreeModel model, ITreeViewController controller) in c:\Agent\work\18999c274dda3ce5\Platform\src\UI\src\TreeView\DevExpress\TreeModelViewChecked.cs:line 31
at JetBrains.ReSharper.Features.Altering.Generate.GeneratorPage.InitializeSelectorView() in c:\Agent\work\18999c274dda3ce5\src\Features\Altering\src\Generate\GeneratorPage.cs:line 239
at JetBrains.ReSharper.Features.Altering.Generate.GeneratorPage.InitializeView(String elementsCaption) in c:\Agent\work\18999c274dda3ce5\src\Features\Altering\src\Generate\GeneratorPage.cs:line 203
at JetBrains.ReSharper.Features.Altering.Generate.GeneratorPage..ctor(IList`1 elements, IList`1 options, IList`1 resultElements, String elementsCaption, IGeneratorWorkflow workflow) in c:\Agent\work\18999c274dda3ce5\src\Features\Altering\src\Generate\GeneratorPage.cs:line 73
at JetBrains.ReSharper.Features.Altering.Generate.GeneratorWorkflowForm.InitializeWorkflow() in c:\Agent\work\18999c274dda3ce5\src\Features\Altering\src\Generate\GeneratorWorkflowForm.cs:line 62
at JetBrains.ReSharper.Features.Altering.Generate.GeneratorWorkflowForm..ctor(IGeneratorWorkflow workflow, String title, String description) in c:\Agent\work\18999c274dda3ce5\src\Features\Altering\src\Generate\GeneratorWorkflowForm.cs:line 50
at JetBrains.ReSharper.Features.Altering.Generate.StandardGeneratorItem.Execute(IDataContext context) in c:\Agent\work\18999c274dda3ce5\src\Features\Altering\src\Generate\StandardGeneratorItem.cs:line 82
at JetBrains.ReSharper.Features.Altering.Generate.GenerateAction.<>c__DisplayClass3.<>c__DisplayClass5.<Execute>b__2() in c:\Agent\work\18999c274dda3ce5\src\Features\Altering\src\Generate\GenerateAction.cs:line 66
at JetBrains.Threading.Invocator.<>c__DisplayClass4.<ExecuteOrQueueReadLock>b__3() in c:\Agent\work\18999c274dda3ce5\Platform\src\Shell\src\Threading\Invocator.cs:line 162
at JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\Concurrency\ReentrancyGuard.cs:line 306
--- End of inner exception stack trace ---
LoggerException: The type initializer for 'DevExpress.XtraTreeList.TreeList' threw an exception.
at JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\Concurrency\ReentrancyGuard.cs:line 311
at JetBrains.Threading.ReentrancyGuard.ExecuteOrQueue(String name, Action action) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\Concurrency\ReentrancyGuard.cs:line 339
at JetBrains.Threading.Invocator.ExecuteOrQueue(String name, Action action) in c:\Agent\work\18999c274dda3ce5\Platform\src\Shell\src\Threading\Invocator.cs:line 145
at JetBrains.Threading.Invocator.ExecuteOrQueueReadLock(String name, Action action) in c:\Agent\work\18999c274dda3ce5\Platform\src\Shell\src\Threading\Invocator.cs:line 159
at JetBrains.ReSharper.Features.Altering.Generate.GenerateAction.<>c__DisplayClass3.<Execute>b__1(Object key) in c:\Agent\work\18999c274dda3ce5\src\Features\Altering\src\Generate\GenerateAction.cs:line 65
at JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\DataFlow\Signal!1.cs:line 280
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\DataFlow\Signal!1.cs:line 390
at JetBrains.DataFlow.Signal`1.Fire(TValue value) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\DataFlow\Signal!1.cs:line 360
at JetBrains.UI.PopupMenu.JetPopupMenu.<>c__DisplayClassb.<Show>b__5(JetPopupMenuItem item) in c:\Agent\work\18999c274dda3ce5\Platform\src\UI\src\PopupMenu\JetPopupMenu.cs:line 368
at JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\DataFlow\Signal!1.cs:line 280
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\DataFlow\Signal!1.cs:line 390
at JetBrains.DataFlow.Signal`1.Fire(TValue value) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\DataFlow\Signal!1.cs:line 360
at JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\DataFlow\Signal!1.cs:line 280
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\DataFlow\Signal!1.cs:line 390
at JetBrains.DataFlow.Signal`1.Fire(TValue value) in c:\Agent\work\18999c274dda3ce5\Platform\src\Util\src\DataFlow\Signal!1.cs:line 360
at JetBrains.UI.PopupMenu.Impl.JetPopupMenuDoc.ExecuteSelectedItem() in c:\Agent\work\18999c274dda3ce5\Platform\src\UI\src\PopupMenu\Impl\JetPopupMenuDoc.cs:line 272
at JetBrains.UI.PopupMenu.Impl.JetPopupMenuMainpartView.OnKeyDownLowPriority(KeyEventArgs args) in c:\Agent\work\18999c274dda3ce5\Platform\src\UI\src\PopupMenu\Impl\JetPopupMenuMainpartView.cs:line 1502
at JetBrains.UI.PopupMenu.Impl.JetPopupMenuView.OnKeyDown(KeyEventArgs args) in c:\Agent\work\18999c274dda3ce5\Platform\src\UI\src\PopupMenu\Impl\JetPopupMenuView.cs:line 809
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at JetBrains.UI.PopupMenu.Impl.JetPopupMenuView.WndProc(Message& m) in c:\Agent\work\18999c274dda3ce5\Platform\src\UI\src\PopupMenu\Impl\JetPopupMenuView.cs:line 1006
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Please sign in to leave a comment.
Hello Christiaan,
This looks like a problem in DX component we are using for UI (TreeList),
and we were never able to reproduce it. It looks like it verifies license
and fails. Here is what additional information may help:
Do you use DX controls in your solution?
Do you have them installed?
Which version if so?
Do you have App_Licenses assembly somewhere?
Create and execute the following macro, tell us what is shows
Sub ShowLicense()
MsgBox("<" & AppDomain.CurrentDomain.SetupInformation.LicenseFile
& ">")
End Sub
Thanks!
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
C> Now this is a problem I have alot_ . no matter what I do (Find
C> usages, refactor->implement missing members) and afterwards it
C> crashes my VS2008 so I have to restart it.
C>
C> I have entered this exception a few times in the JIRA
C> http://www.jetbrains.net/jira/browse/RSRP-89591 and
C> http://www.jetbrains.net/jira/browse/RSRP-99326
C>
C> only to found out that each issue is closed with no real explanation!
C> Why are these closed?
C>
C> Can someone please explain what this problem is please? And how I
C> can solve this?
C>
C> If you cannot simulate this, I'm more then willing to help you on
C> this.
C>
C> I'm feeling sad about this, because I really like R# but this isn't
C> workable, I haven't tried DevExpress CodeRush yet, but now I'm
C> forced, even if it doesn't offer the same functionality, at least it
C> will offer some and perhaps will not crash me to the desktop, I hope.
C>
C> We are a team of 20 developers who all tried R# but because of these
C> problems, they all dropped it. Perhaps 20 dev is not big enough for
C> you, but for us it is.
C>
C> TIA
C>
C> ---
C> Original message URL:
C> http://www.jetbrains.net/devnet/message/5234213#5234213
Dear Ilya,
No, I don't use any DX components in my projects (only infragistics)
I've used to have a free package of the DX controls installed but I removed it some time ago, with no result.
I have App_licenses.dll files on my system, but these are all in Infragistics folders:
C:\Program Files\Infragistics\NetAdvantage for .NET 2008 Vol. 2 CLR 3.5\ASP.NET\Forms\WebSchedule\Bin\App_Licenses.dll
C:\Documents and Settings\christiaanv\My Documents\Infragistics\NetAdvantage for .NET 2008 Vol. 2 CLR 2.0\Samples\ASP.NET\Bin\App_Licenses.dll
C:\Inetpub\wwwroot\aspnet_client\infragistics\20082CLR35\Forms\WebSchedule\Bin\App_Licenses.dll
The output of the macro is: "<>"
Thanks for the swift response!
C+++
for what it's worth, if you want I can start a webex session so you can take over my coputer if you ever need to.
C+++
Hello Christiaan,
Do I understand correctly that the last entry is in your current solution?
Could you please try to remove it temporary and see if ReSharper continues
to crash (or not)?
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
IR> Dear Ilya,
IR>
IR> No, I don't use any DX components in my projects (only infragistics)
IR> I've used to have a free package of the DX controls installed but I
IR> removed it some time ago, with no result.
IR> I have App_licenses.dll files on my system, but these are all in
IR> Infragistics folders:
IR> C:\Program Files\Infragistics\NetAdvantage for .NET 2008 Vol. 2
IR> CLR 3.5\ASP.NET\Forms\WebSchedule\Bin\App_Licenses.dll
IR> C:\Documents and Settings\christiaanv\My
IR> Documents\Infragistics\NetAdvantage for .NET 2008 Vol. 2 CLR
IR> 2.0\Samples\ASP.NET\Bin\App_Licenses.dll
IR>
IR> C:\Inetpub\wwwroot\aspnet_client\infragistics\20082CLR35\Forms\WebSc
IR> hedule\Bin\App_Licenses.dll
IR> The output of the macro is: "<>"
IR> Thanks for the swift response!
IR> C+++
IR> ---
IR> Original message URL:
IR> http://www.jetbrains.net/devnet/message/5234222#5234222
Do you mean by 'last entry' the app_licenses.dll?
If so, no, that is not part of my project.
Sorry, if my previous post was misleading.
C+++
Please run the following macro:
Sub ShowLicense()
Dim comparer As CompareInfo = CultureInfo.InvariantCulture.CompareInfo
Dim sb As New StringBuilder
For Each asm As Assembly In AppDomain.CurrentDomain.GetAssemblies()
Dim assemblyShortName As String = asm.GetName.Name
For Each resource As String In asm.GetManifestResourceNames
If comparer.Compare(resource, Name, CompareOptions.IgnoreCase)
= 0 _
OrElse comparer.Compare(resource, assemblyShortName + ".exe.licenses")
= 0 _
OrElse comparer.Compare(resource, assemblyShortName + ".licenses")
= 0 _
OrElse comparer.Compare(resource, assemblyShortName + ".dll.licenses")
= 0 Then
sb.AppendLine(resource)
End If
Next
Next
MsgBox(sb.ToString)
End Sub
Hint: you can use Ctrl+C in message boxes to copy its content to clipboard.
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
IR> Do you mean by 'last entry' the app_licenses.dll?
IR> If so, no, that is not part of my project.
IR> Sorry, if my previous post was misleading.
IR>
IR> C+++
IR>
IR> ---
IR> Original message URL:
IR> http://www.jetbrains.net/devnet/message/5234233#5234233
When I run this macro: the result is an empty MsgBox
When I change the macro to show me the loaded assemblies (so before the If statement) the result is:
The code is:
Now, I've attached a debugger to the VS instance and listed the loaded modules and this is the result:
Hope this helps
Do you have .NET Shared Sources? If so, could you please put breakpoint at
"System.ComponentModel.Design.RuntimeLicenseContext.GetSavedLicenseKey" (Debug
| New breakpoint | Break at function) and tell me parameters to that function?
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Yes, I have.
I've been doing my normal stuff, as I always do: find references, refactor -> implement missing members, I've got the exception when I did a rename of a class
The result is the always same for each call to 'GetSavedLicensKey':
Christiaan,
Thanks for the info, that makes sense. Looks like it scans all assemblies
and finds empty license resources in some assembly. Could you please step
through that method to find what assembly it believes contains license stream?
We then probably will be able to reproduce it here and continue in-house.
Thanks!
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
IR>
IR> Yes, I have.
IR> I've been doing my normal stuff, as I always do: find references,
IR> refactor -> implement missing members, I've got the exception when I
IR> did a rename of a class
IR>
IR> The result is the always same for each call to 'GetSavedLicensKey':
IR>
IR>
IR>
IR> ---
IR> Original message URL:
IR> http://www.jetbrains.net/devnet/message/5234252#5234252
Hello Christiaan,
I've reproduced the exception by creating fake empty embedded resource with
specially formed name. I will try to make a workaround, but it may be very
hard if even possible (DX checks their license in static ctor, so if it fails,
type is not accessible). When you have time, please debug the process and
tell us what assembly contains such ill-formed license resource. We would
like to know if it is a problem in project, installed package or whatever.
Thanks for your help!
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Great, I've narrowed it down to one of our assemblies which contains an empty xxx.dll.license resource (0 bytes). This was caused by having an empty .licx.
I've removed it, and now I can rename classes without having R# crashing me to the desktop (which was the main cause of my crashes)
If this is the problem, I'm glad this is solved.
A big thanks for your support.
Hello Christiaan,
Great to hear the problem is resolved. However, I wonder why your project
assembly was loaded into main AppDomain? Is it some code containing designers?
Could you please give us more information about that assembly? I'm trying
to understand how it happens, so that we have real repro case we can work
with, not just fake exception generator.
Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
IR>
IR>
IR> Great, I've narrowed it down to one of our assemblies which contains
IR> an empty xxx.dll.license resource (0 bytes). This was caused by
IR> having an empty .licx.
IR>
IR> I've removed it, and now I can rename classes without having R#
IR> crashing me to the desktop (which was the main cause of my crashes)
IR>
IR> If this is the problem, I'm glad this is solved.
IR>
IR> A big thanks for your support.
IR>
IR> ---
IR> Original message URL:
IR> http://www.jetbrains.net/devnet/message/5234268#5234268
in fact, this assembly (which contained the empty .licenses resource) is a reference and contains controls which are used in the current solution, so that could the reason why this assembly is also checked for valid licenses.
Once again, a big thanks for your support, I owe you a beer (or more)
C+++
Hello Ilya,
I have some more info on why there was an empty .licenses in the assembly, in fact our nantbuild script doesn't handle license.licx well, it just compiles it as a resource not as a license.
That's why this resource is empty (0 bytes) when you compile it with VS it is not null and there is no problem (read: crash)
Cya
C+++
I am having the same problem.
As soon as I use (tried Run unit test-, Rename, and Run all test in solution- commands) my Visual Studio 2008 crasches.
I had DevExpress on my system - but uninstalled it when the problems arose...
After reading this thread I searched my system for .licx-files and deleted them (none of 0 bytes though). I only had .licx files that related to DevExpress.
But no use - Visual Studio still crasches.
I have Visual Studio 2008 with Resharper 4.5 installed.
The strangest thing is that this worked just two days ago.
Any help on how to solve this?
/Marcus
www.marcusoft.net
Hello Marcus
Do you see any exception messages from ReSharper or Visual Studio just crashes?
Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Hello,


I managed to capture a errormessage if I was real quick. See attached files.
Just to clarify - I have unistalled all DevExpress stuff before I reinstalled Resharper again. Of course i rebooted my computer in between.
Hello Marcus
Please run Visual Studio (devenv.exe) with '/ReSharper.LogFile C:\log.txt /ReSharper.LogLevel Verbose' command line parameters, wait until it crashes with exception and attach the resulting log.txt here. Thank you!
Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
OK - said and done!
Here you are
/Marcus
www.marcusoft.net
Attachment(s):
log.txt.zip