Hi we have bought an Aspose.Total OEM license. we would like to wrapped the conversion function into an wrapper class for easier deployment to project which required to use the conversion function.
On one WindowFormApplication project, after referencing to the Aspose dlls and our custom wrapper dll, tried the embedded resources method to apply the license. it is working for Aspose.Word but for Aspose.Cells it throw an exception of FileNotFoundException.
Or is there a better way by packaging the license together with the custom dll?
Hi Benjamin,
Thank you for contacting Aspose support.
I have checked your presented scenario by creating a project of type class library and adding the license file as embedded resource. Then I used the following piece of code to access the license file and set it with Aspose.Cells for .NET API. I am afraid, I am not able to observe any problem in accessing/setting the license from embedded resource.
C#
Assembly _assembly;
Stream _stream;
try{
_assembly = Assembly.GetExecutingAssembly();
_stream = _assembly.GetManifestResourceStream(_assembly.GetName().Name + “.Aspose.Total.lic”);
if (_stream !=
null)
{
Aspose.Cells.License _license =
new Aspose.Cells.License();
_license.SetLicense(_stream);
}
}
catch (Exception)
{
throw;
}
I have also attached my test project here after removing the license file from it. Hope it helps in troubleshooting the problem on your end. In case the problem persists, please provide us an executable sample application (along with all dependencies & resources) to replicate the said issue. Please note, as your test project will contain your license file therefore please share it with us by following the instructions provided
here.
i cant seems to send you the email. keep receiving connection reset on my side… my internet connection is stable as i am able to surf other sites and this forum
Hi again.
I have just tested the “Send an email” feature, and it is working fine. Could you please retry again or switch to another browser? In case the problem persists, you can also upload the test project on your own server and share the download link via email (in case the problem is due to attachment size).
hi, i have sent you the email
Hi again,
I have received the email, however, there are no attachments. Could you please resend? Sorry for the inconvenience.
the file is too large to be send via email… i attached a link in the email to download the file
Hi,
I have checked the email again, and was not able to find any link. If you made some text the hyperlink, please simply paste the link in the next email message.
Hi Benjamin,
Thank you. I have downloaded the project and currently looking into it. I will shortly get back with updates in this regard.
Hi again,
Upon reviewing your sample application, I have noticed that you have added the license file (as embedded resource) to the WindowsFormsApplication project whereas accessing & setting the license in Converter class which is part of Utility project. If you add the license file in Utility project in same way as you have done for the WindowsFormsApplication project, your code will execute fine in licensed mode. I have updated the sample solution and shared the download link via an email. Once you have downloaded it, please confirm so I could remove it for privacy reasons.
hi i have tried and it works… thanks
but is there any way to add the license at embedded resource on windowsformapplication and access it on utility?
i planning for the scenario where any client who use this dll will need to have a valid license
Hi Benjamin,
Thank you for the confirmation. It is good to know that you are up & running again.
Regarding your recent inquiry, yes, it is possible to embed the license file in WindowsFormsApplication and set the license in class library, however, you have to make certain changes, such as follow.
- WindowsFormsApplication
- Embed the license file.
- Access the license file and convert it to Stream.
- Pass the Stream object to class library.
- Class Library
- Modify methods to receive Stream instead of string (license file name).
- Set the license from Stream.
In simple words, instead of passing the license file name to the convertFile & convert methods, you will be passing an instance of Stream containing the license, and set the license from it.
Let me know if you need me to send you the demonstration as suggested above.