想要在我的服務器上運行asp.net的exe文件,這可能嗎?從asp.net調用服務器上的exe
我用這個方法:
System.Diagnostics.Process process1 = new System.Diagnostics.Process();
// Set the directory where the file resides
process1.StartInfo.WorkingDirectory = @"D:\dev\Analyzer\bin\Release";
// Set the filename name of the file you want to open
process1.StartInfo.FileName = @"D:\dev\Analyzer\bin\Release\Analyzer.exe";
process1.StartInfo.Arguments = "123";
// Start the process
process1.Start();
它工作時,我調試它,而是把在本地主機上我的網站時,有時我會例外:
用戶登錄失敗「IIS APPPOOL \ DQ '
其中dq是我的網站的名稱。
堆棧:
System.Data.SqlClient.SqlException(0x80131904):用戶登錄失敗 'IIS APPPOOL \ DQ'。 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException異常,布爾breakConnection)在System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()在System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,SqlCommand cmdHandler,SqlDataReader的dataStream,BulkCopySimpleResultSet System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo,String newPassword,Boolean ignoreSniOpenTimeout,TimeoutTimer timeout,SqlConnection owningObject)上的System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)處的BulkCopyHandler,TdsParserStateObject stateObj) SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo,String newPassword,Boolean redirectedUserInstance,SqlConnection owningObject,SqlConnectionString connectionOptions,TimeoutTimer超時)在System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject,TimeoutTimer超時,SqlConnectionString connectionOp System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions)上System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity身份,SqlConnectionString connectionOptions,對象providerInfo,字符串newPassword,SqlConnection擁有對象,布爾redirectedUserInstance)的字符串newPassword,布爾redirectedUserInstance) (System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject))上System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection,DbConnectionPool池,DbConnectionOptions選項)上的選項,對象poolGroupProviderInfo,DbConnectionPool池,DbConnection owningConnection)。 System.Data.ProviderBas上的System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)上的System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)處的ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) System.Data.SqlClient.SqlConnection.OpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory)在System.Data.SqlClient.SqlConnection.Open()System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser用戶)在System.Data.Linq.SqlClient.SqlProvider System.Data.Linq上System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(表達式查詢)上System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()上的.get_IsSqlCe() D:\ dev \ Analyzer \ Program.cs中的Analyzer.Program.Main(String [] args)中的.DataQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator():第59行
請提供完整的例外詳情。說出一個例外是沒有細節的。 – Oded 2011-05-30 18:54:43
該網站使用了什麼useraccount,並有權訪問這些文件? – Gluip 2011-05-30 18:57:37
此外它需要某些.net權限,這可能不會在大多數主機上授予。 – 2011-05-30 18:59:47