Hello,
I added GroupDocs.signature to my MVC project through NuGet. Then without making any other changes to my original project, it begin to throw and error when I run. I have copied the error below. Any idea why this happens? I am not calling any GroupDocs functions anywhere in the project.
"
Server Error in '/' Application.
Could not load file or assembly 'Groupdocs.Common.InstallableViewer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load file or assembly 'Groupdocs.Common.InstallableViewer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
If I add the following code to Global.asax then this error goes away.
GroupdocsSignature.Init(new GroupdocsSignatureSettings
//{
// RootStoragePath = Server.MapPath("~/App_Data/"),
// DatabaseProvider = new MsSqlProvder(System.Configuration.ConfigurationManager.ConnectionStrings["SignatureConnection"].ConnectionString),
// LicensePath = Server.MapPath("~/App_Data/GroupDocs.Signature.lic")
//});
However, I do not want to do this. What I would like to do is integrate the eSignature into one page in the project similar to what was done in http://groupdocs.comhttps://forum.aspose.com/t/274 . How did you "fix"
aradhanadave's code?
Hi,
Thank you for your request. To resolve your issue and achieve your goal simply move all code related to the GroupDocs.Signature to the appropriate controller, for example here is an code example of the action which will fire if to navigate to the “DocumentSignature” web page:
public ActionResult DocumentSignature()
{
GroupdocsSignature.Init(new GroupdocsSignatureSettings
{
RootStoragePath = Server.MapPath("~/App_Data/"),
DatabaseProvider = new MsSqlProvder(System.Configuration.ConfigurationManager.ConnectionStrings[“SignatureDb”].ConnectionString)
});
try
{
var document1 = FluentSignature.Document()
.FileName(“sample.pdf”)
.SignedFileName(“sample_signed1.pdf”)
.AddRecipient(FluentSignature.Recipient()
.AddField(FluentSignature.Field()
.Name(“Signature1”)
.Mandatory(true)
.LockDuringSign(false)
.Type(SignatureFieldType.Signature)
.AddLocation(FluentSignature.Location()
.Page(1)
.LocationWidth(150)
.LocationHeight(50)
.LocationX((decimal)0.400)
.LocationY((decimal)0.300)
)
)
)
.Create();
var signDocument = new SignDocument
{
DocumentGuid1 = document1.Guid,
RecipientGuid1 = document1.SignatureDocumentRecipients.First().Guid,
};
return View(signDocument);
}
catch (Exception ex)
{
throw ex;
}
Best regards.
Placing this code into a controller in the project does not fix the error. I still get:
Could not load file or assembly 'Groupdocs.Common.InstallableViewer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
I suspect that it might be related to the GroupDocs.Init() command not running? Does this command initialize dependencies such as GroupDocs.common.installableviewer? That may explain why the error does not occur when this code is in global.asax?
I don't understand why I get an error if I just add the dll to the project? It should be doing nothing since I do not use it anywhere.
Hi,
Thank you for coming back. Could you please share with me example of your project that I can found out what the issue reason and fix it.
Thank you.
Hi Pavel,
I would like to share, but we are using it in a proprietary produce. Perhaps we can arrange a support call? Our decision to purchase a license will be highly dependant on the fact of getting this working. I can forward you contact information if you provide your email.
-J
I was able to reproduce the error simply by creating a new MVC project in Visual Studio 2015 and installing GroupDocs from NuGet.
Download here:
Dropbox - WebApplication1.rar - Simplify your life
The API is not being used, so why am I getting an error for something that should not be running? If you uninstall GroupDocs.Signature in the NuGet package manager the application works fine.
-J
Thank you, I just made a request to download as kothar.017
-J
Thank you for this. I ran your code and it appears to work. But I would like to learn more since I am trying to integrate GroupDocs into a .NET framework 4.6.1 project.
What specific packages need to be targeted to .NET Framework 4.5.2? After looking at your code, I changed the targetFramework of GroupDocs-signature-dotnet to 4.5.2 in packages.config but am still getting the error. I changed the following line:
Hi,
regarding the issue reason - unfortunately I’m not sure why in your project you have this error, the project is strange - its can’t be started from the VisualStudio and also contains “Startup” class which is usually related to the self-hosted app. Since that I can assume that it was ported from the self-hosted app with errors. So I simply created new MVC project with the same framework version and all works well.
Since all new .NET Frameworks are backward compatible you should be able to use the library with the 4.6.1 version with out any additional libs.
Best regards.
Ok, maybe if I detail the exact process I used to make the project using Visual Studio 2015 Enterprise Edition it may help. There is no funny business going on in the way this project is created:
1) File>New>Project
2) Templates>Visual C#> Web> ASP.NET Web Application> OK
3) ASP.NET 4.5.2 Templates>MVC> OK
>> at this point the project can be run with no error
4) Tools> NuGet Package Manager> Manage packages for solution> Search and install GroupDocs-signature-dotnet
5) build>clean solution>build> build solution> run> ERROR
So actually in hindsight, the example code I gave you was in .NET4.5.2 from the beginning and the error still occurs. However, the production code project that I am looking to integrate GroupDocs into is in .NET 4.6.1.
I will need to solve this error in the example project that I posted in the forums earlier (post #7) since I am getting the same error in our production code, so it is likely the same problem.
-J
Sorry, I should have mentioned that the "startup.cs" is likely just due to me not checking the box to host the web application on Azure cloud when it was created.
However, our production code project is on azure cloud. It does not have "startup.cs" in the project and the error still occurs.
Hi Pavel,
I just wanted to know if you are still looking into this?
Our team had approved the purchase of this API pending a demonstration of integration with our project. If I am not able to get this working within the next 24h we will have to move on to an alternative API.
-J
Hi,
Sorry for the delay - investigated the issue. After several tests here what I have found out:
the issue reason is in Visual Studio 2015 - some how it causes all libraries, regardless of whether they are used in the code or not, when I created same application in the Visual Studio 2012 there were no such error. After that I have added Signature initialization code and the error gone.
Nevertheless I have prepared fully worked example project with Visual Studio 2015 and Framework 4.6.1 - you can download it
here. Simply the code to your project or add required functional to the example.
Best regards.
Hi Pavel,
Thank you for the updated solution. However the package you have posted here suffers from the object reference error discussed elsewhere in the forum:
http://groupdocs.com https://forum.aspose.com/t/274
If I click any of the links on the navigation bar of the website it throws the object reference error. Also, if I move the signature window to another view that is not Home/Index. The error is thrown as soon as I click any link on the page.
Unfortunately the continuous problems in getting a simple demo working has negatively impacted our decision to buy this API. We will likely revisit this in one year when our contract is up for renewal. Hopefully things will be fixed at that point.
-J
Hi,
Sorry for the delay. I have discussed this issue with our Product team and found out that the next generation Signature library will be released soon and the issue will be fixed in it. Since that the best way for you is to wait for this new library and then use it in your project. Unfortunately I can’t share any estimate for the release.
Please stay tuned with our updates and we will notify you when it will be available.
Best regards.