Answered by:
Problem with runing SDK plugin sample code

Question
-
Dear all,
I have a problem with runing Retrieve Opportunity Sample PLugin included in CRM 2011 SDK documentation
I've added references for :
Microsoft.Xrm.Sdk
System.ServiceModel
System.Runtime.Serialization
microsoft.crm.sdk.proxy
and using directives for:
using System;
using System . Collections . Generic;
using System . Linq;
using System . Text;
using System . ServiceModel;
using Microsoft . Xrm . Sdk;
using Microsoft . Xrm . Sdk . Client;
using Microsoft . Xrm . Sdk . Query;
using Microsoft . Xrm . Sdk . Discovery;
using Microsoft . Crm . Sdk . Messages;
using System . ServiceModel;
using System . ServiceModel . Description;
there are errors in using ServerConnection, (It says the type or namespace could not be found) !!
If anybody could help me on this it will be helpful
thanks in advance...
Tuesday, June 7, 2011 9:56 AM
Answers
-
Try adding a using statement to the following namespace:
Microsoft.Crm.Sdk.Samples
If you aren't using this example from the SDK location (I.E. you copied it somewhere before working with it) you will have problems too as the code for this file is linked in visual studio (only stored in one solution and then linked in others).
This is a custom onbject from the crmhelpers.cs file. This means you might need to create a crmhelpers.cs file and find the one in the solution as openned from the SDK location and copy the code over.
Alternatively you can just open the solution within the SDK location instead of using a copied solution.
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Tuesday, June 7, 2011 10:37 AM
- Marked as answer by Jamie MileyModerator Friday, August 31, 2012 5:48 PM
Tuesday, June 7, 2011 10:36 AMModerator -
Hi Mostafa, this is a duplicate of http://social.microsoft.com/Forums/en-US/crmdevelopment/threads?filter=unanswered and http://social.microsoft.com/Forums/en-US/crm/thread/c353a907-498c-4db0-a776-f28c1969c569/#d933130f-23b4-4861-82a0-ad76d2b6ea60
You should really stop posting duplicate threads since you are doing this everytime. I would also kindly suggest you read the links that people give you since you cannot expect the CRM community to do all the work for you, you must show that you are willing to learn and try what is suggested to you.
Gonzalo | gonzaloruizcrm.blogspot.com
- Marked as answer by Jamie MileyModerator Friday, August 31, 2012 5:48 PM
Tuesday, June 7, 2011 12:33 PMModerator
All replies
-
I'm sorry guys, but I forgot to tell you that there is another error with using any entity name like Opportunity, Product, UoM, etc...Tuesday, June 7, 2011 10:05 AM
-
Try adding a using statement to the following namespace:
Microsoft.Crm.Sdk.Samples
If you aren't using this example from the SDK location (I.E. you copied it somewhere before working with it) you will have problems too as the code for this file is linked in visual studio (only stored in one solution and then linked in others).
This is a custom onbject from the crmhelpers.cs file. This means you might need to create a crmhelpers.cs file and find the one in the solution as openned from the SDK location and copy the code over.
Alternatively you can just open the solution within the SDK location instead of using a copied solution.
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Tuesday, June 7, 2011 10:37 AM
- Marked as answer by Jamie MileyModerator Friday, August 31, 2012 5:48 PM
Tuesday, June 7, 2011 10:36 AMModerator -
Hi Mostafa, this is a duplicate of http://social.microsoft.com/Forums/en-US/crmdevelopment/threads?filter=unanswered and http://social.microsoft.com/Forums/en-US/crm/thread/c353a907-498c-4db0-a776-f28c1969c569/#d933130f-23b4-4861-82a0-ad76d2b6ea60
You should really stop posting duplicate threads since you are doing this everytime. I would also kindly suggest you read the links that people give you since you cannot expect the CRM community to do all the work for you, you must show that you are willing to learn and try what is suggested to you.
Gonzalo | gonzaloruizcrm.blogspot.com
- Marked as answer by Jamie MileyModerator Friday, August 31, 2012 5:48 PM
Tuesday, June 7, 2011 12:33 PMModerator -
Dear Gonzalo,
I'm really want to learn about plugins, so I have found a plugin sample in the SDK documentation and i want to use it as a start point to learn....
but when I've tried to run it some problems appears and I've asked the community to help me that's all...
(I'm not expecting the CRM community to do all the work for me, I'm just asking for help)
Tuesday, June 7, 2011 12:41 PM -
Did any of these posts help you?
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!Tuesday, February 14, 2012 9:34 PMModerator