0
votes

I am trying to create the sample on the following website. Its suppose to allow me to send data to Azure.

I looked up this error but I am not using the Interactive window and #r doesn't seem to be the answer. I believe that this issue prevents me from the use of my title, but I will try.

https://catalog.azureiotsuite.com/details?title=Raspberry_Pi3&source=home-page

"Reference to type 'stream' claims to be defined in 'System.RunTime', but it could not be found."

The line referring to Message gets this and the line below with the await gets it for 'Task'

using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure.Devices.Client;
using Windows.UI.Xaml.Controls;

namespace MyFirstIotCoreApp
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {

        public MainPage()
        {
            this.InitializeComponent();
            SendDataToAzure();

        }

        private async Task SendDataToAzure()
        {
            DeviceClient deviceClient = DeviceClient.CreateFromConnectionString(<replace>, TransportType.Http1);

            var text = "Hello, Windows 10!";
            var msg = new Message(Encoding.UTF8.GetBytes(text));

            await deviceClient.SendEventAsync(msg);
        }
    }
}
1

1 Answers

3
votes

Good Morning;

 Anytime I see an error referencing a missing item in a Framework library like

that, the first thought I have is to check the Framework version. Some functions exist only in certain versions of the Framework as they develop new features.

Check the Framework version to see if you have selected the version that supports that feature.