Visual Studio 2012 - Acess is Denied

Server Error in ‘/’ Application.

Could not load file or assembly ‘Aspose.Cells’ or one of its dependencies. Access is denied.
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.IO.FileLoadException: Could not load file or assembly ‘Aspose.Cells’ or one of its dependencies. Access is denied.

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.

Assembly Load Trace: The following information can be helpful to determine why the assembly ‘Aspose.Cells’ could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = Aspose.Cells
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Aspose.Cells | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper Best Practices for Assembly Loading - .NET Framework | Microsoft Learn for more information and common solutions to this issue.
LOG: Appbase = file:///C:/_VIP/DEV/2012/Reports Portal New/ReportsPortal/
LOG: Initial PrivatePath = C:_VIP\DEV\2012\Reports Portal New\ReportsPortal\bin
Calling assembly : (Unknown).

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:_VIP\DEV\2012\Reports Portal New\ReportsPortal\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/qga7053/AppData/Local/Temp/Temporary ASP.NET Files/vs/4a6b72b8/9102b571/Aspose.Cells.DLL.
LOG: Attempting download of new URL file:///C:/Users/qga7053/AppData/Local/Temp/Temporary ASP.NET Files/vs/4a6b72b8/9102b571/Aspose.Cells/Aspose.Cells.DLL.
LOG: Attempting download of new URL file:///C:/_VIP/DEV/2012/Reports Portal New/ReportsPortal/bin/Aspose.Cells.DLL.
LOG: Using application configuration file: C:_VIP\DEV\2012\Reports Portal New\ReportsPortal\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Aspose.Cells, Version=8.7.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56
ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing terminated.

Stack Trace:

[FileLoadException: Could not load file or assembly ‘Aspose.Cells’ or one of its dependencies. Access is denied.]

