We have a licensed version of the Aspose.Net email libraries. We have been using version 5.4 in our product which includes a number of unit tests. We recently decided to update the Aspose library to 5.9. Unfortunately, as soon as we did, any unit tests we had which included an Aspose object started failing with an error message similar to the following:
Test Name:Aspose59UnitTestFailure.UnitTests59.CreateAsposeObject_ObjectIsCreatedSuccessfully
Test FullName:Aspose59UnitTestFailure.UnitTests59.CreateAsposeObject_ObjectIsCreatedSuccessfully
Test Source:f:\AsposeUnitTestFailure\Aspose59UnitTestFailure.UnitTests\UnitTests59.cs : line 10
Test Outcome:Failed
Test Duration:0:00:00.465
Result Message:System.InvalidProgramException : Common Language Runtime detected an invalid program.
Result StackTrace:
at Aspose.Email.Outlook.MapiTask…ctor()
at Aspose59UnitTestFailure.UnitTests59.CreateAsposeObject_ObjectIsCreatedSuccessfully() in f:\AsposeUnitTestFailure\Aspose59UnitTestFailure.UnitTests\UnitTests59.cs:line 11
We have tried using versions 5.9/5.8/5.7 with net2/net3.5/net4, but all fail with the same exception. Only versions 5.4 and 5.6 seem to work.
Our application is currently running .Net 4.5.2 and we are building for “AnyCPU.” We are using Xunit as our testing framework. We have tried using both the Microsoft and ReSharper test runners, but both fail in an identical fashion.
I should mention that the Aspose objects do get created successfully in the application itself, it’s just in the unit test runner where the object construction results in an exception.
I have attached a zip file containing a Visual Studio 2013 solution which demonstrates the issue. It can be used with the build Microsoft Test Runner.
Can you please share with us how to reproduce this issue at our end? We have compiled your sample application at our end and it compiles fine without any issue. There is no error raised. Could you please share with us if this raises errors at compile time at your end?
The tests build without issue. It’s when the tests execute that the error occurs:
Open Visual Studio 2013 (I’m using Visual Studio Professional)
From the menu select "Test > Run > All Tests"
This will execute the tests using the Microsoft Test Runner. One of the tests will pass, the other will fail. Please see the attached image as an example.
We have tested this issue at our end with a number of systems but are unable to reproduce the problem at our side. The issue has been tested on different systems with VS 2012 and 2013, and specific .NET environments. Can you please try the same test on another PC and share your feedback with us?
We have attempted to run it on a number of different machines here, and most of them failed. However, we did find one machine where this has worked. We will investigate further and get back to you.
Please leave this ticket open, and I will report our findings next week.
After experimenting on different development machines in the office, we have been able to determine that the issue only occurs if Typemock is installed and Mocking Integration has been enabled in Visual Studio. If I disable Mocking Integration both tests pass.
We have downloaded the Typemock and installed it at our end. After this, we have run the tests from your sample application and no error/exception is raised. Could you please re-verify if Typemock is the only reason behind this? We assume that after installing, Typemock is enabled by default in Visual studio. If it is not so, could you please guide us how to enable it in Visual Studio?
We were able to reproduce this issue at our end using the latest version of the API i.e. 5.9.0 and have logged it as EMAILNET-35052 in our issue tracking system. Our product team will investigate the issue and we shall update you here once there is some information available about this problem.
We have checked the status of this issue and have found that it has been postponed due to the complexity involved. At present, there is no ETA available for resolution of this issue. We have requested our Product team about the same. If there will be a change in plan for resolving this issue targeting a definite timeline, we’ll update you here via this forum thread.
As mentioned in the previous post, we are afraid that still this issue is in queue for analysis and any update in this regard will be posted here immediately. We are sorry for the inconvenience caused in this regard.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.