I`m trying to send an e-mail with SendGrid but i got some errors.
I was making this tutorial but after install SendGrid i cant creat any instance of SendGridMessage.
I am using .NET Framework 4.5.2
var test = new SendGirdMessage();
I got this error:
Error 3 The type or namespace name 'SendGridMessage' could not be
found (are you missing a using directive or an assembly
reference?)
Then i already try to use SendGridAPIClient, this i can creat but that aren`t sending the e-mail.
I follow this tutorial With Mail helper class.
Could some one help me to send e-mail from azure?
You should use the version 2 of SendGrid to that tutorial. To use this version you have that install the SendGrid C-Sharp 6.3.4 or bellow.
In Package Management Console write:
Install-Package SendGrid -version 6.3.4
Related
Trying to: publish an customized bot through visual studio 2017. Once i publish it, I get to see the first message from the bot. However, after my input message, I fails with the error message as "There was an error sending this message to your bot: HTTP status code ExpectationFailed" in Bot channel.
I am publishing a web bot app with bot framework SDK-3 in MS Azure portal.
Tried: installing different package versions (including latest 4.2) for bot.builder and bot.connector, however, it gave more errors like "type or namespace name IDialog<> could not be found"
Expectation: What could be all the potential scenario for such error and is there any helpful reference?
I tried to understand this tutorial: http://odata.github.io/odata.net/#OData-Client-Code-Generation-Tool
I can generate the proxy without any problems. Just as it is described.
But at chapter "Consume the OData service" it doesn't work. I have named the application and the proxy exactly as shown in the tutorial. How can I make odata available in namespace Microsoft?
Screenshot
Error CS0234 The type or namespace name 'OData' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) TrippinApp C:\TrippinApp\Program.cs 6 Active
Error CS0246 The type or namespace name 'DefaultContainer' could not be found (are you missing a using directive or an assembly reference?) TrippinApp C:\TrippinApp\Program.cs 16 Active
Error CS0246 The type or namespace name 'DefaultContainer' could not be found (are you missing a using directive or an assembly reference?) TrippinApp C:\TrippinApp\Program.cs 16 Active
I used:
Microsoft Visual Studio 2017 (Trial)
Microsoft.Data.Edm v5.8.3
Microsoft.Data.Odata v5.8.3
Microsoft.Data.Services.Client v5.8.3
System.Spatial v.5.8.3
WCF Data Services 5.6 Tools (are installed)
continuation:
#Evandro Paula:Thank you for your help! I have come a little further thanks to your help. But unfortunately I have not come to the goal yet.
I installed/updated:
Microsoft Visual Studio 2017 (15.7.1) (Trial)
Microsoft.Data.Edm v5.8.3 (I have not found a more recent one)
Microsoft.Data.Odata v5.8.3 (I have not found a more recent one)
Microsoft.Data.Services.Client v5.8.3 (I have not found a more recent one)
Microsoft.OData.Client v7.4.4 (installed)
Microsoft.OData.Core v7.4.4 (installed)
Microsoft.OData.Edm v7.4.4 (installed)
Microsoft.Spatial v7.4.4 (installed)
System.Spatial v.5.8.3 (I have not found a more recent one)
WCF Data Services 5.6 Tools (are installed)
Screenshot of NuGet
Now the results look like this:
Compiling works with Proxy (TrippinProxy.cs), but without Odata example. (Screenshot)
As soon as I copy the code from the tutorial, compiling does't work anymore. (Screenshot)
using System;
using Microsoft.OData.SampleService.Models.TripPin;
namespace TrippinApp
{
class Program
{
static void Main(string[] args)
{
DefaultContainer dsc = new DefaultContainer(
new Uri("http://services.odata.org/V4/(S(fgov00tcpdbmkztpexfg24id))/TrippinServiceRW/"));
var me = dsc.Me.GetValue();
Console.WriteLine(me.UserName);
}
}
}
source: http://odata.github.io/odata.net/#OData-Client-Code-Generation-Tool
Now the Namespace Microsoft.OData is found. But not Microsoft.OData.SampleService (Screenshot)
I need a little example. How can I initialize the proxy and add a product (CreateProduct)? Or how can I get the example from the tutorial up and running?
First, update the packages you mentioned on your question to their latest version. It looks like Visual Studio didn't use the latest version in your case. I'm using Visual Studio 2017 Enterprise Edition (version 15.7.3) for this test.
Microsoft.OData.Client (version 7.4.4)
Microsoft.OData.Core (version 7.4.4)
Microsoft.OData.Edm (version 7.4.4)
Microsoft.Spatial (version 7.4.4)
Once the packages are up to date, you will observe the following build error, which is related to issue https://github.com/OData/lab/issues/80:
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'EdmxReader' does not exist in the namespace 'Microsoft.OData.Edm.Csdl' (are you missing an assembly reference?) ODataClient C:\temp\NET\ODataClient\Connected Services\TrippingService\TrippingProxy.cs 510 Active
The resolution for this issue is available at https://github.com/juliopinto15/lab/commit/deb1254301a775eb6771b0bed672dd3f56f37cfe.
Just change the proxy (e.g. TrippingProxy.cs) generated code line below as part of method LoadModelFromString():
return global::Microsoft.OData.Edm.Csdl.EdmxReader.Parse(reader);
to
return global::Microsoft.OData.Edm.Csdl.CsdlReader.Parse(reader);
In my case, I deleted the NuGet cache folder, and it compiles now.
%LOCALAPPDATA%\Nuget\v3-cache
I worked with the same example (TripPinService) and got the same error. It looks like there is an error in the sample.
Instead of:
var context = new DefaultContainer(new Uri(serviceRoot));
You need to write:
var context = new Default.Container(new Uri(serviceRoot));
After that code runs without errors
I've been trying to check the access of a user on a SQL Server Analysis Services (SSAS) server using impersonation.
AdomdConnection class has following instance method to accomplish the same:
public void ChangeEffectiveUser(string effectiveUserName)
Here is the MSDN documentation for the same.
I followed the NuGet package instructions here to add ADOMD.Net in my C# project but when I try to use the API then I don't see the API in intellisense at all.
try
{
Console.WriteLine("Going to open ADOMD connection.");
myconnect.Open();
//below line doesn't compile
myconnect.ChangeEffectiveUser(#"mydomainname\otherUserIamTryingToImpersonate");
adomdCommand.ExecuteNonQuery();
Console.WriteLine("Query executed successfully");
Console.ReadLine();
}
catch (Exception ex)
{
MessageBox.Show("error in connection");
}
It is giving compilation failure:
Error CS1061 'AdomdConnection' does not contain a definition for
'ChangeEffectiveUser' and no extension method 'ChangeEffectiveUser'
accepting a first argument of type 'AdomdConnection' could be found
(are you missing a using directive or an assembly reference?)
Am I missing something?
I was able to figure out that MS has changed the NuGet package for the latest ADOMD.Net release which came as part of SQL Server 2016. It is available on NuGet package here in the name of Unofficial.Microsoft.AnalysisServices.AdomdClient. Not sure why MS has taken this strategy to introduce a new package instead when they should have simply added a new version in the already existing NuGet package here in the name of Microsoft.AnalysisServices.AdomdClient.
The moment I took reference of v13.x of Microsoft.AnalysisServices.AdomdClient.dll present in Unofficial.Microsoft.AnalysisServices.AdomdClient NuGet package my compilation error went away and I could see the API.
The error below occurs when attempting to make an api request using tweetinvi running on an azure web role.
Could not load file or assembly 'System.Threading.Tasks,
Version=2.6.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or
one of its dependencies. The system cannot find the file specified.
I tried installing the nuget package for this dll, but then I get a compilation error (same type being declared in two places,) because apparently, system.threading.tasks in bundled inside of mscorlib.dll
.NET version: 4.5
tweetinvi version : v4.0.30319 strong name
I assume that you mentioned tweetinvi version is the Runtime Version. I do a demo using TweetinviAPI. It works correctly on my side. If it is possible, please have a try to redeploy it again or create new cloudservie to test it again..
The following is my detail steps:
1.Create cloudservive project and with WebRole.
2.Reference the tweetinvi with Nuget
3.Create Tweetinvi application (https://apps.twitter.com/) and get the Consumer Key,Consumer Secret, Access Token, Access Token Secret
4.Add the following code in the HomeController About() to test it.
Auth.SetUserCredentials(string consumerKey, string consumerSecret, string userAccessToken, string userAccessSecret);
// Publish the Tweet "Hello Tweetinvi" on your Timeline
Tweet.PublishTweet("Hello Tweetinvi! ");
5.Publish the cloudservice to Azure and visit(http://xxxxx.cloudapp.net/Home/About) get the test result.
6.Check from twitter, it works correctly
Long story short I want to create authentication for my WCF service.
Target framework: .NET 4.5.
I'm following this User Name Password Validator.
I'm trying to inherit from UserNamePasswordValidator class but VS2013 keep giving me this error :
My code:
public class UserNamePassValidator : System.IdentityModel.UserNamePasswordValidator
{
}
The error i'm getting:
Error 1 The type or namespace name 'IdentityModel' does not exist in the namespace 'System' (are you missing an assembly reference?)
I've tried a couple of diffrent ways to solve this: (none of them help me)
I've installed Windows Identity Foundation and the WIF SDK.
I've add dll manually with this path: C:\Program Files\Reference Assemblies\Microsoft\Windows Identity Foundation\v3.5\ Microsoft.IdentityModel.dll
I try to search for that package in the Nuget Package Manager but nothing come up, only System.IdentityModel.Token (I reference it too but it didn't help).
What am i missing here ? its probably something obvious that I don't see...
If the Target Framework is 4.5, then there is no package to download in order to use WIF. System.IdentityModel is fully integrated to Framework 4.5 and it is the type used by WIF when targeting Framework 4.5 and higher.
Also, you should inherit from this type: System.IdentityModel.Selectors.UserNamePasswordValidator:
public class UserNamePassValidator : System.IdentityModel.Selectors.UserNamePasswordValidator
{
public override void Validate(string userName, string password)
{
return;
}
}
You can refer to the links below:
1- UserNamePasswordValidator
2- What do I need to build a claims-aware wcf service in VS 2013