jefffhaynes / XBee

A .NET library for XBee wireless controllers
MIT License
40 stars 17 forks source link

NuGet Package Issue Continued #52

Closed PaulNoto closed 6 years ago

PaulNoto commented 6 years ago

Hi Jeff, The old issue was getting a little long. I hope you don't mind that I started a new one.

Anyway, in response to your last question, I didn't do anything extra. All I do is create a new WPF Desktop App, Hit F5 to make sure it works, then I go to NuGet and add BinarySerializer, that's when it tries to add all the extra packages.

I just updated my Win7 and Win10 machines to VS 15.7.3 and .Net 4.7.2. I still have the same issue with a new WPF App.

So, if it works for you, I'm thinking that there is something that BinarySerializer is depending on, that is not installed on my win7 and win10 machines.

The first dependency for BinarySerializer is .NETStandard,Version=v1.3. I can see in Programs and Features that I have several .Net Core SDKs installed, the latest is v2.1.201 I cant find that .NetStandard is installed on either machine. Is it magically included with VS or is do I need to download it from somewhere?

Could this be the issue?

jefffhaynes commented 6 years ago

.NET Standard isn't really a framework, just an API level. .NET 4.7.2 supports .NET Standard 2.0 and everything prior so I wouldn't think that would be the problem...

You can find the full compatibility matrix here https://docs.microsoft.com/en-us/dotnet/standard/net-standard.

I think you might be experiencing this issue: https://github.com/dotnet/sdk/issues/1630. Does that look similar? It looks like they don't know what's causing it yet...

On Fri, Jun 1, 2018 at 10:08 AM, Paul Noto notifications@github.com wrote:

Hi Jeff, The old issue was getting a little long. I hope you don't mind that I started a new one.

Anyway, in response to your last question, I didn't do anything extra. All I do is create a new WPF Desktop App, Hit F5 to make sure it works, then I go to NuGet and add BinarySerializer, that's when it tries to add all the extra packages.

I just updated my Win7 and Win10 machines to VS 15.7.3 and .Net 4.7.2. I still have the same issue with a new WPF App.

So, if it works for you, I'm thinking that there is something that BinarySerializer is depending on, that is not installed on my win7 and win10 machines.

The first dependency for BinarySerializer is .NETStandard,Version=v1.3. I can see in Programs and Features that I have several .Net Core SDKs installed, the latest is v2.1.201 I cant find that .NetStandard is installed on either machine. Is it magically included with VS or is do I need to download it from somewhere?

Could this be the issue?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jefffhaynes/XBee/issues/52, or mute the thread https://github.com/notifications/unsubscribe-auth/AJSKR1d9XuVJChvPHHk36zukcaGPpKFXks5t4UrEgaJpZM4UWw1V .

-- If you want to build a ship, don't drum up people together to collect wood and don't assign them tasks and work, but rather teach them to long for the endless immensity of the sea.

Antoine de Saint-Exupery

PaulNoto commented 6 years ago

At first glance it doesn't look similar. I will look at it in more detail this weekend.

PaulNoto commented 6 years ago

Thanks for the link to the full compatibility matrix, it helped me to understand that NETStandard is only guaranteed to work up to .NET Framework 4.6.1, I'm actually using 4.7 without issue. The problem I'm having with 4.71 / 4.72 is not the same one from dotnet/sdk#1630. My problem is a run time exception caused because some of the Packages that NuGet adds have a little yellow triangle next to them in the References list that says: The referenced component 'whatever' could not be found. In my case it is a runtime exception from System.IO which is one of the references with a yellow triangle. Why my app compiles fine and only has a problem at run time, I don't know. Question: Am I stuck at .NET 4.7 forever?

My original issue happened when I used NuGet to update my app with the latest version of your XBee code, what was it, 8 months ago? I noticed that my solutions disk footprint had gone from 300KB to 300MB and that the 100X increase was being caused by all the packages that NuGet was adding. I guess this is because you started using .NETStandard? I assume that I will have to accept the larger footprint.

During my research today, I discovered a new Issue. If I update to the very latest version of your XBee code I get a runtime exception of: "There was an error reflecting type 'XBee.Frame'"

I isolated it to NuGet updating BinarySerializer from version 7.5.5 to 8.1.3

I isolated the run time error to: controller.OpenAsync( "COM3", 115200 )

I wrote a simplified app to isolate the issue. When I use NuGet to add XBee it works fine. When I go back to NuGet and add the 11 updates, it fails. I can add 10 of the updates, excluding BinarySerializer, and it works. When I go back to NuGet and update the last one, BinarySerializer, it fails.

This is my test app:

`` using System; using System.Windows; using XBee;

namespace WpfApp2 { ///

/// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DiscoverController();

    }

    private async void DiscoverController() {
        string result = "";
        var controller = new XBeeController();
        try {
            await controller.OpenAsync( "COM3", 115200 );
        }
        catch ( Exception e ) {
            result = e.Message; // "There was an error reflecting type 'XBee.Frame'" or sometimes "The operation has timed out."
        }
    }
}

}

PaulNoto commented 6 years ago

I am trying to add a better copy of my App. However, I don't understand how the "insert code" works, so it looks just as bad to me. Anyway, here it is. ........ Just figured it out on Google.

using System;
using System.Windows;
using XBee;

namespace WpfApp2 {
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
            DiscoverController();

        }

        private async void DiscoverController() {
            string result = "";
            var controller = new XBeeController();
            try {
                await controller.OpenAsync( "COM3", 115200 );
            }
            catch ( Exception e ) {
                result = e.Message; // "There was an error reflecting type 'XBee.Frame'" or sometimes "The operation has timed out."
            }
        }
    }

}
PaulNoto commented 6 years ago

Hi Jeff, I was wondering if you have had a chance to look into my issue with controller.OpenAsync(), when using BinarySerializer 8.1.3?

jefffhaynes commented 6 years ago

Sorry, no. It might be a while with everything going on right now. You could always pull the repo and debug it :). At a minimum it would be helpful to get the entire exception stack since the guilty field should be listed at the bottom.


From: Paul Noto notifications@github.com Sent: Friday, June 8, 2018 5:28:52 PM To: jefffhaynes/XBee Cc: Jeff Haynes; Comment Subject: Re: [jefffhaynes/XBee] NuGet Package Issue Continued (#52)

Hi Jeff, I was wondering if you have had a chance to look into my issue with controller.OpenAsync(), when using BinarySerializer 8.1.3?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jefffhaynes/XBee/issues/52#issuecomment-395895912, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJSKR9ydVC3DAES3itBJk3tKiXEMed1Tks5t6uyUgaJpZM4UWw1V.

PaulNoto commented 6 years ago

OK, I'll have a look into it this weekend.

baldvinhansson commented 6 years ago

It looks to me like the member causing reflection error is called 'Payload'

{"There was an error reflecting member 'Payload'"}

{"Method 'GetInitialState' in type 'XBee.ChecksumFieldValueAttribute' from assembly 'XBee.Core, Version=1.6.2.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.":"XBee.ChecksumFieldValueAttribute"}

jefffhaynes commented 6 years ago

Pushed in XBee.Core 1.6.3