So I've got a dotnet core app, I'd like to use Twilio so I performed the following from the command line.
dotnet add package Twilio
All went well, no errors. It adds version 5.1.1 of Twilio packages. But building the app now gives me
The type or namespace name 'Twilio' could not be found
I'm running .Net core version 1.1 with the equivalent 1.0.1 SDK.
Any ideas?
Did you restore? The following works for me.
dotnet new console
dotnet add package Twilio
dotnet restore <---- We need to restore after adding a package.
dotnet build
Program.cs
using Twilio;
class Program
{
static void Main(string[] args)
{
TwilioClient.SetUsername("foo");
}
}
DotNetCoreTwilio.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Twilio" Version="5.1.1" />
</ItemGroup>
</Project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With