Errore "Licenza scaduta" durante la generazione dinamica di documenti Excel in ASP.NET

StackOverflow https://stackoverflow.com/questions/254207

  •  05-07-2019
  •  | 
  •  

Domanda

Qualcuno ha familiarità con l'errore di seguito? Quando eseguo la mia webapp per generare un documento Excel dinamico dal mio computer locale funziona benissimo ma quando lo stesso pezzo di codice viene invocato sul server ottengo l'errore di seguito. Sembra che si tratti di un problema di autorizzazioni poiché funziona sulla mia macchina ma non sul server ma non so da dove iniziare per individuare il problema. Qualsiasi consiglio / aiuto è molto apprezzato!

Server Error in '/' Application.
--------------------------------------------------------------------------------

This command is unavailable because the license to use this application has expired. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.InteropServices.COMException: This command is unavailable because the license to use this application has expired.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[COMException (0x800a03ec): This command is unavailable because the license to use this application has expired.]
   Microsoft.Office.Interop.Excel.Workbooks.Add(Object Template) +0
   PaymentsReport.Page_Load(Object sender, EventArgs e) +70
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

Office / Excel è installato sul server e posso aprire / salvare documenti Excel sul server. Potrebbe essere la versione di Excel sul server rispetto al mio computer locale? In tal caso, come posso assicurarmi di avere le ultime novità sul server?

È stato utile?

Soluzione

L'uso di Office Interop richiede che i componenti di Office che stai utilizzando siano effettivamente installati sul server.

Altri suggerimenti

Oltre ad essere installato, è necessario assicurarsi che l'applicazione sia attivata sul server:

http://support.microsoft.com/kb/294973

Ha dettagli su come farlo.

Prenderò un WAG e dirò che non puoi semplicemente schiaffeggiare qualsiasi vecchia copia di Office su un server e consentire a più utenti di accedervi tramite il tuo sito Web. È necessario esaminare le restrizioni di licenza per l'utilizzo di MS Office in un ambiente server.

Hai una copia di Excel attivata e autorizzata sul server? Probabilmente funziona sul tuo computer locale perché Office / Excel è installato localmente.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top