Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator and Strategy references .Net 4.0.30319 not .Net4.5

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Indicator and Strategy references .Net 4.0.30319 not .Net4.5

    I'm writing some code that is wishes to utilize ZipArchive class which was released in System.IO.Compression in .Net4.5 apparently. In checking the indicator "references" I see that every script on my install is pointing to the older 4.0 .Net versions listed below.

    Click image for larger version

Name:	references.png
Views:	168
Size:	38.2 KB
ID:	1341258

    I was under the impression that .Net 4.5 was a requirement and is installed.

    How to fix the reference? Do I need to reinstall NT?

    #2
    Hello volIQ,

    NinjaTrader 8.1.4.2 does target .NET 4.8.

    CLR v4.0.30319 is part of the .NET Framework 4.8.
    Use code, regedit.exe, or PowerShell to detect which versions of .NET Framework are installed on a machine by querying the Windows registry. Or, check Control Panel.


    There is no need to fix the reference. It is correct.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      That's good to know. In my code I have:

      Code:
      ​using System.IO.Compression;
      and this line

      Code:
        using (ZipArchive archive = ZipFile.Open(destinationZipPath, ZipArchiveMode.Create))
      which causes these errors: Any idea?



      Comment


        #4
        Hello volIQ,

        Unfortunately, I would not be able to assist with using 3rd party libraries that are not documented NinjaScript methods and properties.

        This thread will remain open for any community members that would like to provide advice or direction with using this library.

        If you are experiencing an error, I recommend you provide the full error message.

        You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Sorry, the previous post had had an image of the errors included, I previewed that was attached. It has somehow disappeared now. I will attempt to attach it again below.

          Obviously, .NET 4.8 is a third-party framework from Microsoft, but its is.Net. NT does not exist without it. If a method is included in the base framework, I should be able to reference it?

          I suspect something to do with the editor is messing up the assembly. In looking is visual studio code, I see that System.IO.Compression.FileSystem is in there.

          Click image for larger version

Name:	errormsg.png
Views:	108
Size:	11.2 KB
ID:	1341465
          Attached Files

          Comment


            #6
            Hello volIQ,

            While I cannot assist with using library, I can suggest try using the fully qualified namespace System.IO.Compression.ZipArchive.

            With the fully qualified namespace does the error persist?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Same error. No worries I'll find another way.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              60 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              39 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              21 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              23 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              51 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X