Celtic Coding Solutions Blog

Celtic Coding Solutions Blog - for everything computer related

Error running Phone Emulator on Windows 8.1 and VS2013 in VMWare Workstation 8

I am running Windows 7 Ultimate as my main development machine but thought it would be good to play around with Windows 8 Phone dev kit.  Now you need Windows 8.1 and Visual Studio 2013 which I wanted to install on my VMWare Workstation 8 as a virtual pc.  I created risk of abortion a virtual PC and Windows 8.1 and Visual Studio 2013 installed fine, but when running the Windows Phone Emulator I got the following error:-

Windows Phone Emulator is unable to verify that the virutal machine is running:

Something happened while starting a virtual machine: 'Emulator 8.1 WVGA 4 facts of abortion inch 512MB.admin' failed to start. (Virtual machine ID ...

The Virtual Machine Management Service failed to start the virtual machine 'Emulator 8.1 WVGA 4 inch 512MB.admin' because on of the Hyper-V components is not running (Virual machine ID...

There is a great article on the nokia developer site for VMWare:-

http://developer.nokia.com/community/wiki/Windows_Phone_8_SDK_on_a_Virtual_Machine_with_Working_Emulator

The only bit I was missing was that when I opened the .vmx file I didn't have the following at all:-

hypervisor.cpuid.v0 = "FALSE"

So after adding this in and checking all the other settings where on I was then able to boot up the Windows Phone emulator - yippy.

TFS 2013 - change assigned to drop down list for work item bug, task etc

Using Team Foundation Server 2013 with Visual Studio 2013 and creating a work item like bug, task or issue the assigned to drop down was display far more people than where on my team.  As there is no obvious guid having an abortion to change who is listed then I did some digging and found it involves a small bit of effort which I will document here:-

I am using Visual Studio 2013 and Team Foundation Server 2013

You will need to download and install Microsoft Visual Studio Team Foundation Server 2013 Power Tools (please not if you already have a TFS Power Tools you will need to uninstall):-

http://visualstudiogallery.msdn.microsoft.com/f017b10c-02b4-4d6d-9845-58a06545627f

Once installed, open Visual Studio 2013 and connect to your TFS 2013 Server.

In Visual Studio 2013, Menu -> Tools -> Process Editor -> Work Item Types -> Open WIT from Server

Select a Project and a Work Item Type e.g. here I will use Issue

A form will open in in Visual Studio like so:-

Find the Assigned To row (selected above).  Double click and you will see the Field Definition.  Select Rules Tab:-

Edit VALIDUSER row and you will see a VALIDUSER popup form:-

Now select a group you have all the users you want to display, here I am using the [Global]\Developers TFS Group

OK all open pop up forms and save the *.wit file.

Now you need to upload this file back to TFS.  To do this use almost the same menu opitions:-

In Visual Studio 2013, Menu -> Tools -> Process Editor -> Work Item Types -> Import WIT

Select the correct project and browse for the *.wit file you just saved.

Once uploaded try to create a new Issue for that project and you will see that only the users selected in your TFS Group are now displayed (if you are using the Web abortion procedures TFS version make sure you F5 to refresh otherwise you will not see the changes).

Using Telerik WPF RadWindow as MainWindow

Thought I would blog about how to use the Telerik abortion pill video WPF RadWindow as a MainWindow when using Visual Studio 2012 and .Net 4.5 (but I presume it will work with other versions).

So change the MainWindow.xaml from:-

<Window

to 

<telerik:RadWindow

Now this works fine but I notice that we have no taskbar icon, bit strange as this is default with the standard WPF form.  

To add this you will need a new reference:-

xmlns:navigation="clr-namespace:Telerik.Windows.Controls.Navigation;assembly=Telerik.Windows.Controls.Navigation"

navigation:RadWindowInteropHelper.ShowInTaskbar="True"


Now we get the Taskbar icon back but it is the default WPF one so to add a custom one I added my own icon to a new Resource file and then referenced it:-

navigation:RadWindowInteropHelper.Icon="Resources/MyIcon.ico"


I also want how to get the pill the icon to show in the WPF window itself.  So I add the following:-

<telerik:RadWindow.Icon>

     <Image Source="Resources/MyIcon.ico" Height="18"/>

</telerik:RadWindow.Icon>


I also want to add a Telerik style to the whole form so I just add in:-

telerik:StyleManager.Theme="Windows7"

 

The complete code looks like:-

<telerik:RadWindow

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

    xmlns:navigation="clr-namespace:Telerik.Windows.Controls.Navigation;assembly=Telerik.Windows.Controls.Navigation"

    x:Class="MyProject.MainWindow"

    telerik:StyleManager.Theme="Windows7"

    navigation:RadWindowInteropHelper.ShowInTaskbar="True"

    navigation:RadWindowInteropHelper.Icon="Resources/ReportsIcon.ico"

    Header="My Telerik Form">    

    <telerik:RadWindow.Icon>

        <Image Source="Resources/ReportsIcon.ico" Height="18"/>

    </telerik:RadWindow.Icon>

</telerik:RadWindow>

SQL Server Management Studio - Index was outside the bounds of the array.

Tried to connect to a SQL Server using Microsoft SQL Server Management Studio 2005 and got the following error message (plus the databases wouldn't show):-

Index was outside the bounds of the array. (Microsoft.SqlServer.Smo)

Check the SQL Server version and it was a SQL methods of abortion Server 2012 SP1 CPU5 Enterprise Edition.

Fix:

I just used Microsoft SQL Server Management Studio online abortion pills 2012 and all is well

SSRS 2005 Web Page Resource cannot be found

Had a strange error with SSRS 2005 on Windows 2003 Server running IIS6.  Trying to load the Web Reports Manager for SSRS 2005 at http://localhost/reports and I would get the following error:-

Server Error in '/Reports' Application

The resource cannot be found

Description: HTTP 404.

Ok but I can load up:-

Http://localhost/reports/home.aspx

So I thought the Default content page wasn't set - nope it was?

OK so what is going on, only different is Asp.net 4.0 was installed.  Saw some articles saying maybe the Asp.net version wasn't set correctly for that Web Applications, but again checked and it was still set to buy abortion pills Asp.Net 2.0. 

Fix:-

Seemed like the root web ru 486 pill properties (Default Web Site Properties in this instance) was set to Asp.Net 4.0.

OK so changed this back to Asp.Net 2.0 and restarted IIS.  Bingo no SSRS 2005 http://localhost/reports works again.

Fix for SQL Server Database with no owner

I came across an issue today in SQL Server Management Studio.  On a particular database I right clicked and selected properties and was presented with the following error:-

Cannot show requested dialog. (SqlMgmt)

------------------------------

Property Owner is not available for Database for abortion '[]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.  (Microsoft.SqlServer.Smo)

So I ran sp_helpdb
And sure enough under the database the owner was NULL
Fix:-
Just run the following command on the database without abortion legal an owner, here I am using sa but you can use whichever owner you want:-
EXEC sp_changedbowner 'sa'

Installing .Net Assemblies in GAC for Windows Server 2008 r2

I blogged about installing .Net Assemblies in GAC for Windows Server 2008 (Celtic Coding Linky), but for 2008 R2 it no longer works unless you change the Security Policy and re-boot the server (blogs.msdn.com).

This isn't really an option on a live server so I decided to use gacutil.exe.  Yes I abortion pill safety know this is not supported in a live environment but it works and late term abortions when under tight deadlines it is a proper option.

However this server had an old verion under:-

C:\Windows\Microsoft.NET\Framework\v1.1.4322

No problem give it a go in Command Prompt running as an administrator and get the following error:-

Failure initializing gacutil.

 

Looks like a .Net version difference so open gacutil.exe.config and change the following:-

<?xml version ="1.0"?>

<configuration>

    <startup>

        <requiredRuntime version="v1.1.4322"  />

    </startup>

</configuration>

 

To

<?xml version ="1.0"?>

<configuration>

    <startup>

        <requiredRuntime  safemode="true"  imageVersion="v1.1.4322" version="v1.1.4322"  />

    </startup>

    <runtime>

        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

            <publisherPolicy apply="no"/>

        </assemblyBinding>

    </runtime>

</configuration>

 

Now try installing the dll

gacutil /i CCAssembly.dll

 

Assembly successfully added to the cache

Excellent!

SQL Server T-SQL SELECT Varchar not matching - CHAR(160)

First time I've come across this.  Imported some data from Excel 2010 into SQL Server Table.  Tried to match against some other data already in SQL Server and notice certain values where not matching even though to the naked eye these look exactly the same and the abortion risk field is the same varchar.  

So did a quick HexEdit check (thanks Visual FoxPro for this handy tool) and found the following:-

Looks after pill like in Excel or in the import process a space (last 3 characters) has been translated into:-

CHAR: 160

HEX: A0

Normally I see space in SQL as:-

CHAR: 32

HEX: 20

So a quick REPLACE(Field, CHAR(160), CHAR(32)) and now the values match.

Error when importing Excel 2007 spreadsheet into SQL Server 2012

Tried to import an Excel 2010 spreadsheet (file extension xlsx) into SQL Server 2012 using the import wizard and selecting Microsoft Excel 2007:-

 

Then I had the following error on my Windows 7 x64 PC:-

SQL Server Import and Export Wizard Error

Additional Information: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. (System.Data)

This is strange as I have Office 2010 x64 abortion hotline installed?

Fix: you need to install generic abortion pill the x86 (32bit) Office drivers.  This is a simple download from Microsoft called "2007 Office System Driver: Data Connectivity Components".

Url - http://www.microsoft.com/en-us/download/confirmation.aspx?id=23734

Visual FoxPro - Fix for Error accessing printer spooler (Error: 1957)

Had the following error appear on a Visual FoxPro Application running under Citrix:-

Error Number: 1957

Error message: Error accessing printer spooler.

I found out that this error was caused because sometimes FoxPro cannot determine the default printer.  So a work around was to use the winspool.drv and force FoxPro to the Default Printer name.

Example code as follows (I am defaulting to Win2PDF if no printer is found as this is installed on all our Citrix clients):-

 

PUBLIC cDefaultPrinter

UseStdPrintDefault()

SET PRINTER TO NAME (cDefaultPrinter)

REPORT FORM "TestReport.frx" abortion with a pill TO PRINTER PROMPT NOCONSOLE

 

PROCEDURE UseStdPrintDefault

DECLARE INTEGER GetDefaultPrinter IN winspool.drv;

   STRING  @ pszBuffer,;

   INTEGER @ pcchBuffer

 

abortion effects &&Return default printer name

nBufsize = 250

cPrinter = REPLICATE(Chr(0), nBufsize)

 

= GetDefaultPrinter(@cPrinter, @nBufsize)

cDefaultPrinter = SUBSTR(cPrinter, 1, AT(Chr(0),cPrinter)-1)

lnPrinterCount = APRINTERS(oPrinters)

FOR lnPCount = 1 TO lnPrinterCount

IF oPrinters[lnPCount,1] = 'Win2PDF'

SET PRINTER TO NAME "Win2PDF"

ENDIF

ENDFOR

RETURN

ENDPROC