This is the most frustrating problem cause it works in many cases, but not in 1 case for me.
This is all related to my web site, which reads in ms project files.
1. If I am working locally using visual studio 2008 it works just fine, no issues.
2. If i REMOTE DEBUG my web site, it works fine, no issues.
3. If I try to access my web site, I am getting read errors. Ie, it can’t read the file, it just pukes and returns nothing.
4. Spent a few days trying to figure out if it was me or the .dll
5. Finally figured it was v2.8.0.0.
6. Removed v2.8.0 and installed v2.7, and it works like it used to.
It almost seems like a security issue, and I say this because when I remote debug, it is running under my security model.
However, when it comes though IIS, it is a different user (NETSERVICES), and while permissions are there, something has clearly changed from v2.7.
Sorry I can’t be more specific, but something must have changed in your code from the 2 versions.
Hi,
Hi,
To check the issue I have created a simple console application:
using System;
using Aspose.Tasks;
using Aspose.Tasks.Util;
namespace TestDuration
{
class Program
{
static void Main(string[] args)
{
License license = new License();
license.SetLicense("Aspose.Tasks.lic");
ProjectReader reader = new ProjectReader();
Console.WriteLine(string.Format("Project's format: {0}.",
reader.ReadProjectFileInfo("Sample Project.mpp").ProjectFileFormat));
Project project = reader.Read("Sample Project.mpp");
ChildTasksCollector collector = new ChildTasksCollector();
TaskUtils.Apply(project.RootTask, collector, 0);
foreach (Task task in collector.Tasks)
Console.WriteLine(string.Format("Task '{0}' has duration '{1}'.", task.Name, task.Duration));
Console.WriteLine(project.GetType().Assembly.FullName);
ProjectWriter writer = new ProjectWriter();
writer.Write(project, "project.xml", TasksDataFormat.XML);
Console.ReadLine();
}
}
}
I have put the assembly in MyCodeGroup with two permissions only: execute and read/write access to disk D. If you don’t need to write the data the writing permission could be omitted as well.
And I still capable to run the application despite of the fact that the permission set does not allow me to debug it.
See screenshots attached.
Ok, here is more information for you:
1. Windows Server 2003 R2 x64 edition
2. IIS 6
3. Code to read file:
Dim license As New Aspose.Tasks.License
getProjTasks = New ds.projectTableDataTable
license.SetLicense(“Aspose.Tasks.lic”)
Dim fInfo As New FileInfo(fileLoc)
Dim ft As FileStream
If (Not fInfo.Exists) Then
myErrorMsg = “Unable to find file.”
Return Nothing
End If
Dim rdr As New ProjectReader
Dim proj As New Project()
Try
ft = New FileStream(fileLoc, FileMode.Open, FileAccess.Read)
proj = rdr.Read(ft)
Catch ex As Exception
myErrorMsg = ex.ToString
Return Nothing
End Try
4. Error message I am getting (note, Line 63 listed below is proj=rdr.read(ft))
System.AccessViolationException: Attempted to read or write protected memory.
This is often an indication that other memory is corrupt. at
x9d5a5f8cb1bea48a.x649397a477d1d1ed.x8a45cbf3f4b2c657(Calendar
xbe765e20f40b63d4, Byte[] x4a3f0a05c02f235f) at
x9d5a5f8cb1bea48a.x649397a477d1d1ed.x06b0e25aa6ad68a9(Calendar
xbe765e20f40b63d4, Hashtable x8f199855adaa4854, Byte[] x7201b70971f98378, Byte[]
xf9d37f33bce6fbd5, ArrayList xb1a5efd504c298ef) at
x9d5a5f8cb1bea48a.x591d41f772243d6b.x06b0e25aa6ad68a9(Project xb0108c8c2308c091,
Stream xcf18e5243f8d5fd3) at Aspose.Tasks.ProjectReader.Read(Stream stream) at
msProjectImporter.projReader.getProjTasks() in
E:\Bungie\Production\Tools\Projects\msProjectImporter\msProjectImporter\projReader.vb:line
63
Hi,
I should note, my files are all marked as READONLY when they are read via the web site. That might be the issue that is new, not sure.
All files that I have placed on the website and tried to read give me the same odd errors.
Did not occur with v2.7 - only with v2.8.
so something changed.
Hi,
Hi,
Now I am getting more errors:
Could not load file or assembly ‘Aspose.Tasks, Version=2.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
body {font-family:“Verdana”;font-weight:normal;font-size: .7em;color:black;}
p {font-family:“Verdana”;font-weight:normal;color:black;margin-top: -5px}
b {font-family:“Verdana”;font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:“Verdana”;font-weight:normal;font-size:18pt;color:red }
H2 { font-family:“Verdana”;font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:“Lucida Console”;font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
Server Error in '/' Application.
Could not load file or assembly 'Aspose.Tasks, Version=2.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
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.Tasks, Version=2.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
Line 40: End Try Line 41: Line 42: dt = projInfo.getStaffingInfo(True) Line 43: Session("ProjectInfo")=dt Line 44: If (IsNothing(dt)) Then |
Source File: E:\Bungie\Production\Tools\Projects\BTools\BTools\HR\hrStaffReports.aspx.vb Line: 42
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Aspose.Tasks, Version=2.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' could not be loaded.
WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. |
Stack Trace:
[FileLoadException: Could not load file or assembly 'Aspose.Tasks, Version=2.8.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] msProjectImporter.projReader.getProjTasks() +0 msProjectImporter.projReader.getStaffingInfo(Boolean showCurrent) +160 BTools.hrStaffReports.Page_Load(Object sender, EventArgs e) in E:\Bungie\Production\Tools\Projects\BTools\BTools\HR\hrStaffReports.aspx.vb:42 System.Web.UI.Control.OnLoad(EventArgs e) +132 System.Web.UI.Control.LoadRecursive() +66 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428 |
Hi,
I actually tried this version (2.8.0.2) ... it seems to load ok ... however, I needed to replace (remove and add) a reference to the new version. (in the My Project info).
HTH.
Regards, Bruce
Disregard my previous email it functions now.
Hi,
The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.