Unable to open document Onenote 2016

Your command feeds package for project.
It doesn’t install it to local NuGet package source.

To install it NuGet.exe is required: NuGet Gallery | Downloads
The command:

nuget add Aspose.Note_21.5.1.nupkg -Source D:\temp

After that everything should be fine:
PM> Install-Package Aspose.Note -Version 21.5.1 -Source D:\Temp

Attempting to gather dependency information for package 'Aspose.Note.21.5.1' with respect to project 'ConsoleApp1', targeting '.NETFramework,Version=v4.7.2'
Gathering dependency information took 2 ms
Attempting to resolve dependencies for package 'Aspose.Note.21.5.1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Aspose.Note.21.5.1'
Resolved actions to install package 'Aspose.Note.21.5.1'
Retrieving package 'Aspose.Note 21.5.1' from 'Aspose.Local'.
Adding package 'Aspose.Note.21.5.1' to folder 'D:\Work\Aspose\src\app\notenet3314\ConsoleApp1\packages'
Added package 'Aspose.Note.21.5.1' to folder 'D:\Work\Aspose\src\app\notenet3314\ConsoleApp1\packages'
Added package 'Aspose.Note.21.5.1' to 'packages.config'
Successfully installed 'Aspose.Note 21.5.1' to ConsoleApp1
Executing nuget actions took 2,58 sec
Time Elapsed: 00:00:02.9815308

Ok for the first command if I execute it in d:\temp

D:\Temp>nuget add Aspose.Note_21.5.1.nupkg -source D:\Temp
Installed Aspose.Note 21.5.1 from with content hash Vxjt80sKWKSW8SzznPxkUiPBvj8eU8X6G/e7SJxMD0r4yKUtbHWdaEqpblLmCN2cJnO5MAHLJHjiCPoUH6zkvA==.
Successfully added package ‘Aspose.Note_21.5.1.nupkg’ to feed ‘D:\Temp’.

D:\Temp>

Problem comes after:

PM> Install-Package Aspose.Note -Version 21.5.1 -Source D:\Temp

Attempting to gather dependency information for package ‘Aspose.Note.21.5.1’ with respect to project ‘newTestAsposeOne’, targeting ‘.NETFramework,Version=v4.7.2’
Install-Package : Package ‘Aspose.Note 21.5.1’ is not found in the following primary source(s): ‘D:\Temp’. Please verify all your online package sources are available (OR) package id, version are specified correctly.
At line:1 char:1

  • Install-Package Aspose.Note -Version 21.5.1 -Source D:\Temp
  •   + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
      + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
    
    

Time Elapsed: 00:00:00.3215555
PM>

Other erroor:
[Ici] ‘D:\Temp__MACOSX._Aspose.Note_21.5.1.nupkg’ is not a valid nupkg file. Error: ‘The file is not a valid nupkg. File path: D:\Temp__MACOSX._Aspose.Note_21.5.1.nupkg’.
The file is not a valid nupkg. File path: D:\Temp__MACOSX._Aspose.Note_21.5.1.nupkg
End of Central Directory record could not be found.

I googled regarding this error but there is a lack of information about this issue.
The common recommended steps:

  1. Remove folder D:\Temp
  2. Tools - Options - NuGet Package Manager - General - Clear All NuGet Cache(s)

If these steps won’t succeed then what do you think regarding trying of workaround with manual extracting of Aspose.Note from NuGet package?

Other erroor:
[Ici] ‘D:\Temp__MACOSX._Aspose.Note_21.5.1.nupkg’ is not a valid nupkg file. Error: ‘The file is not a valid nupkg. File path: D:\Temp__MACOSX._Aspose.Note_21.5.1.nupkg’.
The file is not a valid nupkg. File path: D:\Temp__MACOSX._Aspose.Note_21.5.1.nupkg
End of Central Directory record could not be found.

What is the path? Does it really exist?

Hello,
Path is “D:\Temp__MACOSX”
As .nupkg are .zip file, I renamed the file “._Aspose.Note_21.5.1.nupkg” in this folder in .zip.
The uncompress give me an error.
Package corrupted?
Wich .dll must I take to manually extract from the package (for .net 4.7.2 ou .net 4.8)?

@PhHElia,

