-1
J'ai utilisé un WinForm pour héberger mon composant COM et le lancer dans IIS, cela a bien fonctionné dans VS pendant le test, mais après avoir publié sur IIS, j'ai reçu l'exception "class not registered" et alors le pool d'applications s'est écrasé. Au début, je pensais que cela se rapportait à l'enregistrement COM, mais j'écris une application test winform pour invoquer même COM et cela fonctionne bien sur le même serveur.IIS use COM got Classe exception non enregistrée
Quelqu'un?
class FaceScannerServerHost : Form
{
public FaceScannerServerHost(Control control, bool hidden = false)
{
if (control.IsHandleCreated) throw new InvalidOperationException("control already committed to wrong thread");
if (hidden) this.Opacity = 0;
this.Hide();
this.ShowInTaskbar = false;
using (initDone = new ManualResetEvent(false))
{
thread = new Thread((_) =>
{
try
{
//COM control
AxC_FaceServerSdk axc = (AxC_FaceServerSdk)control;
this.Controls.Add(axc);
//crashed here
Application.Run(this);
}
catch (Exception exp)
{
TraceLog.Debug("AxServer", exp.Message);
}
});
thread.IsBackground = true;
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
initDone.WaitOne();
}
}
juste point 5 .. Je pense que COM est 32 bits, mais je ne sais pas comment faire avec cela. –