Can't see some classes of CRM 2011 - dynamics-crm

I'm developing my first application for CRM 2011.
I've imported all .dll necessary for development.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Crm.Sdk.Messages;
but when I call some simple classes like "Annotation", "Letter" , "Email",
the visual studio doesn't detect these classes.
Has anybody knows why?

You need to use the tool CrmSvcUtil that comes with the SDK in order to generate your strongly typed classes.
Create Early Bound Entity Classes with the Code Generation Tool (CrmSvcUtil.exe)

Related

Can we run custom script for code cleanup using Visualstudio or Resharper?

I want to save space while printing source code in visual studio. Is it possible to combine multiple using namespace statements at the beginning of *.cs file to single line using resharper in visualstudio, or using some script that can be run using Resharper code cleanup. I want
using System;
using System.Collections.Generic;
using System.Net;
to be formatted as
using System;using System.Collections.Generic;using System.Net;

Can't find Microsoft.Phone in references XNA WP7

I want to open web browser using XNA for WP7,
from This Post I think I must use WebBrowserTask to do that,
but I don't know how to add Microsoft.Phone
I tried to right click on references but I can't find references Microsoft.Phone
I tried just type it in my code, but It still doesn't work..
Anyone know why? am I in the right track?
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;
using Microsoft.Phone; // <-- Error here
I use VS 2010 Express for windows phone, WP SDK 7.1.1, and Windows 8 Pro
Ok, on my PC this lib is situated here:
C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0
\Profile\WindowsPhone71\Microsoft.Phone.dll
You can add it from Solution Explorer:
References -> Add reference -> Browse
and then paste the path into the File name textbox.

Silverlight 3D XNA Error - The type or namespace does not exist

I'm trying to follow some tutorials for building a Silverlight 3D XNA project.
I'm able to display the 3D surface but once I start using Vector3 or VertexPositionNormalTexture (or using any of the XNA helper entities) I get that the type or namespce does not exist.
I've got these includes:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
I've includeed the References in the Silverlight Project, namely:
Microsoft.Xna.Framework
Microsoft.Xna.Framework.Graphics
Microsoft.Xna.Framework.Graphics.Extensions
System.Windows.Xna
and a bunch of others I'm not sure are relevant. These were under the .NET tab, perhaps I need to get them elsewhere, and these aren't for Silverlight? I'm not sure.
I'm using Visual Studio 2010 Professional, Silverlight 5 and XNA 4
I've managed to get XNA working in Silverlight in separate projects, I am pretty confident I missed something. Just double-check everything is included.

VS 2010: Disable Fileheader for new class files

I recently noticed that Visual Studio 2010 (Professional) inserts a FileHeader automatically in new class files. I don't know when this started but some time ago this wasn't enabled. Also, since then the using directives are added after the namespace.
This is the way the file looks like after generation:
// -----------------------------------------------------------------------
// <copyright file="Class1.cs" company="Microsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------
namespace MyNamespace
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// <summary>
/// TODO: Update summary.
/// </summary>
public class Class1
{
}
}
And thats the way it should look like (and how I want it):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MyNamespace
{
public class Class1
{
}
}
I disabled all extensions and all plugins, but the problem stays. Hopefully anyone here can tell my how to restore the previoous behaviour.
Thanks in advance
Visual studio uses templates to generate new files. You can read about how to create your own templates here http://stevesmithblog.com/blog/how-to-fix-visual-studio-file-templates/. The default templates are commonly stored in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates and it is these you'll want to edit if you want to globally replace the format.
For me the file headers showed up after installing Resharper and Stylecop.
To get rid of them I disabled the header inclusions in Resharper (Code Cleanup section) and also made sure the file header rules are no longer enforced in StyleCop. Next I modified the file templates stimms mentioned earlier. And finally I had to run devenv.exe /installvstemplates from the command line for Visual Studio to register the changes.
I think that is a ReSharper thing, Check your ReSharper settings.
http://www.jetbrains.com/resharper/webhelp/Code_Cleanup__Usage_Scenarios__Configuring_and_Inserting_a_Default_File_Header.html
http://blogs.jetbrains.com/dotnet/2010/12/automating-file-header-information-with-resharper/

VS 2010 Default Class Template for Windows Phone 7

Hi I've created a new WP7 project. Then I add a new project of type Windows Phone Class Library and by default the project has System.Net, System.Windows and System.Xml references beside other references. I don't need them in my Class Library so I delete them but when I create a new class Visual Studio create the following class :
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace WP7
{
public class Class1
{
}
}
but I've already removed the references System.Net & System.Windows. I'm getting an error when I try to compile the solution.
How I can modify the default template ?
I want to be something like
using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;
namespace WP7
{
public class Class1
{
}
}
I think this is a bug in VS2010. It doesn't respect the the current references of the project when adding a new class. How can I report this bug to MS ?
this is just how item templates and project templates work. You could create your own set, but that just isn't going to be quick and easy.
The idea is that these assemblies are needed in the majority of apps.
Since they are present on the device and not packaged into your .XAP, there is no net effect to your app.

Resources