Strange Reference Behavior in Visual Studio 2010

Hello,

I'm experiencing some strange behavior when referencing a class library using Aspose.Cells.dll from another project. (Please see the attached simple vs2010 solution with two projects).

What I did:

Created a class library (using .NET 4.0) that references Aspose.Cells.dll. Added one method that has one line of code:

Aspose.Cells.Workbook wb = new Workbook();

This builds fine. Then added a new Console project to the solution, referenced the Class library i just created. I added one line of code in the Program.cs class (of the Console project):

ClassLibrary4.Class1 c = new ClassLibrary4.Class1();

When I build it, it bombs, indicating that 'ClassLibrary4' does not exist. Its like the reference was removed, yet it is there. Intellencense does not show ClassLibrary4 anymore.

I then remove the reference, re-add it, then Intellencense shows 'ClassLibrary4'. But when I build it, it bombs again with the same message.

A workaround I found was to change the .NET version of both projects to 3.5, then back to 4.0, and it builds fine after that.

I was hoping you could take a look at the attached solution. If it works fine, then the issue is local to my machine.

I'm using:

  • Windows 7 Ultimate 64 bit
  • Aspose.Cells (4.9.0.0)
  • Visual Studio 2010 RTM

Thanks

Frank

Hi Frank,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The issue is caused because the target framework is ".NET Framework 4 Client profile". We use some classes of System.Web to import or export data that is why this issue is occurring. As a workaround, you can change the target framework as ".NET Framework 4". We will build a .NET Client Profile version soon. Your required feature has been added to our internal issue tracking system with issue id: CELLSNET-16429.

Thank You & Best Regards,

Thanks for the reply.

So it seems that the Class Library that referenced Aspose.Cells.dll was .Net 4.0, however the ConsoleApplication (referencing the class library) was set to .Net Client Profile 4.0 (which is the default for Console and Windows applications).

As soon as I changed the Console applications target to .Net 4.0, it compiled fine.

Thanks again.

Frank

Hi Frank,

Please try the attached latest version and let us know if it works fine for you.

Thank You & Best Regards,

That version compiled and ran fine when setting the target to .Net 4.0 Client Profile for both the class library referencing Aspose.Cells.dll and the console application referencing the class library.

Thanks!

Frank