Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

.NET Framework Issue

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

    .NET Framework Issue

    I get the following error messages when I try to compile an indicator:

    NinjaScript File Error
    \NETFramework,Version=v4\8\AssemblyAttributes.cs Duplicate 'global::System.Runtime.Versioning.TargetFramework Attribute' attribute
    \NETFramework,Version=v4\8\AssemblyAttributes.cs Duplicate 'global::System.Runtime.Versioning.TargetFramework Attribute' attribute
    \NETFramework,Version=v4\8\AssemblyAttributes.cs Duplicate 'global::System.Runtime.Versioning.TargetFramework Attribute' attribute
    The following is my current .NET environment:

    .NET SDK:
    Version: 8.0.100-rc.2.23502.2
    Commit: 0abacfc2b6

    Runtime Environment:
    OS Name: Windows
    OS Version: 10.0.22621
    OS Platform: Windows
    RID: win-x64
    Base Path: C:\Program Files\dotnet\sdk\8.0.100-rc.2.23502.2\

    .NET workloads installed:
    There are no installed workloads to display.

    Host:
    Version: 8.0.0-rc.2.23479.6
    Architecture: x64
    Commit: 0b25e38ad3

    .NET SDKs installed:
    7.0.402 [C:\Program Files\dotnet\sdk]
    8.0.100-rc.2.23502.2 [C:\Program Files\dotnet\sdk]

    .NET runtimes installed:
    Microsoft.AspNetCore.App 6.0.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 7.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.NETCore.App 6.0.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 7.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.WindowsDesktop.App 6.0.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 7.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 8.0.0-rc.2.23479.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

    Other architectures found:
    x86 [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\I nstallLocation]

    Environment variables:
    Not set

    global.json file:
    Not found

    Could you, please help me sort this out?

    #2
    Hello Gianpiero,

    Thanks for your post.

    The error looks like you may have an AssemblyAttributes.cs file in the Custom folder which is conflicting with a .NET file. This may occur when building something in Visual Studio

    Open a File Explorer window and check in Documents > NinjaTrader 8 > bin > Custom >obj > Debug for a file named AssemblyAttributes.cs. If you find this file, delete the obj as well as the bin folders within the Custom folder.​

    Doing a build from Visual Studio could cause multiple files to occur. Note that you should never compile from Visual Studio.

    From the Visual Studio Debugging help guide: You can also use Visual Studio as editor for your NinjaScript files - for that open the project as in step 2 above and then use Visual Studio for editing and once done save the file (don't run or build the solution then in Visual Studio), preferably with the NinjaScript editor opened still at the same time, so changes would be auto compiled in then.

    Visual Studio Debugging: https://ninjatrader.com/support/help..._debugging.htm

    Here is a forum thread detailing this compilation error and resolving it: https://forum.ninjatrader.com/forum/...rk#post1127976
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      I resolved this issue. Thank you very much!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      81 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      47 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      29 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      32 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      66 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X