Posts Tagged ‘Visual Studio 2010’

Error when Trying to Run an WPF Program: XamlParseException occurred

August 4, 2011

PROBLEM:

image

This error is a very difficult one to identify.  It took me a couple of hours and remembering what code I added within the last compile.  Note:  This error does not occur when you compile, but when you run the application. 

What it turns out to be is when you write the following XAML code for a Window Form in WPF (Windows Presentation Foundation). 

The error was on Line number 14 but not line position 9… as the above error display shows.

Code Snippet
  1. <Window
  2.     x:Name="PullDraftDetail"
  3.     x:Class="PullDraftDetail"
  4.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
  5.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml&quot;
  6.     AllowsTransparency="True"
  7.         Title=""
  8.          mc:Ignorable="d"
  9.         xmlns:d="http://schemas.microsoft.com/expression/blend/2008&quot;
  10.         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
  11.         d:DesignHeight="200" d:DesignWidth="700"
  12.         SizeToContent="WidthAndHeight"
  13.         WindowStartupLocation="CenterScreen"
  14.         WindowStyle="None" Background="{x:Null}" Icon="/PullDraft_WPF;component/images/Book_JournalwPen.ico"
  15.     >

This code produces the following form in “Design View”.
image 

What I wanted is to make the Window transparent and display the “GroupBox" and all the other elements by setting the Window’s “Background=”{x:Null}”

But, when I added the “Icon=”/PullDraft_WPF;component/images/Book_JournalwPen.ico” I got the error “XamlParseException occurred”.  By the way… I did not need the “Icon” element because the Window was transparent anyway.

Solution:

I removed the Icon element and everything ran fine. 

Code Snippet
  1. <Window
  2.     x:Name="PullDraftDetail"
  3.     x:Class="PullDraftDetail"
  4.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
  5.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml&quot;
  6.     AllowsTransparency="True"
  7.         Title=""
  8.          mc:Ignorable="d"
  9.         xmlns:d="http://schemas.microsoft.com/expression/blend/2008&quot;
  10.         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
  11.         d:DesignHeight="200" d:DesignWidth="700"
  12.         SizeToContent="WidthAndHeight"
  13.         WindowStartupLocation="CenterScreen"
  14.         WindowStyle="None"
  15.         Background="{x:Null}"
  16.         >

…End of Line…

Advertisements

If you cannot see in VS 2010’s Solution Explorer the Icons from TFS (Team Foundation Server)

May 24, 2011

Problem:

5-24-2011 2-28-55 PMTeam Explorer can connect and shows the server and projects.  Source Control Explorer shows the source files and the state of check in/out.  But in Solution Explorer, there is nothing!  The red check marks are gone, the blue locks are gone.  Right click a solution or project or file and there are no source control options.

 

 

 

 

 

 

Solution:  http://social.msdn.microsoft.com/Forums/en/tfsgeneral/thread/58987d05-38d0-4056-82d7-f036adb7b2f3

5-24-2011 2-55-05 PM

When you try to connect to the TFS server and its offline then if you choose to still work on the solution you must eventually “Go Online” by right clicking the solution name in the Solution Explorer and select “Go Online”.

Change Source Control prompts: "The current solution is associated with source control but is offline.  Would you like to completely disassociate the solution from source control?" , because you did not perform the go online in Source Explorer.

When you right click the solution name in the Source Explore, can you select Go Online item? If you can, you can perform such as the check in/out operations.

Offline means if you cannot connect the TFS Server, you can also edit your solution, and when you connect the TFS Server, you can go online and perform the check in /check out.

There is a video about work offline with TFS, you can see: http://msdn.microsoft.com/en-us/vstudio/bb898913.aspx

For more information, you can refer to

http://blogs.msdn.com/b/benryan/archive/2007/12/12/when-and-how-does-my-solution-go-offline.aspx

http://msmvps.com/blogs/p3net/pages/tfs-2010-in-offline-mode.aspx

and

http://msdn.microsoft.com/en-us/library/cc667405(VS.90).aspx

How To: Turning On or Off a Control with IsEnable and the “Not” Command

March 2, 2011

You can simplify the following VB.NET code snippet by using NOT instead of IIF

Code Snippet
  1.        DeleteButton.IsEnabled = IIf(DeleteButton.IsEnabled = True, False, True)

can be restated in a simplified syntax as

Code Snippet
  1. DeleteButton.IsEnabled = Not DeleteButton.IsEnabled

SAP Crystal Reports for Visual Studio 2010 files needed to Download

November 24, 2010

There is no Registration for this.

Crystal Reports is not part of Visual Studio 2010 when you install Visual Studio 2010.

You have to download the following files from the table below.

 

Four download packages.

Name Description File Name

SAP Crystal Reports, version for Visual Studio 2010 –

Standard EXE installation package which installs the software into the Visual Studio IDE.

CRforVS_13_0.exe

SAP Crystal Reports, version for Visual Studio 2010 –

Click once installation package used to create self-updating Windows-based applications which can be installed and run with minimal user interaction.

CRforVS_clickonce_13_0.zip

SAP Crystal Reports, version for Visual Studio 2010 –

Merge modules installation package used to install components which are shared by multiple applications CRforVS_mergemodules_13_0.zip

SAP Crystal Reports runtime engine for .NET Framework 4 (32-bit)

Runtime Engine for .NET Framework 4 (32-bit) CRforVS_redist_install_32bit_13_0.zip

SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit)

Runtime Engine for .NET Framework 4 (64-bit) CRforVS_redist_install_64bit_13_0.zip

Changing the Default Environmental Settings in Visual Studio 2010

November 9, 2010

If you want to choose to use a different collection of settings at any time after you choose a Default Environment Settings in Visual Studio 2010.  From the Tools menu, choose Import and Export Settings and then choose Reset all Settings.

When installing Visual Studio 2010 you are asked to choose a default Environment Settings.  Figure 1.  Choose Default Enviroment Settings