First, you may change folder and search options to disable “Hide extensions for known file types” option under “Folder|View” tab in the file explorer. Now extract the downloaded zipped archive “Aspose.Note_21.5.1.nupkg.zip”. Then rename the extracted file “Aspose.Note_21.5.1.nupkg” to “Aspose.Note_21.5.1.zip” manually. Now you will have all the files. Browse to “\lib\net4.0” and use the Dll (by manually add reference to your project).

  1. I use the following program to extract content of NuGet package: GitHub - NuGetPackageExplorer/NuGetPackageExplorer: Create, update and deploy Nuget Packages with a GUI
  2. I uploaded zip-archive with Aspose.Note libraries: Dropbox - Aspose.Note_21.5.1.zip - Simplify your life.

Referenced directly the extracted dll.

System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for ‘Aspose.Note.Fonts.DocumentFontsSubsystem’ threw an exception.
Source=Aspose.Note
StackTrace:
at Aspose.Note.Fonts.DocumentFontsSubsystem.get_Default()
at Aspose.Note.Document.()
at Aspose.Note.RichText.(String )
at Aspose.Note.RichText.set_Text(String value)
at .​ ​()
at .​ ​()
at .​ ​()
at .​ ​()
at .​ ​()
at .​ ​()
at .()
at .​ ​()
at .(Stream , Document , LoadOptions )
at Aspose.Note.Document.(String , LoadOptions )
at Aspose.Note.Document…ctor(String filePath, LoadOptions loadOptions)
at Aspose.Note.Document…ctor(String filePath)
at newTestAsposeOne.Program.Main(String[] args) in D:\test\newTestAsposeOne\newTestAsposeOne\Program.cs:line 21

Inner Exception 1:
InvalidDataException: It seems stream contains non TrueType font.

Inner Exception 2:
InvalidDataException: AddFontInternal: failed to load provided data as font. Last error code: 0


From the console:

AddFontInternal: Marshal.AllocCoTaskMem(1 * 149064) -> 88293240
AddFontMemResourceExWrapper start
AddFontMemResourceExWrapper end: 0
AddFontMemResourceExWrapper end: 0
AddFontInternal: Marshal.AllocCoTaskMem(1 * 149064) -> 88293240
AddFontMemResourceExWrapper start
AddFontMemResourceExWrapper end: 0
AddFontMemResourceExWrapper end: 0

Thanks!

It looks like something strange happens within a call of Win32 API function AddFontMemResourceEx.
But for some unknown reason GetLastError function says everything is fine.

It would be great to get a help from you one more time.

I prepared a new sample app with new debug version of Aspose.Note.
An archive contains “ConsoleApp1” folder with Visual Studio solution and “ConsoleApp1Release” folder with the same prebuilt app.

Can you gather two logs:

  1. from prebuilt version of app in “ConsoleApp1Release” folder
  2. by building solution in “ConsoleApp1” folder and running built app
    ?
    notenet3314.zip (4.8 MB)

Result from the built of ConsoleApp1
D:\ConsoleApp1\bin\Debug>ConsoleApp1.exe > ConsoleApp1.txt

Unhandled Exception: System.TypeInitializationException: The type initializer for ‘Aspose.Note.Fonts.DocumentFontsSubsystem’ threw an exception. —> System.IO.InvalidDataException: It seems stream contains non TrueType font. —> System.IO.InvalidDataException: AddFontInternal: failed to load provided data as font. Last error code: 0
at Aspose.Note.Fonts.FontsSubsystem.(Stream )
— End of inner exception stack trace —
at Aspose.Note.Fonts.FontsSubsystem.(Stream )
at Aspose.Note.Fonts.FontsSubsystem…ctor(Stream defaultFont, Dictionary`2 fontsSubstitutions)
at ?..ctor(Stream )
at ?..ctor()
at ?.()
at Aspose.Note.Fonts.DocumentFontsSubsystem…cctor()
— End of inner exception stack trace —
at Aspose.Note.Fonts.DocumentFontsSubsystem.get_Default()
at Aspose.Note.Document.()
at Aspose.Note.RichText.(String )
at Aspose.Note.RichText.set_Text(String value)
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.()
at ?.? ??()
at ?.(Stream , Document , LoadOptions )
at Aspose.Note.Document.(String , LoadOptions )
at Aspose.Note.Document…ctor(String filePath, LoadOptions loadOptions)
at Aspose.Note.Document…ctor(String filePath)
at ConsoleApp.Program.Main(String[] args) in D:\ConsoleApp1\Program.cs:line 71

D:\ConsoleApp1\bin\Debug>
ConsoleApp1.zip (530.7 KB)

Result from release

D:\ConsoleApp1Release>ConsoleApp1.exe > ConsoleApp1Release.txt

Unhandled Exception: System.TypeInitializationException: The type initializer for ‘Aspose.Note.Fonts.DocumentFontsSubsystem’ threw an exception. —> System.IO.InvalidDataException: It seems stream contains non TrueType font. —> System.IO.InvalidDataException: AddFontInternal: failed to load provided data as font. Last error code: 0
at Aspose.Note.Fonts.FontsSubsystem.(Stream )
— End of inner exception stack trace —
at Aspose.Note.Fonts.FontsSubsystem.(Stream )
at Aspose.Note.Fonts.FontsSubsystem…ctor(Stream defaultFont, Dictionary`2 fontsSubstitutions)
at ?..ctor(Stream )
at ?..ctor()
at ?.()
at Aspose.Note.Fonts.DocumentFontsSubsystem…cctor()
— End of inner exception stack trace —
at Aspose.Note.Fonts.DocumentFontsSubsystem.get_Default()
at Aspose.Note.Document.()
at Aspose.Note.RichText.(String )
at Aspose.Note.RichText.set_Text(String value)
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.? ??()
at ?.()
at ?.? ??()
at ?.(Stream , Document , LoadOptions )
at Aspose.Note.Document.(String , LoadOptions )
at Aspose.Note.Document…ctor(String filePath, LoadOptions loadOptions)
at Aspose.Note.Document…ctor(String filePath)
at ConsoleApp.Program.Main(String[] args) in D:\Work\Aspose\src\app\notenet3314\ConsoleApp1\Program.cs:line 71

