Hi
When I try to deploy a working website version of the solution (i.e. it does work both in VS and on our own published local IIS) to our client’s testing server I get the following error, which seems to be also related to StructureMap:
We solved this same 202 issue by installing MVC 2 and MVC 3. Also had to change the web.config so that it matched the web.config structure in your dev environment. We just changed the paths and connection strings accordingly.
Hello Robert,
We are sorry to hear that you have this issue.
1. GroupDocs.Annotation for .NET requires ASP.NET MVC ver 3 or higher to be installed in any way, regardless on what type of project you are using. Yes, this may be considered as a drawback, we know this issue, but in the near future it is unlikely that this dependency will be removed. So you need to have installed ASP.NET MVC on the machine where GroupDocs.Annotation is using.
2. It’s hard for me to define what exactly was changed when converting a project from Web Site Project (WSP) to Web Application Project (WAP) (am I correct?). But at first you need to check all references and all libraries that are required by GroupDocs.Annotation for .NET. You can find all of required libraries in the “GroupDocs.Annotation C# Demos” package, in the “bin” folder. Here they are. (Some of them are SQL Server Compact related so if you are using SQL Server standard they are not required.) All of this should be present, be accessible for the project and there are should be correct references. Please, check this out.
If you will have more questions please feel free to contact us.
Thank you dchambers. But MVC 4.0 is already running on our client’s webserver. Surely that should be enough. And now we are getting the following stack trace that says the requested .Net Framework Data Provider can not be found.
Unable to find the requested .Net Framework Data
Provider. It may not be installed. <o:p></o:p>
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.ArgumentException: Unable to find the requested
.Net Framework Data Provider. It may not be installed.
Source Error:
Line 16: |
Line 18: <%= LoadDocumentInViewer() %> Line 19: Line
20:
|
Source File: c:\inetpub\wwwProcess\One\OneMeetingPortal\DocumentViewer.aspx
Line: 18
Stack Trace:
[ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.] System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +253
[ArgumentException: The specified store provider cannot be found in the configuration, or is not valid.] System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +11441804 System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +575 System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName) +82 Groupdocs.Web.Annotation.[1].[1](IContext [1]) +133 StructureMap.Pipeline.LambdaInstance`1.build(Type pluginType, BuildSession session) +65
[StructureMapException: StructureMap Exception Code: 207 Internal exception while creating Instance '57c7c7eb-e752-4a10-9819-3cfc22a258c1' of PluginType Groupdocs.Data.ISaasposeDb, Groupdocs.Web.Annotation, Version=1.5.3.10477, Culture=neutral, PublicKeyToken=null. Check the inner exception for more details.] StructureMap.Pipeline.LambdaInstance`1.build(Type pluginType, BuildSession session) +224 StructureMap.Pipeline.Instance.createRawObject(Type pluginType, BuildSession session) +87 StructureMap.Pipeline.Instance.Build(Type pluginType, BuildSession session) +50 StructureMap.Pipeline.ObjectBuilder.Resolve(Type pluginType, Instance instance, BuildSession session) +147 StructureMap.BuildSession.CreateInstance(Type pluginType, Instance instance) +72 StructureMap.BuildSession.CreateInstance(Type pluginType) +23 StructureMap.Pipeline.Instance.createRawObject(Type pluginType, BuildSession session) +87 StructureMap.Pipeline.Instance.Build(Type pluginType, BuildSession session) +50 StructureMap.Pipeline.ConstructorInstance.Get(String propertyName, BuildSession session) +86 |
Hi Denis
Hello Robert,
Because several issues are raised and discussed here, I’ll follow them step by step.
1. About ASP.NET MVC. Yes, as I said before, GroupDocs.Annotation for .NET requires ASP.NET MVC ver 3 or above to be installed. We successfully tested it with MVC 3, 4 and 5. But this doesn’t mean that GroupDocs.Annotation will automatically find available System.Web.Mvc and will use it. As any other .NET assembly that is used in the Visual Studio project, GroupDocs.Annotation uses the version which is specified in the References of the project. So, if in your project the reference is pointing to the System.Web.Mvc.dll version 3.0.0.0, but you have installed only MVC 4, this will not be working. Also you need to check the web.config because in WSP all assemblies are usually specified in the configuration->system.web->compilation->assemblies, for example . If you have MVC 3 project, but want to use MVC 4, I can suggest to use this article: ASP.NET MVC 4. Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4.
2. Libraries sqlceca40.dll, sqlcecompact40.dll, sqlceer40EN.dll, sqlceme40.dll, sqlceoledb40.dll, sqlceqp40.dll, sqlcese40.dll and System.Data.SqlServerCe.Entity.dll are not classic .NET assemblies and you cannot add the references to them. They are required only when you are using SQL Server Compact - you need to add them to the “bin” folder so GroupDocs.Annotation will be able to find and use them in the real-time. I was talking about all others assemblies which are required and should be referenced:
DocumentFormat.OpenXml.dll
Microsoft.AspNet.SignalR.Core.dll
Microsoft.AspNet.SignalR.Owin.dll
Microsoft.AspNet.SignalR.SystemWeb.dll
Microsoft.Owin.Host.SystemWeb.dll
Owin.dll
3. The core reason of all of these errors I see in the phrase “our solution with Groupdocs.Annotations works fine with Visual Studio on the built in server and when published to IIS locally”. If you are able to run Groupdocs.Annotations on local IIS without errors, and errors occur on remote machine, then that means that IIS on remote machine is configured improperly, or there is a lack of some required libraries. I think that “Unable to find the requested .Net Framework Data Provider” exception is also related to this reason.
In fact, I don’t know exact configuration of your client’s remote machine, so I cannot give you an exact advice like what exactly you need to do in order to make it work. You need to compare your own machine’s configuration with remote machine and find that difference, which is the reason of these errors. From my side I can say that GroupDocs.Annotation is 100% compatible with IIS; for example, here we have Annotation 1.6 running on IIS 7.5.
Waiting for your feedback.
oh, and I was just told that our client had installed MVC version 4.0 so I checked again and we still get this error. You said that we need MCV version 3 and up, right?:
Hi Denis
Hello Robert,
I’m glad that all major issues were resolved. About StructureMap 202: have you checked a trust level on remote IIS web-server, as I mentioned in my last post at this thread?
Hi Denis
Hello Robert,
Got it. Please try one more thing.
Instead the
IAnnotationService svc = StructureMap.ObjectFactory.GetInstance();
Please use the next block of code, which performs the same but without StructureMap:
using Groupdocs.Annotation;
using Groupdocs.Api.Contract;
using Groupdocs.Common;
using Groupdocs.Core;
using Groupdocs.Data;
using Groupdocs.Data.MsSql.Account;
using Groupdocs.Data.MsSql.Annotation;
using Groupdocs.Web.Annotation.Security;
using Groupdocs.Web.Annotation.SignalR;
using Groupdocs.Web.Annotation.Utils;
using AnnotationService = Groupdocs.Web.Annotation.AnnotationService;
using IAnnotationService = Groupdocs.Web.Annotation.IAnnotationService;
.........
.........
ISaasposeDb i1 = new SaasposeDb(System.Configuration.ConfigurationManager.ConnectionStrings["SaasposeDb"].ToString());
AuthenticationService au_ser= new AuthenticationService();
AnnotationBroadcaster ab = new AnnotationBroadcaster(new AnnotationHub(au_ser));
UserService u_ser = new UserService(new UserRepository(i1));
Annotator ann = new Annotator(
u_ser,
new AnnotationSessionService(new AnnotationSessionRepository(i1)),
new Groupdocs.Core.AnnotationService(new AnnotationRepository(i1)),
new AnnotationReplyService(new AnnotationReplyRepository(i1)),
new AnnotationCollaboratorService(new AnnotationCollaboratorRepository(i1)),
new AnnotationLayerService(new AnnotationLayerRepository(i1))
);
Groupdocs.Web.Annotation.AnnotationService asvc = new AnnotationService(ab, au_ser, u_ser, ann);
asvc.AddCollaborator(...........);
And then trace where the exception will raise and will it raise at all.
Thanks. Waiting for your response.
Hi Denis
StructureMap Exception Code: 202
No Default Instance defined for PluginFamily Groupdocs.Web.Annotation.Security.IAuthenticationService, Groupdocs.Web.Annotation, Version=1.5.0.10317, Culture=neutral, PublicKeyToken=null
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: StructureMap.StructureMapException: StructureMap Exception Code: 202
No Default Instance defined for PluginFamily Groupdocs.Web.Annotation.Security.IAuthenticationService, Groupdocs.Web.Annotation, Version=1.5.0.10317, Culture=neutral, PublicKeyToken=null
Hello Robert,
Thanks for the additional info. I need you to try/investigate one more thing. I’ve discussed all of these with GroupDocs.Annotation developers intensively, and here is a couple of thoughts/suggestions:
1. GroupDocs.Annotation contains and internally uses StructureMap. The described situation may occur when you are trying to open a document before GroupDocs.Annotation was initialized. Please check where do you have a
and are you sure that it is invoked before all other GroupDocs.Annotation-related code?
IAnnotationService svc = StructureMap.ObjectFactory.GetInstance();
Just try to open GroupDocs.Annotation-related web-page without these two lines of code. What you will see? Will there be GroupDocs.Annotation GUI, or document too, or some messages/errors, or exception?
Thanks. Waiting for your response.
Hello Denis
Hello Robert,
Thanks for the immediate answer. Now the reason of this error is absolutely clear. “WidgetFactory.Initialize” method initializes StructureMap bindings inside the GroupDocs.Annotation, so that’s why you have this exception.
There might be different reasons why “Application_Start” method is not firing. I’ve found a lot of different QA, notes and articles which are related to this widespread problem. But at first want you to check do you have a in the web.config.
In any case, this is not an irresistible issue. “WidgetFactory.Initialize” method doesn’t require to be called especially from the Global.asax. Actually, you can call it wherever and whenever you want, the only requirement - this initialization should be done before the first use of the all other GroupDocs.Annotation-related stuff.
If you will have more questions please feel free to contact us.
Hi Denis