Unable to resolve symbol: Workflow.EntityLogicalName - dynamics-crm-2011

I think I'm missing a using statement:
using System;
using System.Activities;
using System.ServiceModel;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using Microsoft.Xrm.Sdk.Workflow.Activities;
using Microsoft.Xrm.Sdk.Query;
Workflow.EntityLogicalName;
Extra info:
I'm using the crm 2013 SDK.
Workflow is recognized and is in the Microsoft.Xrm.Sdk.Workflow.Activities reference.
I'm trying to get this sample to work: http://www.mscrmconsultant.com/2012/06/run-ondemand-workflow-from-c-code-in.html

Make sure that you have added following references:
Microsoft.Xrm.Sdk
Microsoft.Xrm.Sdk.Workflow
If you have these references then Generate the Entity Wrapper for workflows using CRM Explorer. and then replace
Workflow.EntityLogicalName
with
Entities.Workflow.EntityLogicalName

Related

Can't reference Polly or other packages in Azure Functions

I have tried the below in a version 4 Azure Function app
#r "Polly"
using System;
using System.Threading.Tasks;
and/or
using System;
using System.Threading.Tasks;
using Polly;
But in both cases it says Polly is not found. From the docs I tried to add a framework 46 reference too in the json file for the function app but that did not work. What is the best way to import a dependency?
One of the workaround to install Polly dependency injection in Azure Functions v4 is:
Open the Azure Functions V4 Project.
Right-click on the project > Click on Manage Nuget Packages
Install the required extensions for your project like
Start writing the code related to Polly policies extension in the function class like:
The ways to add the dependency injections in the Azure Functions is:
Installing the Dependency Injections using NuGet Package Manager by right clicking on the project.
Or
Using the DotNet CLI or Package Manager commands available in the NuGet official Site.

Azure Functions pre-compiled c# using System.Data.SqlClient missing reference

I created a Timer Azure Function that called an API and wrote that json response to Azure SQL DB.
I wanted to continue my project, so I created an Azure Functions App in VS2017. I moved my code over and changed the #r script reference to the precompiled reference for the sqlclient.
From: (script calls)
r System.Configuration
r System.Data"
TO: (pre-compiled calls)
using System.Configuration;
using System.Data.SqlClient;
using System.Threading.Tasks;
Now I'm receiving a missing assembly reference for "System.Data.SqlClient" and I'm not sure how to add it to my Azure Functions App project in VS.
Please go to your csproj to check which framework you are targeting. Based on your error, I guess it looks like this:
<TargetFramework>netstandard2.0</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
Which means you are on .NET Standard / Functions V2.
Either change it to .NET Framework / Functions V1:
<TargetFramework>net461</TargetFramework>
or reference the .NET Standard version of System.Data.SqlClient:
<PackageReference Include="System.Data.SqlClient" Version="4.4.3" />
V1 is the production version for now, and it's the one used for C# script, so I suggest you stick to it.

Commission an HDInsight Cluster via .Net SDK

I'm trying to commission an HDI cluster using the .Net SDK. The tutorial is pretty self explanatory, but when I follow along, I seem to be missing a reference.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.Azure.Common.Authentication;
using Microsoft.Azure.Common.Authentication.Models;
using Microsoft.Azure.Management.HDInsight;
using Microsoft.Azure.Management.HDInsight.Job;
using Microsoft.Azure.Management.HDInsight.Job.Models;
using Microsoft.Azure.Management.HDInsight.Models;
using Newtonsoft.Json;
namespace CreateHDICluster
{
internal class Program
{
private static ProfileClient _profileClient;
....
}
}
results in a 'The type or namespace name 'ProfileClient' could not be found (are you missing a using directive or an assembly reference?)'
Best guess, whatever version of whatever package the ProfileClient class belongs to no longer contains this class - the tutorial doesn't specify a version and a few of them packages are pre-release.
Does anybody have this working? To what does the ProfileClient class belong?
Thanks
This appears to be a bug, as you have the correct references in your project. Note the open sourced GitHub repo and the class definition for ProfileClient:
https://github.com/Azure/azure-sdk-for-net/blob/21db6e5490e66af39a9c6dbf0ad10650d9ca037b/src/Authentication/Common.Authentication/Common/ProfileClient.cs
This file exists within the namespace: Microsoft.Azure.Common.Authentication
I suggest filing an issue with the repo. Also note that the packages requested to bring in, particularly Microsoft.Azure.Common.Authentication is in prerelease
I believe this issue you found in the article's sample was due to the removal of ProfileClient from the Authentication package -- the article's sample is now updated.
If you're still interested, you could take a look at the updated sample in the article.
I hope this helps!

The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft'

I'm trying to make a C# console app that adds messages to a queue. I'm following the examples about Azure Service Bus given here: http://www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-queues/
My program does nothing at the moment:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
namespace testConsole
{
class Program
{
static void Main(string[] args)
{
}
}
}
The problem I'm having is that when I add the Microsoft.ServiceBus.dll reference (as explained in the above link, 1-add dll reference and 2-add using statements) I'm getting an error upon compiling: "The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)"
I even looked into the Microsoft.ServiceBus.dll with reflector tool and it does contain Microsoft.ServiceBus namespace. Version number of the dll is 1.6.0.0 and runtime version v4.0.30319.
Any help appreciated.
-pom-
A common issue when using Storage and AppFabric services with a non-web applications is that the default Target Framework for Windows Forms app and Console App is .NET Framework 4.0 Client Profile. Change your project's Target Framework to ".NET Framework 4.0" (full) and it will work.
The problem that I've was that there are two packages Microsoft.Azure.ServiceBus and Azure.Messaging.ServiceBus. and I was using the wrong one, so maybe was that.
In the link the package used it's Azure not Microsoft as you are importing in your project.
It's this one
using Azure.Messaging.ServiceBus;

WatiN - Which resource contains Attribute [TestMethod] or [Test]?

I am just beginning WatiN and in a lot of blogs I see attributes like [TestMethod] or simply [Test] used.
For Example:
MSForge Blog Post
etc. etc.
but when I attempt:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WatiN.Core;
using WatiN.Core.UnitTests;
using WatiN.Core.Constraints;
using System.Diagnostics;
namespace Lemmings
{
class Login
{
[TestMethod]
...
...
}
}
[TestMethod]/[Test] is not recognized. I haven't seen anyone state that it is a custom attribute (it would also be strange if everyone was using the same custom attribute that was named the same thing) so I don't think that is likely.
What am I missing?
Note: For simple scripts [STAThread] works but if I want to use something like "ie.goto" VS2008 complains.
Any help is appreciated. Thank you.
Mel,
The Test and testmethod are custom attributes that are used by unit testing tools so they know that the method is a test. The Test attribute is used by nUnit and test method is used by the Visual Studio testing tools.
For more information you should look into the getting started documenation on www.nunit.org, and download the nunit test runner.
Oh you will also need a reference to nunit and a reference to the NUnit.Framework assemmbly. If you are using visual studio 2008 professional you can just create a new test project and add a unit test.

Resources