D:\ConsoleApp1Release>
ConsoleApp1Release.zip (530.7 KB)

Hi!

Thanks for the logs.
I have investigated them but it is hard to detect the reason of fail.
For some unknown reason call of AddFontMemResourceEx fails.

Also can you clarify what do you mean by saying:

Some information on the environment used:

  • My dev. computer is a Window server 2016 with VS 2017
  • The target computer will be, if I can read the files, an IIS server

I tested the following:
From my pc, I copied the directory windows/fonts to my dev. computer and installed it. Always the same problem.

What is the difference between your PC and dev. computer?

My PC is a Windows 10 1909, with Onenote installed.
My dev. computer is a Windows Server 2016 with Visual Studio 2017 (not very standard), without Onenote.
The target system will be an ISS server on Windows server 2016.

Thanks for clarification.

A few more questions:

  1. Do I understand right that there is no issue with Aspose.Note under your PC with Windows 10?
  2. Can you clarify regarding dev. computer with Windows Server 2016: is it a real computer with Windows Server 2016 installed or a machine in cloud service like Azure?

Program (my test, I did’nt try your version) works well on my PC.
My dev. machine is a virtual computer on VMWARE (local esx server)

Thanks.

What is the version of VMWARE you use?

Version is ESXI 6.7

Hi!

Sorry for the delay.

At the moment we still couldn’t reproduce the issue so we would like to know more details.

  1. You mentioned that your dev. computer is a Windows Server 2016 with Visual Studio 2017 (not very standard). What do you mean by “not very standard”?
  2. Can you specify what service packs or patсhs are installed over the clean installation of Windows Server 2016 standard (Version 10.0.14393 Build 14393)?
  3. Are there any special settings that can affect system behavior? Especially, GDI/GDI+ subsystem.

We tested the sample app under Windows Server 2016 in Docker container and in VirtualBox. No issues.
So it would be good to know if it is acceptable for you to use this virtualization technologies to test app?

Also we would like to know if you decided what environment to use for production(AWS/etc)?
We can check if the issue is persisted there when running sample app in this environment.

Thanks.

Hello,
Sorry for the delay.

  1. Not very standard, because VS2017 is installed on a server and not on a workstation.
  2. systeminfo in attachment
  3. I don’t think.

Production server will also be a Windows server 2016 with IIS
system.zip (1.3 KB)

@PhHElia,
Thank you for the feedback. We have noted it for our reference.

Hello!

Sorry for the delay.

We made some investigations and have a potential fix for the problem.
We prepared a special build of Aspose.Note for .NET 21.9.1.
It would be great if you verify that this version works within your app.

Thanks!

Hello,

Sorry, I can’t test the package.
I downloaded it, but I have the following error.
D:\Temp>nuget list -source Aspose.Note_21.9.1.nupkg
The specified source ‘Aspose.Note_21.9.1.nupkg’ is invalid. Please provide a valid source.

Regards