Archive for the ‘Visual Studio’ Category

Problem: After including some XAML files from a Visio document in a Visual Studio solution you’re unable to build the solution and receive the error:

Project file must include the .NET Framework assembly ‘WindowsBase, PresentationCore, PresentationFramework’ in the reference list 

Cause: When you include XAML files in a solution it assumes you want to compile the XAML resources and subsequently throws the above exception because it can’t find the required WPF assemblies.

In this case, I was only wanting the add the files as content to the solution to keep them under source control.

Solution: To solve this, firstly, unload the project from the solution by right clicking the project and choosing unload project. This can be seen in figure 1Figure 1.

Then, right click the project and choose edit project. This will open the XML for the project file. Now, find the XAML entries.

  1. <Content Include="Processes\Flowcharts\Change\xaml_2.xaml">
  2.       <Generator>MSBuild:Compile</Generator>
  3.       <SubType>Designer</SubType>
  4.     </Content>

Change this to read.

  1. <Content Include="Processes\Flowcharts\Change\xaml_2.xaml"/>

The project should now build.

Advertisements

If you ever find yourself in the situation where you’re unable to debug your application because you have inadvertently managed to disable configuration manager and put it into release mode at the same time. Here’s how to re-enable configuration manager.

Under Tools -> Options -> Projects and Solutions, you’ll see the Show Advanced Build Configurations option.

Show Advanced Build Configurations

Tick the show advanced build configurations box and your back in action.

I’m still puzzled how I managed to do this (maybe some crazy key stroke combination),  but its working again now.

Recently, when trying to publish from within Visual Studio 2008  to  three existing virtual directories, located under an existing site, I was repeatedly prompted for credentials.  This was something I had completed successfully earlier that day.   I tried just about every configuration in Visual Studio to resolve it.

In the end, I had to remove the existing virtual directories and re-publish to allow Visual Studio to create the virtual directories. It seems there is some sort of caching in the Front Page Server Extensions or something. Anyway, deleting them and re-publishing done the trick.

In debug mode, you can hover over an item and drill down through its properties using the ‘+’ button.

In VS2010, if you look at the right hand side you’ll find a pin which can be used to pin a particular field to that line of code.

This can be done on several lines of code so you can see what the values of fields are as you move through the code. A pin appears in the left hand margin.

debug-pinning

After the debug is finished, if you hover over the pin it shows you the last value held in that field during the debug session.

After installing Re-Sharper 5.0 I then installed Style cop for Re-Sharper to allow my code to comply with MS Style Cop and give me real-time syntax highlighting of violations.  However, after installation, when I opened Visual Studio I received the following error.

resharper for style cop coule not be loaded

This is because the  dll has not been given full trust. To resolve this issue follow the instructions of how to Use an Assembly from the Web in Visual Studio.