Free Support Forum - groupdocs.com

Getting error The current type- Groupdocs.Web.UI.IRootPathFinder- is an interface and cannot be constructed. Are you missing a type mapping?


#1

Hello,


I am trying to use GroupDocs viewer in ASP.Net MVC project and getting the above mentioned error.

I have added the following to Global.asax

Viewer.InitRoutes();
Viewer.SetRootStoragePath(Server.MapPath("~/testfiles/"));
Viewer.EnableFileListRequestHandling(true);

Actually I am getting script errors. So I tried to load one of the script in browser and got the above error. I have tried to load the following

http://localhost:6022/document-viewer/GetScript?name=GroupdocsViewer.all.min.js

Attached screenshot.

Thanks

#2

Hello Naresh,


We are sorry to hear that you have such issue. Sorry but from your post is not clear how to reproduce the issue. Since that could yo please share with us additional info:
1. Version of the GroupDocs library that you use?
2. pipline mode of the solution?
3. IIS version?
4. GroupDocs.Viewer widget code (from the view)?
5. Does you have set in the web config?

Thank you.

#3

Thanks for replying.

1). 2.13
2). Running under Visual Studio
3). IIS Express
4).
5). Yes, I have that in my config

#4
Hi,

Thank you for the details. First of all please download and use the latest version of the library.

As for your code - sorry but you have shared not exactly what I asked for, I need such code or you can share with me the view and controller files.

Thank you.

#5

Thanks again for replying.


Upgraded to 2.17 but still getting errors. This time it’s a different one.

We are using Unity container in our application. Do we need to define any dependencies in config file. Error is pointing towards the missing type configurations.

Attaching screen shot of the error and code block.

Thanks.

#6

Hi again,


GroupDocs.Viewer doesn’t use the IoC-container-type such as Unity, StrakchurMap etc. Since that you can’t use them to manipulate or implement something for the Viewer. SInce that try to put the Viewer code and block out of the Unity container.

For example put the Viewer to another (where you will have only the Viewer code) HTML web page and embed it via iframe.

Best regards.

#7

Thanks again for replying.


Sorry, I don’t think I have understood your reply.

We are using Unity as part of our application and we are not using it to manipulate Viewer. In my previous reply, I was trying to explain the error.

Is Viewer can’t be used in the application where any Unity container is used?

thanks.

#8

Hi,


The Viewer can be used in such project. In my previous post I have tried to explain (sorry that was not clear) that you can use the Viewer but you can’t put it in to the Unity container (just in case you have such plans).

Also from your code I can see that you have missed such code lines:
1.@using Groupdocs.Web.UI
2. @Html.CreateViewerScriptLoadBlock().LoadJquery().LoadJqueryUi().UseHttpHandlers(false)
The first one should be added as the top code line and the second one should be placed in the head section or just above the viewer div.

If this will not help you - please share the project example and I will check and fix it for you.

Thank you.

#9

Hello,


I have created another sample ASP.Net MVC application.

It was running fine when there was no Unity container integrated. But after integrating with Unity, it’s throwing error.

Was not able to attach the source code. Uploaded to dropbox and you can find it here.

https://www.dropbox.com/s/nowkywck8bsozpp/GroupDocsSample.zip?dl=0

Thanks.

#10

Hi,


Thank you for the project example. Now I was able to reproduce your issue and unfortunately looks like it’s a bug in our library. We will resolve it and then come back to you.

Sorry for the inconvenience.

#11

Hello Pavel,


Thanks again.

Can I please check if there is any ETA for the reported issue to be resolved.

Thanks,
Naresh

#12

Hi Naresh,


Sorry but we doesn’t provide any ETA. I have attached Jira issue ticket to the first post so you can see it’s status. I will notify you when I get any news about the issue.

Best regards.

#13

Hi Naresh,


We have fixed your project. You can download it here . Please investigate it carefully for how to configure Unity.

Best regards.

#14

Thanks Pavel.


It’s working fine.

#15

Hi,


Thank you for the notification.

Best regards.