License Error - .net 2.0


I am trying to run a web application on .net 2.0. We have a windows application that runs fine, but we are converting to a web based application. When i try to enter:

License license = new License();


I get the following error:

Invalid token '(' in class, struct, or interface member declaration

Any help is greatly appreciated.




Looks like something is wrong with your project. Make sure you have a reference to Aspose.iCalendar.dll added to your project. Also you can try the fully qualified class name Aspose.iCalendar.License l = new Aspose.iCalendar.License();


Thanks for the reply. I tried the fully qualified name as well as creating a new blank project, with just the one line of code. Still get the same error. I am using visual studio 2005 with C#.



Please also make sure you are using latest version of Aspose.iCalendar.


Thanks again for the reply. I am using



You mentioned that you have a windows application where you can apply the license file. I presume it is made with VS.NET 2005 and .NET 2.0. So I don't think there is anything wrong from the Aspose.iCalendar side.

When you build an ASP.NET application, can you use Aspose.iCalendar inside it without a license? Can you compile any code in your ASP.NET application at all (not calls to Aspose.iCalendar)? Sorry for asking such questions, but still looks to me like some sort of a mess up with the project in VS.NET IDE.



Yes sir, I can build out the site and run it without the license reference. I really was unaware of the license until I hit an error where no dates were being generated in the GenerateOccurences(). I read the previous post on the forum and it was my exact problem, so i followed the steps to add the license reference. As soon as I added that, the project would not compile. I had my boss look at it, who wrote the core of the Windows Application, and he was stumped as well. We figured it was time to ask the pros.

In testing, without the license reference, i hardcoded some dates that were year 2000, and everything works like a champ. I’m stumped for sure. I know your product works great, I have been working with it for about 5 weeks now. But for some reason, this license declaration is not running. Anything I can post or provide you, I will.



It works fine for me in Web Developer 2005 Express Edition, here is my code:

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page


protected void Page_Load(object sender, EventArgs e)


Aspose.iCalendar.License l = new Aspose.iCalendar.License();




Maybe this article is applicable:

I hope you are not trying to put C# code straight into .aspx file like discussed in the above link. As they say, C# code can only be executed in methods.


That was the problem. Thank you very much. Another C# lesson learned.

I really appreciate the prompt and accurate support. You want a testimonial, you got it.