[FileLoadException: Could not load file or assembly ‘Aspose.Cells, Version=8.7.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. Access is denied.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly ‘Aspose.Cells, Version=8.7.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. Access is denied.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290
System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531

[HttpException (0x80004005): Could not load file or assembly ‘Aspose.Cells, Version=8.7.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. Access is denied.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946132
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +456

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1085.0

@Steven.Thelen,

Thanks for providing us stacktrace and details.

I guess your issue might be related to privileges, so you should check it and sort it out in your environment. Please note Aspose .NET components (including Aspose.Cells) are recommended to run with Full Trust permission set, see the document for your reference. This is because Aspose .NET component sometimes need to access registry settings and files located in places other than the virtual directory e.g. for reading fonts etc. Furthermore, Aspose .NET components are based on core .NET system classes, some of which also require Full Trust permission to run in some cases. You may evaluate permissions on your server.

Thank you.

The file share has full permissions and nothing is view Read-only. Could this issue be caused if I’m running .NET on a Virtual Machine? What about only have Office 2016 installed on this cpu… any known issues with Aspose and Excel 2016?

I only have Excel 2016… would I need older versions of Excel?

@Steven.Thelen,

Well, Aspose.Cells is an independent .NET component created in managed C#. Aspose.Cells does not need MS Office/Excel to be installed either on the server or on the client side, neither it uses any MS Office or automation or relevant APIs, see the document for your reference:

However, if you need to view the generated Excel file by Aspose.Cells, you may use MS Excel or any other spreadsheet viewer application.

Could you give me details, which Aspose.Cells assembly (Aspose.Cells.Dll) from which folder (@ your installation directory) you are using in your VS.NET project? Your may try to use your Aspose.Cells assembly (Aspose.Cells v8.7.x) from net4.0/net2.0 folder. Also, did you try using our latest version/fix: Aspose.Cells for .NET v17.7 (please use Aspose.Cells.Dll from net4.0 folder). Moreover, did you try using the project in some other machine (e.g some other pc, or developer machine, etc.)?

Furthermore, please take help and see the documents/threads and try to sort your issue accordingly (if possible):

https://forums.asp.net/t/1088939.aspx?Could+not+load+file+or+assembly+or+one+of+its+dependencies+Access+is+denied+

If you still find the issue, kindly create a simple sample project (runnable), zip it and post us here to show the issue, we will execute your VS.NET project to evaluate it.

Thank you.

Hi, have a new laptop and I’m trying to get C# .NET application locally running in VS 2013 (that does work for other developers).

I did try copying in Aspose.Cells.dll from the following folder “C:\Program Files (x86)\Aspose\Aspose.Cells for .NET\Bin\net4.0” and I still get the following error. I’ve installed Aspose.Cells for .NET 8.7.1.0… and I’m using license file “Aspose.Cells.lic” with the following info…

<?xml version="1.0" encoding="utf-8"?> HCA Tampa SSC JIM.CROUCH@PARALLON.COM Developer Small Business Limited to 1 developer. 141008124503 276379 This is not a redistributable license Aspose.Cells for .NET Enterprise 46bd73f7-c665-4a91-9083-d9ff4701e0b8 20151008 3.0 http://www.aspose.com/corporate/purchase/license-instructions.aspx qwXUUHPUW768N6Q5U162KcCnBMD2AHhd3bpBL7xU7lwhBnX7hzPcYch5bqto2ZZN5oT3HZ8335nBQx1wwB0jVF85vRv5LWs/cTkWKbjeThVokAJgIJD5M8BV/84PDJmUJPKhopZ5Eo3EbxhxYAmjQfgzXSSk6fnGIsHkXtLTCtk=

ERROR WHEN RUNNING…

Server Error in ‘/’ Application.

Could not load file or assembly ‘Aspose.Cells’ or one of its dependencies. Access is denied.
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.IO.FileLoadException: Could not load file or assembly ‘Aspose.Cells’ or one of its dependencies. Access is denied.

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.

Assembly Load Trace: The following information can be helpful to determine why the assembly ‘Aspose.Cells’ could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = Aspose.Cells
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Aspose.Cells | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper Best Practices for Assembly Loading - .NET Framework | Microsoft Learn for more information and common solutions to this issue.
LOG: Appbase = file:///C:/_VIP/Rick/Inetpub/wwwroot/EForms/Reports Portal New/ReportsPortal/
LOG: Initial PrivatePath = C:_VIP\Rick\Inetpub\wwwroot\EForms\Reports Portal New\ReportsPortal\bin
Calling assembly : (Unknown).

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:_VIP\Rick\Inetpub\wwwroot\EForms\Reports Portal New\ReportsPortal\web.config
LOG: Using host configuration file: F:\documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/qga7053/AppData/Local/Temp/Temporary ASP.NET Files/root/5522b677/a17c8912/Aspose.Cells.DLL.
LOG: Attempting download of new URL file:///C:/Users/qga7053/AppData/Local/Temp/Temporary ASP.NET Files/root/5522b677/a17c8912/Aspose.Cells/Aspose.Cells.DLL.
LOG: Attempting download of new URL file:///C:/_VIP/Rick/Inetpub/wwwroot/EForms/Reports Portal New/ReportsPortal/bin/Aspose.Cells.DLL.
LOG: Using application configuration file: C:_VIP\Rick\Inetpub\wwwroot\EForms\Reports Portal New\ReportsPortal\web.config
LOG: Using host configuration file: F:\documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Aspose.Cells, Version=8.7.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56
ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing terminated.

Stack Trace:

[FileLoadException: Could not load file or assembly ‘Aspose.Cells’ or one of its dependencies. Access is denied.]

[FileLoadException: Could not load file or assembly ‘Aspose.Cells, Version=8.7.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. Access is denied.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +21
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38

[ConfigurationErrorsException: Could not load file or assembly ‘Aspose.Cells, Version=8.7.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. Access is denied.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +738
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +290
System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531

[HttpException (0x80004005): Could not load file or assembly ‘Aspose.Cells, Version=8.7.1.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. Access is denied.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9925840
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1088.0

@Steven.Thelen,

Did you try the solutions (as we told you in my previous reply) mentioned in the documents/threads:

  1. Issue - Could not load file or assembly or one of its dependencies. Access is denied - I
  2. Issue - Could not load file or assembly or one of its dependencies. Access is denied - II

Also, could you provide us a simple sample project (runnable) to reproduce the issue on our end, you may zip it prior attaching here. We will run your project in our environment to investigate your issue.

Thank you.