Tag Archives: .Net Framework 4.0

…ok now, how to find .Net Version installed in any given environment?


There are few good ways available to find out which .Net Version is installed in any given environment.

You can try one of the following:

– Manually you can check it via registry editor (REGEDIT.exe). Refer https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx

– Using C#.Net you can use System.Environment class to get the related info:

private static void GetFrameworkVersionInfo()
{
Console.WriteLine("Version: " + Environment.Version.ToString());
}

– Using Visual Studio Command Prompt, you can try – CLRVER command:

Deva blogs

– Using Windows PowerShell, I would have tried one of the following or the Windows PowerShell that I found in stackoverflow as well :

Deva blogs

Deva blogs

Hope this helps.

Just FYI – Support Ending for the .NET Framework 4, 4.5, 4.5.1 @ January 12, 2016


Last year I blogged regarding the end of support for .Net Frameworks (4, 4,5 & 4.5.1), starting January 12, 2016 and it’s not far away – please there will be no longer provide security updates, technical support or hotfixes for .NET 4, 4.5, and 4.5.1 frameworks. All other framework versions, including 3.5, 4.5.2, 4.6 and 4.6.1, will be supported for the duration of their established lifecycle.

It matters a lot – refer my earlier blog post and just make sure that you use a supported version of the .NET Framework is installed in your environment, on Windows desktops and servers; it includes Azure and other cloud service deployments. You can use the article to find out “How to determine which .Net Framework versions installed at your computer”. Refer @ https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx. In addition, you can refer my related blog post http://blogs.msdn.com/b/deva/archive/2015/12/22/ok-now-how-to-find-net-version-installed-in-any-given-environment.aspx as well.

Detailed info is available at DotNet Blog post – http://blogs.msdn.com/b/dotnet/archive/2015/12/09/support-ending-for-the-net-framework-4-4-5-and-4-5-1.aspx. It includes interesting info (refer the below snapshot) for products like Exchange, SharePoint, Lync/Dynamics etc. For more details on the .NET Framework support lifecycle, visit the Microsoft .NET Framework Support Lifecycle Policy FAQ. Additionally, compatibility of the .NET framework can be viewed on the .NET Application Compatibility page.

Deva blogs 

Hope this helps.

Download: 101 samples for Exchange Server 2013


Now you can download the 101 Exchange Web Service samples to download them all, or select the samples that you want and download them individually. This pack includes 101 code samples that show you how to develop Exchange 2013 solutions. The code samples in the Exchange 2013: 101 code samples package show you how to use the Exchange Web Services (EWS) Managed API to send email messages, search mail folders, get contact information, check user availability, and more.

Prerequisites

These samples require the following:

  • A target server that is running Exchange Server 2007 Service Pack 1 (SP1) or a later version of Exchange.
  • The .NET Framework version 4.
  • The EWS Managed API assembly file, Microsoft.Exchange.WebServices.dll. You can download the assembly from the Microsoft Download Center (it points to EWS Managed API 2.0).

Note: These samples assume that the assembly is in the default download directory. You will need to verify the path before you run the solution for an individual sample.

  • Visual Studio 2010 with the Visual Web Developer and C# components and an open Visual Studio 2010 solution.
    Or
  • A text editor to create and edit source code files and a command prompt window to run a .NET Framework command line compiler.

Key components of the sample

Each sample will typically contain the following files:

  • *.sln — A Visual Studio 2010 solution file for the project.
  • *.csproj — One or more Visual Studio 2010 project files.
  • app.config — Contains configuration data for the project.
  • *.cs —Contains the using statements, namespace, class, and functions to showcase a particular feature.
  • Authentication.csproj — The Visual Studio 2010 project file for the dependent authentication code.
  • TextFileTraceListener.cs — Contains the using statements, namespace, class, and code to write the XML request and response to a text file.
  • Service.cs — Contains the using statements, namespace, class, and functions necessary to acquire an ExchangeService object used in the project.
  • CertificateCallback.cs — Contains the using statements, namespace, class, and code to acquire an X509 certificate.
  • UserData.cs — Contains the using statements, namespace, class, and functions necessary to acquire user information required by the service object.

Configure the sample

Follow these steps to configure the Exchange 2013: 101 code samples.

  1. Set the startup project by selecting the project in the Solution Explorer and choosing "Set as StartUp Project" from the Project menu.
  2. Ensure that the reference path for the Microsoft.Exchange.WebServices.dll points to where the dll is installed on your local computer.

Build the samples:

You need to press F5 to build and deploy the samples.

Run and test the samples

You need to press F5 to run the samples.

Note:
The above samples applies to the following exchange version/technologies: Exchange Server 2007 SP1, Exchange Server 2010, Exchange Server 2013 and EWS Managed API

Outlook Object Model: How to assign a Webpage to a specific Outlook folder programmatically?


