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
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
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:
Remove folder D:\Temp
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.
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)?
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).
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
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:
from prebuilt version of app in “ConsoleApp1Release” folder
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
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
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.
Do I understand right that there is no issue with Aspose.Note under your PC with Windows 10?
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?
At the moment we still couldn’t reproduce the issue so we would like to know more details.
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”?
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)?
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.
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.
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.