I want to use ExcelLibrary.dll in Ranorex in order to build own methods for dealing with reading and writing from/to xlsx file.
But I am unable to deal with following error:
"'ExcelLibrary' is a 'namespace' but is used like a 'type' (CS0118) - D:\ranorexTutorial\lab\lab\xls.cs:50,38"
I am sure I have not created any namespace called ExcelLibrary. In fact I created brand new C# solution in Ranorex and just added ExcelLibrary reference, add it to "using" and tried to create new instance of it. This is whole code:
Code: Select all
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Threading;
using WinForms = System.Windows.Forms;
using Ranorex;
using Ranorex.Core;
using Ranorex.Core.Testing;
using ExcelLibrary;
namespace lab
{
/// <summary>
/// Description of Xls.
/// </summary>
[TestModule("247F2086-AAA0-4354-868C-B51FDD00A276", ModuleType.UserCode, 1)]
public class XlsTest : ITestModule
{
/// <summary>
/// Constructs a new instance.
/// </summary>
public XlsTest()
{
// Do not delete - a parameterless constructor is required!
}
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;
ExcelLibrary xlLib = new ExcelLibrary();
}
}
}
"using ExcelLibrary;" to the top and
"ExcelLibrary xlLib = new ExcelLibrary();" to the ITestModule.Run() method.
Could you pls help why I have this error?
thank you!