In this post we will see how to assign a web page to a specific Outlook folder programmatically using C# and Outlook Object Model. For this I tried the following sample, which checks for a folder named “HtmlView” in Microsoft Office Outlook. If the folder does not exist, the code creates the folder and assigns a Web page to it. If the folder exists, the code displays the folder contents.

The following sample is written using C#.Net, Visual Studio 2010 and Outlook 2010 (Outlook Object Model API).

Code snippet:

   1: //Microsoft.Office.Interop.Outlook._Application

   2: // Create an Outlook application.

   3: Outlook._Application oApp = new Outlook.Application();

   4:  

   5: // Get the MAPI NameSpace and Logon values.

   6: Outlook._NameSpace oNS = (Outlook._NameSpace)oApp.GetNamespace("MAPI");

   7: oNS.Logon(Missing.Value, Missing.Value, true, true);

   8:  

   9: //Assign a Web page with a specific Outlook folder

  10: Outlook.MAPIFolder newView = null;

  11: string viewName = "HtmlView";

  12: Outlook.MAPIFolder inBox = (Outlook.MAPIFolder) oApp.ActiveExplorer().Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);

  13: Outlook.Folders searchFolders = (Outlook.Folders)inBox.Folders;

  14: bool foundView = false;

  15:  

  16: foreach (Outlook.MAPIFolder searchFolder in searchFolders)

  17: {

  18:    if (searchFolder.Name == viewName)

  19:       {

  20:          newView = inBox.Folders[viewName];

  21:          foundView = true;

  22:       }

  23: }

  24:  

  25: if (!foundView)

  26: {

  27:      newView = (Outlook.MAPIFolder)inBox.Folders. Add("HtmlView", Outlook.OlDefaultFolders.olFolderInbox);

  28:      newView.WebViewURL = "http://www.microsoft.com";

  29:      newView.WebViewOn = true;

  30: }

  31:  

  32: oApp.ActiveExplorer().SelectFolder(newView);

  33: oApp.ActiveExplorer().CurrentFolder.Display();

Run the sample and you will see the following output in Outlook:

Outlook 2010 - Output

Happy programming!!

Developer Hub: Documentation & samples for Windows Phone 7.1 (Mango) & 7.0


For the Windows Phone 7 developers, Microsoft has published (pre-release documentation) for the next version of Windows Phone OS 7.1 (Mango).  You can find them @ http://msdn.microsoft.com/en-us/library/ff431744(VS.92).aspx. Windows Phone developers can download these code samples and applications, such as Panorama/Pivot Control, Bing Maps, and a unit converter, to experiment with the Windows Phone Application Platform. New samples will be added to the above page periodically, so check back often and see what’s new.

As per previous blog post, you need the Windows Phone Developer Tools to run these samples. To provide feedback on this documentation, click here. For the previous Windows Phone OS 7.0 developer documentation, click here.

Blogged using my Windows Live Writer 2011…

How to: Determine which Microsoft .Net Framework version and service pack installed?


This is one of our frequent question: How to determine which version(s) and service pack level(s) of the Microsoft .NET Framework are installed? You can use the registry information below to determine which version(s) and service pack level(s) of the Microsoft .NET Framework are installed.

.NET Framework

Service Pack Level

Registry Key Name

Value

4 – Client

Original Release

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4Client

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4Client

Name: Version, Type: REG_SZ, Data: 4.0.30319.0

4 – Full

Original Release

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4Full

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4Full

Name: Version, Type: REG_SZ, Data: 4.0.30319.0

3.5

Original Release

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.5

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.5

Name: SP, Type: REG_DWORD, Data: 0

3.5

Service Pack 1

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.5

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.5

Name: SP, Type: REG_DWORD, Data: 1

3.0

Original Release

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.0

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.0

Name: SP, Type: REG_DWORD, Data: 0

3.0

Service Pack 1

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.0

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.0

Name: SP, Type: REG_DWORD, Data: 1

3.0

Service Pack 2

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.0

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv3.0

Name: SP, Type: REG_DWORD, Data: 2

2.0

Original Release

HKEY_LOCAL_MACHINESoftwareMicrosoftNET Framework SetupNDPv2.0.50727

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESoftwareMicrosoftNET Framework SetupNDPv2.0.50727

Name: SP, Type: REG_DWORD, Data: 0

2.0

Service Pack 1

HKEY_LOCAL_MACHINESoftwareMicrosoftNET Framework SetupNDPv2.0.50727

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESoftwareMicrosoftNET Framework SetupNDPv2.0.50727

Name: SP, Type: REG_DWORD, Data: 1

2.0

Service Pack 2

HKEY_LOCAL_MACHINESoftwareMicrosoftNET Framework SetupNDPv2.0.50727

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESoftwareMicrosoftNET Framework SetupNDPv2.0.50727

Name: SP, Type: REG_DWORD, Data: 2

1.1

Original Release

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv1.1.4322

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv1.1.4322

Name: SP, Type: REG_DWORD, Data: 0

1.1

