I am trying to change my Platform target for a C# application from x86 to Any CPU. My application uses a _click method which runs a new thread which opens a viewer window using the following method to show the window:
public void Show(string url, int entityId, string sessionId, int projId, string docId)
{
base.Show();
try
{
this.DocViewer.InitComm(url, entityId, sessionId, projId, docId);
}
catch (Exception ex)
{
Logger.Error("Error opening viewer", ex);
throw;
}
}
When running on the x86 platform, the application runs without issue. I changed the platform to "Any CPU" and receive a "COMException was unhandled" error: "Class not regisered (Exception from HRESULT: 0X80040154 (REGDB_E_CLASSNOTREG))" highlighting:
base.Show();
I have researched the cause of this error and it seems to be due to registry redirection. Because I am using .NET 3.5, I have been unable to use many of the solutions that I have found including one from this thread on SO. I am unclear on how the information here could be helpful as many of the links to the code are in C++.
If anyone could provide me with insight I would greatly appreciate it.