Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get rid of this warning?

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

    How to get rid of this warning?

    The following line of code
    Code:
    Text myText = Draw.Text(...)
    Draws the Visual Studio warning (I have cut some extraneous parts)
    Warning CS0436 The type 'Text' in '...\Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs' conflicts with the imported type 'Text' in 'NinjaTrader.Vendor, Version=8.0.0.12, Culture=neutral, PublicKeyToken=null'. Using the type defined in '...\Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs'.
    That sounds to me as if there is an inherent issue with the way the NT solution is set up. How can I get rid of this warning? Is that something I can do, or is that something that needs to be fixed by NT?

    #2
    Originally posted by ETFVoyageur View Post
    The following line of code
    Code:
    Text myText = Draw.Text(...)
    Draws the Visual Studio warning (I have cut some extraneous parts)
    That sounds to me as if there is an inherent issue with the way the NT solution is set up. How can I get rid of this warning? Is that something I can do, or is that something that needs to be fixed by NT?
    If you do not want to see warnings in VS, suppress them in VS. That warning is unavoidable: the gumball dll is in the same space as the sources.

    Comment


      #3
      Hello ETFVoyageur,

      koganam is correct in that the message is harmless and can be safely suppressed.

      I would be happy to pass this on to our development team. If you can provide a little more information, so that we will be able to reproduce this on our end, that would help us greatly.

      • Please attempt to use NinjaScript's compiler, rather than the Visual Studio compiler, if you are not doing so already. If you are using Ninja's compiler, this message will be sent to Ninja's log or trace files if the developers were not previously aware of this message.
      • If you are then able to send this message to Ninja's log and trace files, please send us a stripped down copy of your strategy which still causes this message, along with your log and trace files containing this message, to platformsupport[at]ninjatrader[dot]com , with attn:NinjaTrader_JessicaP and the unique ID 1554536 in the subject

      I have discussed this with several of our staff already, and they have assured me that once they have this information they will have everything they need to proceed further.


      Thank you for helping make NinjaTrader 8 the best product it can be.
      Jessica P.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_JessicaP View Post
        Hello ETFVoyageur,

        koganam is correct in that the message is harmless and can be safely suppressed.

        I would be happy to pass this on to our development team. If you can provide a little more information, so that we will be able to reproduce this on our end, that would help us greatly.

        • Please attempt to use NinjaScript's compiler, rather than the Visual Studio compiler, if you are not doing so already. If you are using Ninja's compiler, this message will be sent to Ninja's log or trace files if the developers were not previously aware of this message.
        • If you are then able to send this message to Ninja's log and trace files, please send us a stripped down copy of your strategy which still causes this message, along with your log and trace files containing this message, to platformsupport[at]ninjatrader[dot]com , with attn:NinjaTrader_JessicaP and the unique ID 1554536 in the subject

        I have discussed this with several of our staff already, and they have assured me that once they have this information they will have everything they need to proceed further.


        Thank you for helping make NinjaTrader 8 the best product it can be.
        As far as I can recollect, that message only shows up in VS itself.

        Comment


          #5
          Thank you koganam.

          I will let our development staff know that this message only shows up when compiling in Visual Studio. It is likely in this case that our compiler intentionally filters out this warning message. Should this not be the case, I will follow up here with more information.

          Thank you ETFVoyageur for bringing this to our attention, and thank you both for all your help improving NinjaTrader 8.
          Jessica P.NinjaTrader Customer Service

          Comment


            #6
            No message shows up on the log tab, and nothing is written under Documents/NinjaTrader 8/log. Is there somewhere else I should be looking?

            Comment


              #7
              In addition to those two places, your (My) Documents\NinjaTrader 8\traces folder is the only other place an unsuppressed warning message would show up.
              Jessica P.NinjaTrader Customer Service

              Comment


                #8
                There is a trace file with the appropriate time stamp, but nothing relevant o this topic is in there.

                Comment


                  #9
                  Thank you for checking this log. This almost certainly means that this message is being suppressed by the NinjaTrader compiler, because it is known to be harmless. I am providing publicly available documentation on suppressing compiler warning messages distributed by MSDN so that you can configure Visual Studio to match the NinjaTrader compiler's configuration.

                  Jessica P.NinjaTrader Customer Service

                  Comment


                    #10
                    As Koganam suggested, I can have VS suppress certain warning numbers. I am reluctant to do so, though, in case the same problem comes up in any of my code. For example the following could well occur in my own code and I would not want it hidden. NT has 4 of these and I'd rather see NT just fix their code.

                    Warning CS0618 390 'FormattedText.FormattedText(string, CultureInfo, FlowDirection, Typeface, double, Brush)' is obsolete: 'Use the PixelsPerDip override'
                    There is a small number of warnings to fix, admittedly several occurrences of each:
                    • 2002 -- 3 occurrences
                    • 0618 -- 4 occurrences
                    • 0436 -- 385 occurrences -- but I expect a central solution takes care of most/all of them

                    Also one with no warning number:
                    Warning There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "PresentationCore", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. NinjaTrader.Custom

                    Comment


                      #11
                      Originally posted by NinjaTrader_JessicaP View Post
                      Thank you for checking this log. This almost certainly means that this message is being suppressed by the NinjaTrader compiler, because it is known to be harmless. I am providing publicly available documentation on suppressing compiler warning messages distributed by MSDN so that you can configure Visual Studio to match the NinjaTrader compiler's configuration.

                      https://msdn.microsoft.com/en-us/library/jj715718.aspx
                      FWIW: I know how to configure VS. What would help is the list that NT thinks can be ignored.

                      It would be good if NT could just fix the low-occurrence ones, such as CS0618 (4 occurrences). It warns about using an obsolete call, and I do not think developers should have to suppress that one.

                      Comment


                        #12
                        I understand and appreciate your concern. So that we may reproduce this on our end, could you provide us with some additional information?

                        • Which version of Visual Studio are you using?
                          • If you are using a commercial version of Visual Studio, is this reproducable with a community version?
                        • Can you create a very basic "hello world" program which produces this message reliably and attach it to a reply here?
                          • We would not need an entire Visual Studio project, just a file which will reproduce what you are seeing if added to a new project and any configuration details regarding the project itself needed to produce what you are seeing.

                        We can then attempt to reproduce this on our end and return to you with our findings.
                        Jessica P.NinjaTrader Customer Service

                        Comment


                          #13
                          I am using VS 2015 Community.

                          All of the warnings come from NT software and/or project setup. Some are not reasonable for me to distill down. The following give the file name and line number (the number right after the warning number) which I hope is sufficient. This is everything I am seeing other than CS0436 (373 occurrences) -- let's discuss that separately.

                          Warning CS0618 180 'FormattedText.FormattedText(string, CultureInfo, FlowDirection, Typeface, double, Brush)' is obsolete: 'Use the PixelsPerDip override' Documents\NinjaTrader 8\bin\Custom\SuperDomColumns\@Notes.cs

                          Warning CS0618 145 'FormattedText.FormattedText(string, CultureInfo, FlowDirection, Typeface, double, Brush)' is obsolete: 'Use the PixelsPerDip override' \Documents\NinjaTrader 8\bin\Custom\SuperDomColumns\@ProfitLoss.cs

                          Warning CS0618 239 'FormattedText.FormattedText(string, CultureInfo, FlowDirection, Typeface, double, Brush)' is obsolete: 'Use the PixelsPerDip override' Documents\NinjaTrader 8\bin\Custom\SuperDomColumns\@Volume.cs

                          Warning CS0618 390 'FormattedText.FormattedText(string, CultureInfo, FlowDirection, Typeface, double, Brush)' is obsolete: 'Use the PixelsPerDip override' Documents\NinjaTrader 8\bin\Custom\SuperDomColumns\@APQ.cs
                          Warning CS2002 1 Source file 'obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs' specified multiple times Documents\NinjaTrader 8\bin\Custom\CSC

                          Warning CS2002 1 Source file 'obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs' specified multiple times Documents\NinjaTrader 8\bin\Custom\CSC

                          Warning CS2002 1 Source file 'obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs' specified multiple times Documents\NinjaTrader 8\bin\Custom\CSC
                          Warning There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "PresentationCore", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

                          Warning There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "PresentationCore", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

                          Comment


                            #14
                            Thank you very much for that information. Would it still be possible to get either a code sample, or the steps for compiling built-in NinjaScript code with Visual Studio that you are using?
                            Jessica P.NinjaTrader Customer Service

                            Comment


                              #15
                              Here are the CS0436 warnings for @Text.cs, with duplicates removed. There are others, in other files, but far fewer than the total number of warnings would suggest -- many are duplicates that just occur in a different file. As far as I know the solution is not in the source files. Perhaps the way the project is set up?
                              Warning CS0436 893 The type 'TextPosition' in 'Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs' conflicts with the imported type 'TextPosition' in 'NinjaTrader.Vendor, Version=8.0.0.12, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs'. Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs

                              Warning CS0436 479 The type 'Text' in 'Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs' conflicts with the imported type 'Text' in 'NinjaTrader.Vendor, Version=8.0.0.12, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs'. Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs

                              Warning CS0436 793 The type 'TextFixed' in 'Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs' conflicts with the imported type 'TextFixed' in 'NinjaTrader.Vendor, Version=8.0.0.12, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs'. Documents\NinjaTrader 8\bin\Custom\DrawingTools\@Text.cs

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              18 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post Javierw.ok  
                              Started by timmbbo, Today, 08:59 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post bltdavid  
                              Started by alifarahani, Today, 09:40 AM
                              6 responses
                              41 views
                              0 likes
                              Last Post alifarahani  
                              Working...
                              X