Thursday, July 28, 2016

White screen of Darn System.Resources.Tools.StronglyTypedResourceBuilder.Create

Today a colleague and me spent a lot of time looking for a solution to a White screen of Darn error in Visual Studio which we started to receive for every form we wanted to open in one specific project in one solution. The error we were getting was:

 Object reference not set to an instance of an object at System.Resources.Tools.StronglyTypedResourceBuilder.Create(IDictionary resourceList, String baseName, String generatedCodeNamespace, String resourcesNamespace, CodeDomProvider codeProvider, Boolean internalClass, String[]& unmatchable)  
 at System.Resources.Tools.StronglyTypedResourceBuilder.Create(IDictionary resourceList, String baseName, String generatedCodeNamespace, CodeDomProvider codeProvider, Boolean internalClass, String[]& unmatchable)  
 at Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.BuildType()  
 at Microsoft.VisualStudio.Design.Serialization.ResXGlobalObject.GetObjectType()  


After trying all the traditional fixes: reboot, clean and rebuild solution, attach another instance of visual studio to debug your WSOD the error still was persisting. For more information about these possible solutions have a look here,The only thing I feel that is missing from this link is that you can also turn off "Just my code" to view even more errors which are not thrown by your own code.

I then started to dive deeper in the .vbproj file because it was only one specific project which gave the errors. I noticed that there were two linked resx files, which are part of a form, added by another colleague but they weren't correctly added. They where missing the <DepentUpon> element.

<EmbeddedResource Include="..\..\..\Mailing\frmMailLog.fr-FR.resx">  
  <Link>Mailing\frmMailLog.fr-FR.resx</Link>  
</EmbeddedResource>  
<EmbeddedResource Include="..\..\..\Mailing\frmMailLog.resx">  
  <Link>Mailing\frmMailLog.resx</Link>  
</EmbeddedResource>  

After fixing these errors and reloading the project the WSOD error was gone and we could again open every form in design view.

<EmbeddedResource Include="..\..\..\Mailing\frmMailLog.fr-FR.resx">  
  <Link>Mailing\frmMailLog.fr-FR.resx</Link>  
  <DependentUpon>frmMailLog.vb</DependentUpon>  
</EmbeddedResource>  
<EmbeddedResource Include="..\..\..\Mailing\frmMailLog.resx">  
  <Link>Mailing\frmMailLog.resx</Link>  
  <DependentUpon>frmMailLog.vb</DependentUpon>  
</EmbeddedResource>  

Friday, July 8, 2016

Visual Studio 2015 suo file location

Sometimes when running into problems with Visual Studio it's necessary to delete the .suo file of a solution so you can open the solution again without any screens open. In Visual Studio 2015 the location of this file has changed. You can find it at:

\\SolutionRootFolder\.vs\SolutionName\v14\

Thursday, June 23, 2016