Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flush Assembly cache?
#3
C# code:
/*/ role classLibrary; outputPath %folders.ThisApp%\Libraries; /*/

namespace TestNS;
/// <summary>
///    Do some stuff, nothing important 
/// /// </summary>
public static class TestLib {
    
    /// <summary>
    /// Do something
    /// 
    /// </summary>
    public static void PrintSomething() {
        print.it("Something");
    }
}

I compiled that...  Then created a script that references:

C# code:
/*/ r Libraries\TestLib.dll; /*/

using static TestNS.TestLib;

PrintSomething();


Then I went back and added another static method to the class:

C# code:
// class "TestLib.cs" /*/ role classLibrary; outputPath %folders.ThisApp%\Libraries; /*/

namespace TestNS;
/// <summary>
///    Do some stuff, nothing important 
/// /// </summary>
public static class TestLib {
    
    /// <summary>
    /// Do something
    /// 
    /// </summary>
    public static void PrintSomething() {
        print.it("Something");
    }
    
    public static void PrintSomethingElse() {
        print.it("Something Else");
    }
}

... recompiled and tried to reference in the script:

C# code:
// script "" /*/ r Libraries\TestLib.dll; /*/

using static TestNS.TestLib;

PrintSomething();
PrintSomethingElse();


Then I get the red squiggly under the PrintSomethingElse call and get a compile error stating:
Compilation: 1 errors
<open "<0x1000000AB>|6|1">Script5.cs(6,1): error CS0103: The name 'PrintSomethingElse' does not exist in the current context

Same thing seems to happen if I modify the type parameters or return type of a method...  In some cases even changing code.  Not sure what is happening there.  I can try on another machine.  It's just odd.

I was able to change some stuff inside the method and it worked... after restarting the editor, I ran the same script and got the "something else" output...

changed the print.it line to ("I dont want to"), recompiled and I got expected output.  It seems maybe more to do with adding/changing methods in a class?


Messages In This Thread
Flush Assembly cache? - by netdude78 - 12-15-2021, 05:08 PM
RE: Flush Assembly cache? - by Gintaras - 12-15-2021, 06:08 PM
RE: Flush Assembly cache? - by netdude78 - 12-16-2021, 02:39 AM
RE: Flush Assembly cache? - by Gintaras - 12-16-2021, 03:41 PM
RE: Flush Assembly cache? - by netdude78 - 12-16-2021, 03:51 PM
RE: Flush Assembly cache? - by Gintaras - 12-16-2021, 06:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)