Error compiling viewer for .NET MVC app 1.5.0

Hi, I’m trying to compile the new solution, but I still have this problem:

This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see Troubleshooting NuGet Package Restore in Visual Studio | Microsoft Learn. The missing file is D:\TEMP\GroupDocs.Viewer-for-.NET-MVC-App-1.5.0\GroupDocs.Viewer-for-.NET-MVC-App-1.5.0\.nuget\NuGet.targets. Viewer-Modren-UI D:\TEMP\GroupDocs.Viewer-for-.NET-MVC-App-1.5.0\GroupDocs.Viewer-for-.NET-MVC-App-1.5.0\Viewer-Modren-UI\Viewer-Modren-UI.csproj 186

I try to click “Restore nuget packages”, but without success.

Can you help me?
Thank you

@gianboscolo,

Thanks for using GroupDocs.Viewer and sharing your concerns with us.

We are able to reproduce this issue at our end and it happens because of compatibility issue of the solution with the version of Visual Studio. We have logged this issue at our end as: https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET-MVC-App/issues/26.

As a quick workaround, you may try the following to get this issue fixed:

  • Edit Viewer-Modren-UI.csproj file
  • Remove < Target Name=“EnsureNuGetPackageBuildImports” BeforeTargets=“PrepareForBuild”> section (see this)
  • Save the file and reload in Visual Studio

Hope it helps.

Hi, I’ve tried it and it worked.
Another question, I’m trying with my license (that I use with the old viewer), but I still have this message on screen “Unlicensed version of GroupDocs.Viewer for .NET allows 15 views per hour.”
I’ve opened the license file and I found this tag:

<SubscriptionExpiry>20180109</SubscriptionExpiry>

Has my license really expired?

Or can you at least provide me a temporary license for testing?
The limitation on the number of pages and the number of views per hour is very limiting for me and I can not evaluate if this new viewer it’s made for us.
Otherwise we should think about changing our provider for file viewing.

Thanks.

@gianboscolo,

Thanks for your response.

Yes, your subscription has been expired and therefore, you are not eligible to get the updates that are released after 9th January 2018. To renew your license, please visit here.

Yes, you can also get a temporary license to evaluate all the features of the API without any evaluation limitations. To post your request for a temporary license, please visit here.

Ok, thank you. Soon I’ll try with a temporary license.
Another question, forgive me.
I have to test it using iis on local server, instead of iis express, but I can not make it work. Is there anything special to do?

Thank you.

@gianboscolo,

Thanks for your response.

There is nothing special required when publishing the application to IIS. You just need to assign the required permissions to the application pool for the storage folder that is being used to keep the source/input documents. Furthermore, if you are using the license in the application, you will have to set the permissions for the license file as well. You can also check that you have set the correct version of .NET framework (same version that is used to build the application) in the application pool settings. Hope it helps.

Well, I also had to change the references in order to point to the site name and I have to modify CreateViewerConfig method on Utils.cs

 public static ViewerConfig CreateViewerConfig()
          {
              ViewerConfig cfg = new ViewerConfig
              {
                  StoragePath = _storagePath,
                  CachePath = _cachePath,
                  UseCache = true,
                  PageNamePrefix = "localhost"
              };
              return cfg;
          }

, adding PageNamePrefix, but I still have problems with attachments
These errors appear in the browser console:
image.png (11.3 KB)

Can you tell me how to solve this problem?

Thanks

@gianboscolo,

Thanks for sharing your issue with us.

You will have to update the HtmlResourcePrefix in the AttachmentHtmlController.cs as well and prepend site name as shown in the following sample.

o.HtmlResourcePrefix = "/{your_site_name}/Attachment/Resource?file=" + file + "&attachment=" + attachment + "&page=" + page + "&resource=";

Hope it helps.

Nope, still get the same error. The file that I’m trying to view is an eml with a xml and a pdf as attachments.

Thanks.

@gianboscolo,

Thanks for your response.

In that case, please share with us the sample eml file. Also, it would be helpful if you share with us the source code of the application with the modifications you have done at your end.

I cannot upload the project I modify to run with iis server, how can I send it to you?
Anyway inside the folder App_Data there is the eml file, but it isn’t the original file, because I cannot share it with you for privacy problems.
This file, however, has this type of problem shown in console:
GET http://localhost/page/resource?file=provainvio3.eml&page=1&resource=/styles.css 404 (Not Found)

Thanks

@gianboscolo,

Thanks for your response.

You can either upload the project directly using upload option in the toolbar or share it via other storages such as Google Drive. In either way, please make sure that you have deleted the bin folder to reduce the size before uploading.

If possible you can share the document with me in a private message (see how to send private message). Otherwise, you can create a sample eml file that can help to reproduce the issue and share that with us.

GroupDocs_ASP_.NET_MVC_Document_Viewer_App_v1.5.0_Forum.zip (286.8 KB)
Here is the project. As I told you I can not send the file for privacy issues. The file that I have included in the App_Data folder, however, returns a similar error, with the problem of loading resources, maybe if you can find a solution to that problem, then I can understand how to solve the problem of the other file.

Thanks

@gianboscolo,

Thanks for providing the source code.

We are able to reproduce your reported issue in your provided source code (see this). However, it was fixed when prepending the site name in the HtmlResourcePrefix in PageHtmlController.cs (see this. Furthermore, we have also commented out PageNamePrefix = “localhost” in ViewerConfig. You can download the updated source code from here. Hope it helps.

Yeah, ok. Now that file is displayed, but with this configuration, other files are not displayed. For example your calibre.docx, when I try to display it, I get:
image.png (4.8 KB)
Is not there a way to configure to view all the files?

Thanks

@gianboscolo,

Thanks for your response.

The way I have mentioned in the previous post will work for all the supported file formats and there is no specific configuration for each file format. Furthermore, we have verified your scenario using your provided application and all the files including calibre.docx are displayed without any issue (see below screenshots).

Please remove the files from the cache folder (…\App_Data\cache) of the application and try to open the documents again. Hope it helps.

Ok, actually deleting cache helped. Now I don’t have problems with resources.
Now we are trying the viewer with other types of files, specially eml, and we encountered a problem
image.png (113.8 KB)
with this file:
pergroupdocs111.zip (47.6 KB)

Before moving on to this new version, we should understand if we can see these types of files …

Thanks

@gianboscolo,

Thanks for your response and sharing your concerns.

We investigated your reported issue at our end and found that your provided eml file has corrupted PDF attachments (see this). When the API tries to render or get info of the corrupted document, it throws the exception “Could not load file ‘xyz’, file is corrupted or damaged.”. You can also check the details of the exception by opening http://localhost/Viewer-Modren-UI/document/info?file=pergroupdocs111.eml in the browser (as shown here).

Currently, the application doesn’t have the feature to handle and display the exception messages and therefore, you are getting the 500 (Internal Server Error) in the console of the browser. However, we have logged it as an enhancement in our GitHub issues as Implementation of feature to display error/exception messages · Issue #27 · groupdocs-viewer/GroupDocs.Viewer-for-.NET-MVC-App · GitHub. As the application is open source, you can also modify it to handle the exception by putting the code in a try block and display the exception message in the front end application.