Service Pack 1

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv1.1.4322

Name: Install, Type: REG_DWORD, Data: 1

 

 

HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv1.1.4322

Name: SP, Type: REG_DWORD, Data: 1

1.0 (on supported platforms except for Windows XP Media Center and Tablet PC)

Original Release

HKEY_LOCAL_MACHINESoftwareMicrosoftActive SetupInstalled Components{78705f0d-e8db-4b2d-8193-982bdda15ecd}

Name: Version, Type: REG_SZ, Data: 1.0.3705.0

1.0 (on supported platforms except for Windows XP Media Center and Tablet PC)

Service Pack 1

HKEY_LOCAL_MACHINESoftwareMicrosoftActive SetupInstalled Components{78705f0d-e8db-4b2d-8193-982bdda15ecd}

Name: Version, Type: REG_SZ, Data: 1.0.3705.1

1.0 (on supported platforms except for Windows XP Media Center and Tablet PC)

Service Pack 2

HKEY_LOCAL_MACHINESoftwareMicrosoftActive SetupInstalled Components{78705f0d-e8db-4b2d-8193-982bdda15ecd}

Name: Version, Type: REG_SZ, Data: 1.0.3705.2

1.0 (on supported platforms except for Windows XP Media Center and Tablet PC)

Service Pack 3

HKEY_LOCAL_MACHINESoftwareMicrosoftActive SetupInstalled Components{78705f0d-e8db-4b2d-8193-982bdda15ecd}

Name: Version, Type: REG_SZ, Data: 1.0.3705.3

1.0 (shipped with Windows XP Media Center 2002/2004 and Tablet PC 2004)

Service Pack 2

HKEY_LOCAL_MACHINESoftwareMicrosoftActive SetupInstalled Components{FDC11A6F-17D1-48f9-9EA3-9051954BAA24}

Name: Version, Type: REG_SZ, Data: 1.0.3705.2

1.0 (shipped with Windows XP Media Center 2005 and Tablet PC 2005)

Service Pack 3

HKEY_LOCAL_MACHINESoftwareMicrosoftActive SetupInstalled Components{FDC11A6F-17D1-48f9-9EA3-9051954BAA24}

Name: Version, Type: REG_SZ, Data: 1.0.3705.3

Hope this helps.

Download: EWS Managed API 1.1


If you use EWS (Exchange Web Services) Managed API 1.0 or 1.1 beta, then its time for downloading its latest update: EWS Managed API 1.1 (Version 14.02.0051.000)

The Microsoft Exchange Web Services (EWS) Managed API 1.1 provides a managed interface for developing client applications that use Exchange Web Services. The EWS Managed API simplifies the implementation of applications that communicate with Microsoft Exchange Server 2007 Service Pack 1 (SP1) and later versions of Microsoft Exchange. Built on the Exchange Web Services SOAP protocol and Autodiscover, the EWS Managed API provides a .NET interface to EWS that is easy to learn, use, and maintain.

You can download it from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c3342fb3-fbcc-4127-becf-872c746840e1

Note:
1) For x64 (64-bit) computers, download and run EwsManagedApi.msi
2) For x86 (32-bit) computers, download and run EwsManagedApi32.msi
3) Requires Microsoft .NET Framework 3.5 and Microsoft Visual Studio 2008 or later

Hotfix: Failure Sending mail error with System.Net.Mail (.Net Framework 4.0) while sending large attachment


Recently one of my customer ran into an issue with his application used to send email messages using System.Net.Mail.SmtpClient (SNM) API. He used Visual Studio 2010 and .NET Framework 4.0. It’s a pretty simple code,

//Sample C# code snippet using System.Net.Mail API
SmtpClient MyClient = new SmtpClient("mail_server");
MyClient.Credentials = new System.Net.NetworkCredential("User", "Password", "Domain");
MailMessage MyMsg = new MailMessage("fromuser", "touser", "Testing Attachment", "Testing");
Attachment MyAttachment = new Attachment(@"attachmentfile");
MyMsg .Attachments.Add(MyAttachment );
MyClient.Send(MyMsg );

Using the above code, whenever he adds the attachment size is larger than 3 MB and tries to send the message. It fails with the following a exception System.Net.Mail.SmtpException and error message “Failure sending mail”. Also during troubleshooting i noticed that i generates a inner exception System.IndexOutOfRangeException with the error message “Index was outside the bounds of array”. In the application he also failed to specify the TransferEncoding property of the attachment.

In this customer scenario, recommended him to try with TransferEncoding property with QuotedPrintable worked for him. We tried it like,
MyAttachment.TransferEncoding = System.Net.Mime.TransferEncoding.QuotedPrintable;

You can find the following support knowledgebase article which talks about the issue and provides resolution to overcome the issue. 

Also there is a hotfix available to overcome this issue. Please make sure that you must have .NET Framework 4.0 installed to apply this hotfix. To download this hotfix, you can visit following Microsoft website: https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=30226.