I am trying to deploy an MVC app to an IIS server with a connection to an Oracle database. To do this I've downloaded the ODAC extension for Visual Studio 2013, as well as used Nuget to install the latest ODP.NET managed client into the project. My development machine also has an Oracle client installed (i.e. I can run SQL Developer on my dev box) but from what I read ODP.NET should not require the Oracle client on the server. However, the app runs fine on my dev box but when deploying to the server I get errors and can't get any Oracle connection to work at all. So far I can't find any useful information on what is causing the errors or how to get around it.
Environment: Visual Studio 2013 Update 5 on 64bit Windows 7, deploying to Windows Server 2008 IIS 7. I do not have administrative rights on the IIS box, it is locked down. The server admin is bending over backwards to help as much as he can but he does not know Oracle, and I know just barely enough to be dangerous. The local Oracle devs all run Java on Linux servers, so I'm the odd .NET/Windows guy with no internal support. Oracle database is 11.2.0.3.0. The web app is in a 64 bit app pool.
IMPORTANT: The Oracle Client is not installed on the IIS box. We aren't sure if a separate Oracle Client must be installed, my readings indicate not but I could be wrong.
What I Need: Ideally a project that can deploy to an arbitrary IIS server and connect to my target Oracle database, without needing any Oracle components/clients installed on the server. I want to be as self-contained as possible, so I can minimize impact on the server as well as be 100% responsible for the configuration management of my app. If I can't be totally self-contained then I need to be able to generate a written document with repeatable steps to configure and deploy to a new IIS server at will, with minimal impact on the server and Oracle admins. Entity Framework would be really nice but not absolutely required -- my "real" app (this one is just a spike to test the connection) currently uses OleDbDataReader objects inside domain repositories, and I will swap them to OracleDataReader once the ODP.NET connection works properly.
Speculation: Currently I'm considering the following causes of the below errors. But I don't know which is the actual cause, so I don't know where to focus my efforts.
Server needs components installed. If so, which ones?
Server is blocked by firewall or not whitelisted by the database server. Firewall should not be an issue per the server admin, not sure about the database whitelist.
?? Something else ??
Below is a summary of what I have and what I get. Each Action is followed by the error message it generates.
Each of these runs perfectly on my dev box -- the errors are all on the server.
/Home/Index
This is virtually a copy/paste from this Oracle tutorial:
public ActionResult Index()
{
string conString = "User Id=myuserid;Password=mypassword;" +
"Data Source=mydomain.foo:1521/myservicename; Pooling=false;";
OracleConnection con = new OracleConnection();
con.ConnectionString = conString;
con.Open();
return Content("OK");
}
Error Message: ORA-12537: Network Session: End of file
ORA-12537: Network Session: End of file
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: OracleInternal.Network.NetworkException: ORA-12537: Network Session: End of file
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:
[NetworkException (0x30f9): ORA-12537: Network Session: End of file]
OracleInternal.Network.ReaderStream.ReadIt(OraBuf OB, Int32 len) +294
OracleInternal.Network.ReaderStream.ReadwithCrypto(OraBuf OB) +127
[NetworkException (0x80004005): ORA-12570: Network Session: Unexpected packet read error]
OracleInternal.Network.ReaderStream.ReadwithCrypto(OraBuf OB) +1188
OracleInternal.Network.ReaderStream.Read(OraBuf OB) +88
OracleInternal.TTC.OraBufReader.GetDataFromNetwork() +274
OracleInternal.TTC.OraBufReader.Read(Boolean bIgnoreData) +46
OracleInternal.TTC.MarshallingEngine.UnmarshalUB1(Boolean bIgnoreData) +16
OracleInternal.TTC.TTCProtocolNegotiation.ReadResponse() +86
[OracleException (0x80004005): ORA-12570: Network Session: Unexpected packet read error]
OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch) +5643
OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch) +1381
OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword) +1583
Oracle.ManagedDataAccess.Client.OracleConnection.Open() +3837
OracleClientSpikeMvc.Controllers.HomeController.Oracle() +65
lambda_method(Closure , ControllerBase , Object[] ) +79
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +242
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +12
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +139
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +112
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +452
System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +15
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +37
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
/Home/Oracle
public ActionResult Oracle()
{
var connectionString = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=myservicename)));User Id=myuserid;Password=mypassword;";
var conn = new OracleConnection(connectionString);
conn.Open();
var command = conn.CreateCommand();
command.CommandText = "select sysdate from dual";
command.CommandType = System.Data.CommandType.Text;
var reader = command.ExecuteReader();
if (!reader.HasRows)
return Content("No rows returned");
reader.Read();
return Content(reader["sysdate"].ToString());
}
Error Message: ORA-12537: Network Session: End of file
ORA-12537: Network Session: End of file
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: OracleInternal.Network.NetworkException: ORA-12537: Network Session: End of file
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:
[NetworkException (0x30f9): ORA-12537: Network Session: End of file]
OracleInternal.Network.ReaderStream.ReadIt(OraBuf OB, Int32 len) +294
OracleInternal.Network.ReaderStream.ReadwithCrypto(OraBuf OB) +127
[NetworkException (0x80004005): ORA-12570: Network Session: Unexpected packet read error]
OracleInternal.Network.ReaderStream.ReadwithCrypto(OraBuf OB) +1188
OracleInternal.Network.ReaderStream.Read(OraBuf OB) +88
OracleInternal.TTC.OraBufReader.GetDataFromNetwork() +274
OracleInternal.TTC.OraBufReader.Read(Boolean bIgnoreData) +46
OracleInternal.TTC.MarshallingEngine.UnmarshalUB1(Boolean bIgnoreData) +16
OracleInternal.TTC.TTCProtocolNegotiation.ReadResponse() +86
[OracleException (0x80004005): ORA-12570: Network Session: Unexpected packet read error]
OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch) +5643
OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch) +1381
OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword) +1583
Oracle.ManagedDataAccess.Client.OracleConnection.Open() +3837
OracleClientSpikeMvc.Controllers.HomeController.Oracle() +65
lambda_method(Closure , ControllerBase , Object[] ) +79
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +242
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +12
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +139
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +112
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +452
System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +15
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +37
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
/Home/EntityFrameworkTest
This uses an EF Code-first context generated from the database:
public ActionResult EntityFrameworkTest()
{
using (var ctx = new MyContext())
{
var list = ctx.MyModel.OrderBy(m => m.MyField).ToList();
return View(list);
}
}
Error Message: Connection request timed out
Connection request timed out
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: Oracle.ManagedDataAccess.Client.OracleException: Connection request timed out
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:
[OracleException (0x80004005): Connection request timed out]
OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch) +5643
OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, String affinityInstanceName, Boolean bForceMatch) +1381
OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword) +1583
Oracle.ManagedDataAccess.Client.OracleConnection.Open() +3837
Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices.GetDbProviderManifestToken(DbConnection connection) +234
System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +118
[ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +459
System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +40
[ProviderIncompatibleException: An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file. See http://go.microsoft.com/fwlink/?LinkId=386386 for information on DbContext and connections. See the inner exception for details of the failure.]
System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection) +126
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +83
System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.ResolveManifestToken(DbConnection connection) +327
System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +118
System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +94
System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +248
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +543
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +26
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +72
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +64
System.Linq.Queryable.OrderBy(IQueryable`1 source, Expression`1 keySelector) +85
OracleClientSpikeMvc.Controllers.HomeController.Index() +282
lambda_method(Closure , ControllerBase , Object[] ) +79
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +242
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +12
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +139
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +112
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +452
System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +15
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +37
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
Web.config extracts
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
<connectionStrings>
<add name="MyContext" connectionString="DATA SOURCE=mydatasource;PASSWORD=mypassword;USER ID=myuserid" providerName="Oracle.ManagedDataAccess.Client" />
</connectionStrings>
<dependentAssembly>
<publisherPolicy apply="no" />
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
</dependentAssembly>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
What do we need to do to eliminate these errors and connect to the Oracle database from the server? Any and all help is much appreciated, thank you!
My pc windows 2012 server, 64 bit and oracle 12 c client is 32 bit. I am also using IIS. All options are done. I can access my web applications and getting data from database.
However, when I try to add something to database, it is giving error. It is not about tnsnames, connectionstring. The error is:
Exception Details: Oracle.DataAccess.Client.OracleException:
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:
[OracleException (0x80004005)] Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable) +1508
Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) +51
Oracle.DataAccess.Client.OracleConnection.Open() +5235
BMS.WebForm1.Button1_Click(Object sender, EventArgs e) +92
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9615682
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
Here is the Connection code
using Oracle.DataAccess.Client;
. . . . .
string oradb = "DATA SOURCE=bms;PASSWORD=training;USER ID=training;";
OracleConnection con = new OracleConnection(oradb);
con.Open();
MyMessageBox("connected!");
con.Close();
In my website, I tried to open a windows application (.exe) upon a button click. But it showing "Access is denied".
Stack trace:
[Win32Exception (0x80004005): Access is denied]
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) +614
System.Diagnostics.Process.Start() +56
ghs.btnTry_Click(Object sender, EventArgs e) in c:\inetpub\vhosts\ddrivestudio.com\httpdocs\tanishq\ghs.aspx.cs:19
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Button click event:
Process p = new Process();
p.StartInfo.FileName = Request.MapPath("~/App/App1.exe");
p.Start();
Hope the following links already have an answer.
Reference:
1.Which permissions are required to enable process.start via asp.net application?
2. Access is denied at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
I completely fail to get dotnetzip to add files to a .zip file
i can:
using (ZipFile zip = new ZipFile())
{
zip.AddEntry("test.txt", DateTime.Now.ToString());
zip.Save(Response.OutputStream);
}
This is completed correctly and produces a zip file for download that can be opned with the text file inside
Problem: Trying to add files like this:
zip.AddFile(Server.MapPath("/Files/test.txt"), "Files");
Always result in something like this:
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +61
System.IO.File.GetLastWriteTimeUtc(String path) +114
System.IO.File.GetLastWriteTime(String path) +24
Ionic.Zip.ZipEntry.Create(String nameInArchive, ZipEntrySource source, Object arg1, Object arg2) in c:\DotNetZip\Zip\ZipEntry.cs:2405
Ionic.Zip.ZipEntry.CreateFromFile(String filename, String nameInArchive) in c:\DotNetZip\Zip\ZipEntry.cs:2313
Ionic.Zip.ZipFile.AddFile(String fileName, String directoryPathInArchive) in c:\DotNetZip\Zip\ZipFile.AddUpdate.cs:406
Ionic.Zip.ZipFile.AddFile(String fileName) in c:\DotNetZip\Zip\ZipFile.AddUpdate.cs:296
MultiFileDownloader.WebForm1.Button1_Click(Object sender, EventArgs e) in D:\WORK\dynamicweb\StandardModules\MultiFileDownloader\Source\MultiFileDownloader\WebForm1.aspx.cs:54
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
System.Web.UI.Page.ProcessRequest() +80
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.webform1_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\ade7bc1a\c2b11481\App_Web_txhzteca.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Note: My code can read/create the files with no problem. IIS user (and everyone infact) have total permissions to the files in question. IIS 7.5, win2008r2
How can I grant the DotNetZip assembly the same rights?
Figured it out my self:
On application pool I set the Load User profile to true....problem solved. Guess the assembly was running without any user at all (not everyone, not anomnynous, not no one)
On these lines of code:
// Run compiler
Process p = System.Diagnostics.Process.Start("java.exe", ex);
p.WaitForExit();
We get this error:
Server Error in '/' Application.
Unknown error (0xfffffffe)
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.ComponentModel.Win32Exception: Unknown error (0xfffffffe)
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:
[Win32Exception (0x80004005): Unknown error (0xfffffffe)]
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) +912
System.Diagnostics.Process.Start() +136
System.Diagnostics.Process.Start(ProcessStartInfo startInfo) +49
Arcade.UploadFunctions.minifyC2Runtime(Int32 GameID) +333
Arcade.GameFunctions.createGame(Int32 CatID, String Name, String Description, String Instructions, Int32 UserId, Int32 Width, Int32 Height, Int32 ParentGameID) +1338
ArcadeSubmit.submitGame(Object sender, EventArgs e) +1329
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
As noted in my other question it would appear this is a permissions error. However, this error disappears if I recycle my app pool. It then starts throwing this error again within a couple of hours or so.
The apppool in question is running with LocalService identity. Anyone know what would be causing this to break?
Edit: More details error from event viewer
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2/29/2012 8:15:12 AM
Event time (UTC): 2/29/2012 8:15:12 AM
Event ID: 6b5770960c4f41b1a9ba10045b7b50d4
Event sequence: 131746
Event occurrence: 480
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT-26-129749512365140162
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\wwwroot\Scirra\
Machine name: WIN-MT04GJ7U5CB
Process information:
Process ID: 8276
Process name: w3wp.exe
Account name: NT AUTHORITY\LOCAL SERVICE
Exception information:
Exception type: Win32Exception
Exception message: Unknown error (0xfffffffe)
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Arcade.UploadFunctions.minifyC2Runtime(Int32 GameID)
at Arcade.GameFunctions.createGame(Int32 CatID, String Name, String Description, String Instructions, Int32 UserId, Int32 Width, Int32 Height, Int32 ParentGameID)
at ArcadeSubmit.submitGame(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Request information:
Request URL: http://www.scirra.com/ArcadeSubmit.aspx
Request path: /ArcadeSubmit.aspx
User host address: [censored]
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\LOCAL SERVICE
Thread information:
Thread ID: 5
Thread account name: NT AUTHORITY\LOCAL SERVICE
Is impersonating: False
Stack trace: at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Arcade.UploadFunctions.minifyC2Runtime(Int32 GameID)
at Arcade.GameFunctions.createGame(Int32 CatID, String Name, String Description, String Instructions, Int32 UserId, Int32 Width, Int32 Height, Int32 ParentGameID)
at ArcadeSubmit.submitGame(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Custom event details: