The name ‘DisplayModes’ does not exist in the current context

The name ‘DisplayModes’ does not exist in the current context

The error above is caused from the following code:

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    DisplayModes.RequireConsistentDisplayMode = true;
}

Solution:

Replace

DisplayModes.RequireConsistentDisplayMode = true;

with

DisplayModeProvider.Instance.RequireConsistentDisplayMode = true;

Did my solution solve your problem? Leave a reply.

Microsoft Windows Phone – “0x89731812”

0x89731812

The above error message appears when you try to deploy a Windows Phone Project to a physical Windows Phone device.

Cause:
Connection to device failed.

Solution:
Disconnect and Reconnect the USB Cable, verify that Zune running and unlock the screen.

Did my solution solve your problem? Leave a reply.

HOW TO create a bulleted list in Microsoft Windows Phone App

To create a bulleted list in Microsoft Windows Phone App you have the following options:

  1. Write text inside your xaml file using and elements
        <TextBlock TextWrapping="Wrap">
          New features:<LineBreak/>
          <Run>• No Ads</Run><LineBreak/>
          <Run>• Message Encryption with Password for a double protection</Run><LineBreak/>
          <Run>• Advanced settings</Run><LineBreak/>
          <Run>• and more...</Run><LineBreak/>
        </TextBlock>
        
  2. Write text inside you Resouces file (use SHIFT+RETURN to create new line)
        
          New features:
          • No Ads
          • Message Encryption with Password for a double protection
          • Advanced settings
          • and more...    
        
  3. Create a bulleted or numbered list in Blend

Did my HOW TO help you? Leave a reply.

Silverlight for Windows Phone Project Template missing

Windows Phone SDK 7.1 automatically installs Microsoft Visual Studio 2010 Express edition.
If you have installed another edition of Microsoft Visual Studio 2010 you can also use this to create Windows Phone Projects.
Microsoft Visual Studio 2010 Express edition and the other editions are stored in the same Program Files folder “Microsoft Visual Studio 10.0”.

Cause:

Silverlight for Windows Phone Project Template is installed but in another language so when you try to create a new Project with the other Microsoft Visual Studio 2010 edition (NOT EXPRESS) the Silverlight for Windows Phone value into the Installed Templates list is missing.

Solution 1:

Uninstall Windows Phone SDK and reinstall it in the same language of the other Microsoft Visual Studio 2010 edition.

Solution 2 (UNDER THE HOOD):

Follow these Steps:

  1. Understand Microsoft Locale ID Values, it’s a table with correspondence between Language and Local ID.
  2. Store the Local ID value of your other Microsoft Visual Studio 2010 (NOT EXPRESS) editions languages.
  3. Go under <Visual Studio Install Path>\\Common7\\IDE\\ProjectTemplates\\<Language>\\Silverlight for Windows Phone\\
    for example:

    C:\\Program Files\\Microsoft Visual Studio 10.0\\Common7\\IDE\\ProjectTemplates\\CSharp\\Silverlight for Windows Phone
    
  4. Copy and paste the folder inside “Silverlight for Windows Phone” (for example: “1033”) and rename it with the other Local ID (stored at the Step 2).
  5. Repeat Steps 3-4 for each language you’ll use.
  6. Close all Microsoft Visual Studio 2010 running instances.
  7. Run a Command Prompt Window “as Administrator” and enter the following command (devenv is located in <Visual Studio Install Path>\\Common7\\IDE\\):
    devenv /InstallVSTemplates

    this operation, that registers the installed templates, may take several minutes.

Now you can create your Windows Phone Project with all your Microsoft Visual Studio 2010 editions.

NOTE:
If my solutions not work you can try to run the following command:

devenv /ResetSkipPkgs

that clears all SkipLoading tags added to VSPackages.

References:
Devenv Command Line Switches

Did my solution solve your problem? Leave a reply.

HOW TO add weeks to Date or DateTime

The Date and DateTime structures have the following methods:
AddYears(), AddMonths(), AddDays() but NOT AddWeeks() so you could use AddDays() to add the number of days of the week for each week or simply Add() to add TimeSpan, these aren’t professional solutions.

Use AddWeeks() method of Calendar class:

Imports System.Globalization

Dim cal As New Calendar

Dim newDate as Date = cal.AddWeeks(myDateTime, 1).Date
Dim newDateTime as DateTime = cal.AddWeeks(myDateTime, 1)

Also, you can use specific calendar changing Calendar class with others: GregorianCalendar, JapaneseCalendar, etc.
To read the complete list System.Globalization Namespace

Did my HOW TO help you? Leave a reply.

Microsoft Windows Phone – “0×89731811”

When you try to deploy a Windows Phone Project to a physical Windows Phone device show you the following error message:

0×89731811

Solution 1:

Launch the Zune software and check that the phone is connected to your pc.

Solution 2:

Deploy to Windows Phone Emulator

In Visual Studio, on the Standard toolbar, click Windows Phone Emulator.
Deploy to Windows Phone Emulator

Did my solution solve your problem? Leave a reply.

Microsoft Windows Phone – “0x89740005”

0x89740005

The above error message appears when you try to deploy a Windows Phone Project to a physical Windows Phone device.

Solution:

Launch Windows Phone Developer Registration tool
Start -> All Programs -> Windows Phone SDK 7.1 -> Windows Phone Developer Registration

Windows Phone Developer Registration for 0x89740005 error

Insert your Windows Live ID and Password then click on Register button.
Note: The Zune software must be running, the phone connected to your pc, with unlocked screen, with correct date time setting.

Did my solution solve your problem? Leave a reply.