Free Support Forum - groupdocs.com

Getting Error while using Annotation with sql server


#1

Groupdocs.Web.Annotation.WidgetFactory.Initialize(this.Context, @"~/App_Data");

throws following exception

StructureMap configuration failures:

Error: 170
Source: Registry: StructureMap.Configuration.DSL.Registry, StructureMap, Version=2.6.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223
Unable to find the exported Type’s in assembly Groupdocs.Web.Annotation, Version=1.6.0.10603, Culture=neutral, PublicKeyToken=null. One or more of the assembly’s dependencies may be missing.

Could not load file or assembly ‘Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
File name: ‘Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at StructureMap.Graph.TypePool.<>c__DisplayClass2.<.ctor>b__0(Assembly assembly)

=== Pre-bind state information ===
LOG: User = DEV\spadmin
LOG: DisplayName = Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/
LOG: Initial PrivatePath = C:\Hiren_Examples\DocsAnnotation_GroupsDocs\DocsAnnotation_GroupsDocs\bin
Calling assembly : Groupdocs.Web.Annotation, Version=1.6.0.10603, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Hiren_Examples\DocsAnnotation_GroupsDocs\DocsAnnotation_GroupsDocs\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.EXE.



-----------------------------------------------------------------------------------------------------


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.Exceptions.StructureMapConfigurationException: StructureMap configuration failures:
Error: 170
Source: Registry: StructureMap.Configuration.DSL.Registry, StructureMap, Version=2.6.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223
Unable to find the exported Type’s in assembly Groupdocs.Web.Annotation, Version=1.6.0.10603, Culture=neutral, PublicKeyToken=null. One or more of the assembly’s dependencies may be missing.

Could not load file or assembly ‘Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
File name: ‘Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at StructureMap.Graph.TypePool.<>c__DisplayClass2.<.ctor>b__0(Assembly assembly)

=== Pre-bind state information ===
LOG: User = DEV\spadmin
LOG: DisplayName = Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/
LOG: Initial PrivatePath = C:\Hiren_Examples\DocsAnnotation_GroupsDocs\DocsAnnotation_GroupsDocs\bin
Calling assembly : Groupdocs.Web.Annotation, Version=1.6.0.10603, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Hiren_Examples\DocsAnnotation_GroupsDocs\DocsAnnotation_GroupsDocs\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.EXE.



-----------------------------------------------------------------------------------------------------




Source Error:

Line 14:         protected void Application_Start(object sender, EventArgs e)
Line 15: {
Line 16: Groupdocs.Web.Annotation.WidgetFactory.Initialize(this.Context, @"~/App_Data");
Line 17: Groupdocs.Web.Annotation.WidgetFactory.SetRootStoragePath(this.Context, Server.MapPath("~/TempDocument"));
Line 18: Groupdocs.Web.Annotation.WidgetFactory.SetLicensePath(@“C:\GroupDocs\License\GroupDocs.Annotation.for.NET.lic”);

Source File: C:\Hiren_Examples\DocsAnnotation_GroupsDocs\DocsAnnotation_GroupsDocs\Global.asax.cs Line: 16

Stack Trace:

[StructureMapConfigurationException: StructureMap configuration failures:
Error: 170
Source: Registry: StructureMap.Configuration.DSL.Registry, StructureMap, Version=2.6.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223
Unable to find the exported Type’s in assembly Groupdocs.Web.Annotation, Version=1.6.0.10603, Culture=neutral, PublicKeyToken=null. One or more of the assembly’s dependencies may be missing.

Could not load file or assembly ‘Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
File name: ‘Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at StructureMap.Graph.TypePool.<>c__DisplayClass2.<.ctor>b__0(Assembly assembly)

=== Pre-bind state information ===
LOG: User = DEV\spadmin
LOG: DisplayName = Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/
LOG: Initial PrivatePath = C:\Hiren_Examples\DocsAnnotation_GroupsDocs\DocsAnnotation_GroupsDocs\bin
Calling assembly : Groupdocs.Web.Annotation, Version=1.6.0.10603, Culture=neutral, PublicKeyToken=null.

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Hiren_Examples\DocsAnnotation_GroupsDocs\DocsAnnotation_GroupsDocs\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Users/spadmin/AppData/Local/Temp/2/Temporary ASP.NET Files/root/7d721b99/ec63b149/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Hiren_Examples/DocsAnnotation_GroupsDocs/DocsAnnotation_GroupsDocs/bin/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.EXE.


]
StructureMap.Diagnostics.GraphLog.AssertFailures() +105
StructureMap.Container.construct(PluginGraph pluginGraph) +491
StructureMap.Container…ctor(PluginGraph pluginGraph) +93
StructureMap.ObjectFactory.Initialize(Action`1 action) +188
Groupdocs.Web.Annotation.WidgetFactory.(HttpContext , String , String , Boolean ) +192
Groupdocs.Web.Annotation.WidgetFactory.Initialize(HttpContext context, String storagePath, String connectionString) +42
DocsAnnotation_GroupsDocs.Global.Application_Start(Object sender, EventArgs e) in C:\Hiren_Examples\DocsAnnotation_GroupsDocs\DocsAnnotation_GroupsDocs\Global.asax.cs:16



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.233

#2

Hello Hiren,

Thank you for your interest in GroupDocs. Actually, this exception is occurring because you have not added the reference to the Microsoft.WindowsAzure.Storage library, which is required by the GroupDocs.Annotation.

You can find this library along with all other required libraries in the “GroupDocs.Annotation C# Demos” package, in the “GroupDocs/bin” subfolder. All these libraries need to be present in the project.

BTW, there is no need to use the “Groupdocs.Web.Annotation.WidgetFactory.SetRootStoragePath”, because a root storage should be installed (and is installed in your case) by using the “Groupdocs.Web.Annotation.WidgetFactory.Initialize” method.

If you will have more questions please feel free to contact us.


#3

hi ,

after referencing Microsoft.WindowsAzure.Storage it still gives Exception.

#4

Hello Hiren,

We are sorry to hear that you have this issue. Are you sure that the exception is the same as in the previous time? Exact the same? Indicating that the Microsoft.WindowsAzure.Storage.dll cannot be found? Or some other file on this time?


#5

Hi,

thank you very much for your support ,issue has been resolved after referencing System.web.Mvc.
But now it says “there is no such reviewer” and than document opens without any annotation tools.
Also i have some questions which are ,
  • how to load document
  • how to display document loading window
  • annotation does not take specified height
  • how to load document form code behind
  • documents take too much time to load
thanks

#6

Hello Hiren,

We are sorry to hear that you have this issue.

1. This message means that you want to annotate the document using the user that is not assigned to this document. There can be several reasons of such situation, please specify which project are you using? Are you using the “Sample Demo” official package? Or it is your own project? If yes, please post a source code of the code-front and code-behind of a web-page, and we will review it and report all issues.
2. There is a button in the interface (2nd from left) - it has “arrow up” icon.
3. I’m sorry but what do you mean under “to display document loading window”? Can you please explain?
4. Please show us the example of this issue (screenshot will be Ok).
5. You should use the “FilePath” method in the Annotation widget (.Groupdocs().Annotation().ElementId(“annotation-widget”).FilePath(“filename.pdf”))
6. Loading time depends on many factors including specific document, hardware and software configuration etc. If you think that this delay is caused exactly by GroupDocs.Annotation, please send us the sample document for investigation.

Thanks and waiting for your reply.


#7

Hi,

=> how ti display progress bar while document is loading for annotation,progress bar appears in Viewer but not in Annotation.
=> Document takes to much time to load rather than Viewer
=> In following code i have load one jpg file with size of 254kb still it takes to much time to load.
=> in aspx page i have specified height and width but still it does not taking that specified height and width.
=> i am using Annotaion with sql sever 2008 R2.
=> Also getting warning “There is no such reviewer.” in pdf file and when i close warning document only opens in view mode not annotation tools. but works fine for jpg image.

Here i am attaching my sample code for annotation.

Global.asax

Groupdocs.Web.Annotation.WidgetFactory.Initialize(this.Context, @"~/TempDocument");
Groupdocs.Web.Annotation.WidgetFactory.SetLicensePath(@“C:\GroupDocs\License\GroupDocs.Annotation.for.NET.lic”);

Webform1.aspx

<%@ Page Language=“C#” AutoEventWireup=“true” CodeBehind=“WebForm1.aspx.cs” Inherits=“DocsAnnotation.WebForm1” %>

<%@ Import Namespace=“Groupdocs.Web.Annotation” %>


<%= new WidgetFactory().AnnotationScripts().UseHttpHandlers()%>
<%= new WidgetFactory()
.Annotation()
.ElementId(“annotation-widget”)
.FilePath(“Annotation_Error.jpg”)
.ZoomToFitWidth(true)
.Width(600)
.Height(500)
.Tools(AnnotationTools.All)
.ToHtmlString()
%>

Webform1.aspx.cs

public partial class WebForm1 : System.Web.UI.Page
{
private const string _filePath = “Annotation_Error.jpg”;

protected void Page_Load(object sender, EventArgs e)
{
var svc = ObjectFactory.GetInstance();
// To add Collaborator : svc.AddCollaborator(, , , , null);
// testuser@groupdocs.com is used as a username.
svc.AddCollaborator(_filePath, "testuser@groupdocs.com", “FirstName”, “LastName”, null);
}
}

web.config

<?xml version="1.0" encoding="utf-8"?>


<system.web>

</system.web>
<system.webServer>

</system.webServer>











#8

Hello Hiren,

Thank you for the providing the source code of the page. Now the reason of the issue is clear for us.

Take a look at the source code in the “Webform1.aspx.cs” code file. In the “Page_Load” method you add and assign a user to the document which should be displayed. This is not proper way for doing that. You can fix it in two ways:
1. Change the userID from “testuser@groupdocs.com” to the “groupdocs@groupdocs.com”. "groupdocs@groupdocs.com" is a name of the embedded “default” user, it is a some kind of dummy, fake user, designed to be used when you don’t want to specify a “real” user at all. In mostly cases "groupdocs@groupdocs.com" is used when you want to allow the anonymous annotating.
2. Another way is to add and assign a real user. Please find a “Default.aspx.cs” file in the “Groupdocs.Demo.Annotation.Webforms” project in the “Sample Demo” package. In this file in the “Page_Load” method you can see a correct way how to set up a user for annotations.

If you will have more questions please feel free to contact us.