Click here to Skip to main content
15,886,578 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: mvc group Pin
Pete O'Hanlon28-Feb-16 23:12
mvePete O'Hanlon28-Feb-16 23:12 
GeneralRe: mvc group Pin
Sascha Lefèvre28-Feb-16 5:31
professionalSascha Lefèvre28-Feb-16 5:31 
AnswerRe: mvc group Pin
Member 1241901320-Apr-16 8:36
Member 1241901320-Apr-16 8:36 
QuestionDropdownlist with Model (MVC4,C#, ASP.Net2015,Razor) Pin
bl4ckeagle23-Feb-16 2:52
bl4ckeagle23-Feb-16 2:52 
AnswerRe: Dropdownlist with Model (MVC4,C#, ASP.Net2015,Razor) Pin
Richard MacCutchan23-Feb-16 4:55
mveRichard MacCutchan23-Feb-16 4:55 
GeneralRe: Dropdownlist with Model (MVC4,C#, ASP.Net2015,Razor) Pin
bl4ckeagle23-Feb-16 8:12
bl4ckeagle23-Feb-16 8:12 
AnswerRe: Dropdownlist with Model (MVC4,C#, ASP.Net2015,Razor) Pin
Member 121254968-Mar-16 2:47
Member 121254968-Mar-16 2:47 
Questionawait can't find GetAwaitor method Pin
__John_17-Feb-16 5:17
__John_17-Feb-16 5:17 
The error...
Error	1	'await' requires that the type 'Windows.Foundation.IAsyncOperation<Windows.Devices.Enumeration.DeviceInformationCollection>' have a suitable GetAwaiter method. Are you missing a using directive for 'System'?	C:\Users\jo\Documents\Visual Studio 2013\Projects\Btle01\Btle01\Form1.cs	29	46	Btle01



My code...
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using Windows.Devices.Bluetooth;
using Windows.Devices.Enumeration;
using Windows.Foundation;
using Windows.System;

namespace Btle01
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void OnFormLoad(object sender, EventArgs e)
        {
        }

        private async Task GetDevs()
        {
            foreach (DeviceInformation di in await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(BluetoothLEDevice.GetDeviceSelector()))
            {
                BluetoothLEDevice bleDevice = await BluetoothLEDevice.FromIdAsync(di.Id);
                listView1.Items.Add(bleDevice.Name);
            }
        }

    }
}


List of project references...
<ItemGroup>
  <Reference Include="System" />
  <Reference Include="System.Core" />
  <Reference Include="System.Runtime" />
  <Reference Include="System.Runtime.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
    <SpecificVersion>False</SpecificVersion>
    <HintPath>..\..\..\..\..\..\..\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.WindowsRuntime.dll</HintPath>
  </Reference>
  <Reference Include="System.Threading" />
  <Reference Include="System.Threading.Tasks" />
  <Reference Include="System.Xml.Linq" />
  <Reference Include="System.Data.DataSetExtensions" />
  <Reference Include="Microsoft.CSharp" />
  <Reference Include="System.Data" />
  <Reference Include="System.Deployment" />
  <Reference Include="System.Drawing" />
  <Reference Include="System.Windows.Forms" />
  <Reference Include="System.Xml" />
  <Reference Include="Windows.Devices">
    <HintPath>..\..\..\..\..\..\..\Windows\System32\WinMetadata\Windows.Devices.winmd</HintPath>
  </Reference>
  <Reference Include="Windows.Foundation">
    <HintPath>..\..\..\..\..\..\..\Windows\System32\WinMetadata\Windows.Foundation.winmd</HintPath>
  </Reference>
  <Reference Include="Windows.System">
    <HintPath>..\..\..\..\..\..\..\Windows\System32\WinMetadata\Windows.System.winmd</HintPath>
  </Reference>
</ItemGroup>



I am targeting v8.0.

The only solutions I can find is; add a reference to windows runtime, but so far as I know I have done that.

What am I missing or doing wrong?
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford


modified 17-Feb-16 11:30am.

AnswerRe: await can't find GetAwaitor method Pin
Nathan Minier23-Feb-16 1:47
professionalNathan Minier23-Feb-16 1:47 
GeneralRe: await can't find GetAwaitor method Pin
__John_23-Feb-16 22:07
__John_23-Feb-16 22:07 
QuestionMail messages are stuck in outgoing queue in IIS SMTP server with windows authentication? Pin
Member 1138787716-Feb-16 1:53
Member 1138787716-Feb-16 1:53 
AnswerRe: Mail messages are stuck in outgoing queue in IIS SMTP server with windows authentication? Pin
Eddy Vluggen18-Feb-16 3:24
professionalEddy Vluggen18-Feb-16 3:24 
QuestionC# library for implementing graphic editor's functions Pin
Mikhail Zemlyanukhin15-Feb-16 21:59
Mikhail Zemlyanukhin15-Feb-16 21:59 
AnswerRe: C# library for implementing graphic editor's functions Pin
Pete O'Hanlon15-Feb-16 22:41
mvePete O'Hanlon15-Feb-16 22:41 
AnswerRe: C# library for implementing graphic editor's functions Pin
Gerry Schmitz16-Feb-16 5:59
mveGerry Schmitz16-Feb-16 5:59 
AnswerRe: C# library for implementing graphic editor's functions Pin
Brisingr Aerowing17-Feb-16 23:05
professionalBrisingr Aerowing17-Feb-16 23:05 
QuestionCreateProcessAsUser or LogonUser Pin
byka10-Feb-16 5:34
byka10-Feb-16 5:34 
AnswerRe: CreateProcessAsUser or LogonUser Pin
Dave Kreskowiak10-Feb-16 6:33
mveDave Kreskowiak10-Feb-16 6:33 
AnswerRe: CreateProcessAsUser or LogonUser Pin
Eddy Vluggen10-Feb-16 6:38
professionalEddy Vluggen10-Feb-16 6:38 
GeneralRe: CreateProcessAsUser or LogonUser Pin
byka10-Feb-16 6:54
byka10-Feb-16 6:54 
GeneralRe: CreateProcessAsUser or LogonUser Pin
Eddy Vluggen10-Feb-16 7:08
professionalEddy Vluggen10-Feb-16 7:08 
GeneralRe: CreateProcessAsUser or LogonUser Pin
byka10-Feb-16 7:27
byka10-Feb-16 7:27 
GeneralRe: CreateProcessAsUser or LogonUser Pin
Dave Kreskowiak10-Feb-16 9:58
mveDave Kreskowiak10-Feb-16 9:58 
GeneralRe: CreateProcessAsUser or LogonUser Pin
byka11-Feb-16 3:04
byka11-Feb-16 3:04 
GeneralRe: CreateProcessAsUser or LogonUser Pin
Dave Kreskowiak11-Feb-16 10:03
mveDave Kreskowiak11-Feb-16 10:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.