'Init' does not exist in the current context (CS0103)

Ask general questions here.
zshadow
Posts: 28
Joined: Sat Aug 30, 2014 5:17 pm

'Init' does not exist in the current context (CS0103)

Post by zshadow » Thu Apr 09, 2015 9:10 pm

Hi,

I am getting the error :

The name 'Init' does not exist in the current context (CS0103)

ExitSDDSession.usercode:
public partial class ExitSDDSession
{
/// <summary>
/// This method gets called right after the recording has been started.
/// It can be used to execute recording specific initialization code.
/// </summary>
private void Init()
{
// Your recording specific initialization code goes here.
}

}


ExitSDDSession.cs code that's where I am getting the error :

public partial class ExitSDDSession : ITestModule
{
/// <summary>
/// Holds an instance of the ServiceReadiness.ServiceReadinessRepository repository.
/// </summary>
public static ServiceReadiness.ServiceReadinessRepository repo = ServiceReadiness.ServiceReadinessRepository.Instance;

static ExitSDDSession instance = new ExitSDDSession();

/// <summary>
/// Constructs a new instance.
/// </summary>
public ExitSDDSession()
{
}

/// <summary>
/// Gets a static instance of this recording.
/// </summary>
public static ExitSDDSession Instance
{
get { return instance; }
}

#region Variables

#endregion

/// <summary>
/// Starts the replay of the static recording <see cref="Instance"/>.
/// </summary>
[System.CodeDom.Compiler.GeneratedCode("Ranorex", "5.1.1")]
public static void Start()
{
TestModuleRunner.Run(Instance);
}

/// <summary>
/// Performs the playback of actions in this recording.
/// </summary>
/// <remarks>You should not call this method directly, instead pass the module
/// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
/// that will in turn invoke this method.</remarks>
[System.CodeDom.Compiler.GeneratedCode("Ranorex", "5.1.1")]
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;

Init();

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'SymptomDrivenDiagnostics.Session_campagins_recn' at 36;15.", repo.SymptomDrivenDiagnostics.Session_campagins_recnInfo, new RecordItemIndex(0));
repo.SymptomDrivenDiagnostics.Session_campagins_recn.Click("36;15");
Delay.Milliseconds(200);

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'SymptomDrivenDiagnostics.LogoutIcon' at 17;35.", repo.SymptomDrivenDiagnostics.LogoutIconInfo, new RecordItemIndex(1));
----------------
-------------------
zshadow

Posts: 23
Joined: Sat Aug 30, 2014 5:17 pm
Last edited by Support Team on Fri Apr 10, 2015 12:54 pm, edited 1 time in total.
Reason: Edited for better readability

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: 'Init' does not exist in the current context (CS0103)

Post by Support Team » Fri Apr 10, 2015 1:29 pm

Hi zshadow,

Unfortunately, I'm not able to reproduce the issue. In general, please ensure that name is within the same class and namespace. Did you somehow modify the recording or *.cs file? Please try to rebuild the whole solution.

Regards,
Robert
.
Image

zshadow
Posts: 28
Joined: Sat Aug 30, 2014 5:17 pm

Re: 'Init' does not exist in the current context (CS0103)

Post by zshadow » Fri Apr 10, 2015 8:30 pm

Hi Robert,

I did rename the tests, and I have cleaned and rebuilt the solution, but I still get the same problem, is there anywhere else the original file may be held?

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: 'Init' does not exist in the current context (CS0103)

Post by Support Team » Mon Apr 13, 2015 11:26 am

Hi zshadow,

May I ask which files you have changed? All the recording files are stored within the project folder of your solution. If you haven’t created a backup of these files this is the only location containing recording files.

Regards,
Robert
.
Image