EzDevInfo.com

windows-8 interview questions

Top windows-8 frequently asked interview questions

What is a simple/minimal browserconfig.xml for a web site

I don't want to do anything special or tricky with respect to Windows 8 and pinning, I just don't want to see the 404 Not Found messages as IE looks for browserconfig.xml scrolling by in my log files.

Is there a trivial browserconfig.xml file that I can put in my root that will satisfy IE and act as a good place holder should I decide to later add better support for Window 8?


Source: (StackOverflow)

IE10 renders in IE7 mode. How to force Standards mode?

On microsoft's site they claim that simple doctype declaration is enough. But even a document as short as this falls back to IE7 mode:

<!DOCTYPE html>
<html>
<head>
   <title></title>
</head>
<body>

</body>
</html>


Source: (StackOverflow)

Advertisements

Making WPF applications look Metro-styled, even in Windows 7? (Window Chrome / Theming / Theme)

I like the window chrome on the new Office Suite and Visual Studio:

enter image description here

I'm still developing applications for Windows 7 of course, but I'm wondering if there's a quick and easy way (read: WPF style or Windows Library) to emulate this style. I've done some window chrome styling in the past, but getting it to look and behave just right is really tricky.

Does anyone know if there are existing templates or libraries to add a "Modern UI" look and feel to my WPF applications?


Source: (StackOverflow)

File extension for PowerShell 3

All of us probably know .bat for Batch files.

But what is the file extension for PowerShell 3 scripts?

I found .ps1 and some other endings but they're only for version 1.


Source: (StackOverflow)

Is there a way to convert a System.IO.Stream to a Windows.Storage.Streams.IRandomAccessStream?

In Windows 8; I would like to pass the contents of a MemoryStream to a class that accepts a parameter of type Windows.Storage.Streams.IRandomAccessStream. Is there any way to convert this MemoryStream to an IRandomAccessStream?


Source: (StackOverflow)

Can you force Visual Studio to always run as an Administrator in Windows 8?

In Windows 7, you could go into a programs compatibility settings and check off to always run as an Administrator. Is there a similar option in Windows 8?

I've always disabled UAC on my machines, and did the same after my Windows 8 upgrade, or so I thought. It turns out there is no off option, only turning off the notifications.

This means nothing is run as an Administrator despite being in the Administrator group. I need to keep closing and reopening my consoles\Visual Studio when I try to debug (attach to process, not F5), which is very frustrating.

It's really annoying that I need to either remember to take extra steps to open it as an Administrator or tell it to close and re-open when I go to debug for the first time.


Source: (StackOverflow)

Cannot serve WCF services in IIS on Windows 8

When I try to serve a WCF service on IIS in a Windows 8 machine, I get the well known error

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

The old work around was to run aspnet_regiis -i but this command seems to have been deprecated in Windows 8 yielding response This option is not supported on this version of the operating system. (...).

What would be the work around?

(I have successfully enabled regular aspx pages already, so most of the IIS config seems healthy.)


Source: (StackOverflow)

Is there a list of "standard" Tile colors for Metro style Windows 8 apps?

When I look at the start screen of my Windows 8 installation I see that bundled apps have colors from some standard(?) palette: IE and Weather have the same color, Store and Xbox Live Games, People and Music, Messaging and Maps, etc. It doesn't look like there's any logical connection between most of these apps. Yet their tiles share colors most likely coming from some standardized palette.

But when we create a Metro app in Visual Studio the Background color is preset to #464646 in a free form text field. So I wonder if there's some "official" list of the predefined colors we can use to make our own tiles "native" to Windows 8?

Obviously I can take a screenshot and pick a color from a bundled tile, but there has to be a better way and I've failed to find it so far.

Edit: apparently you can't even pick the color from a screenshot since a gradient is automatically applied to it by the OS:

If you make the space around the logo itself transparent in your image, your app's brand color (declared in the manifest) will show through with a gradient preapplied to it as part of the Windows 8 Release Preview look. http://msdn.microsoft.com/en-us/library/windows/apps/hh465403.aspx#using_default_tiles


Source: (StackOverflow)

How can a Metro app in Windows 8 communicate with a backend desktop app on the same machine?

In a situation where you have the UI frontend built using the new Metro style of apps for windows 8, and would like it to communicate with a .NET application running on the desktop on the same local machine (e.g. a windows service app).

What forms of interprocess communication are available between the metro app and the desktop app?

Thanks to Pavel Minaev of the Visual Studio team, who has provided some initial info here in a comment, quoted:

According to Martyn Lovell, there isn't any deliberate mechanism for that, and some that could be used for it are intentionally restricted. Named pipes aren't there, for example, nor are memory mapped files. There are sockets (including server sockets), but when connecting to localhost, you can only connect to the same app. You could use normal files in one of the shared "known folders" (Documents, Pictures etc), but that is a fairly crude hack that necessitates polling and is visible to the user. -- Pavel Minaev commenting on this issue

So failing normal approaches I was thinking of using web services or reading/writing to a database in order to get some form of communication happening, both of which seem like overkill when the processes are running on the same machine.

Is what I'm attempting here making sense? I can see a need for a metro app to be the frontend UI for an existing service which is running on the desktop. Or is it better to just use WPF for the frontend UI running on the desktop (i.e. a non-metro app).


Source: (StackOverflow)

How are live tiles made in Windows 8?

I've searched the samples, the developer site, the getting started and the enhancing bla bla bla pages.

Even using some search queries on Google, I can't seem any information on live tiles in Windows 8.

How do I create a live tile in Windows 8? What languages can be used for that? C#? XAML?


Source: (StackOverflow)

Why is WinRT unmanaged? [closed]

Windows 8 introduces WinRT, which is like .NET but unmanaged. Why is it unmanaged? Is it a performance issue? Does it mean garbage collection is not suitable for lower level APIs?


Source: (StackOverflow)

ListViewItem won't stretch to the width of a ListView

I'm currently designing a windows 8 store app using XAML but I have a minor sizing issue. I have a ListView with a DataTemple.

The code for my ListView & DataTemplate are below:

<ListView x:Name="listPageItems"
          Grid.Row="1"
          SelectionMode="Extended"
          IsSwipeEnabled="False"
          ItemsSource="{Binding Mode=OneWay, Source={StaticResource items}}"
          ItemTemplate="{StaticResource NavigationItemTemplate}"
          ScrollViewer.VerticalScrollBarVisibility="Visible">

</ListView>

<DataTemplate x:Key="NavigationItemTemplate">    
        <Grid Height="75">
            <Grid.RowDefinitions>
                <RowDefinition Height="1.6*" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Rectangle Fill="White" />
            <Rectangle Fill="{StaticResource SSEGreenBrush}"
                       Grid.Row="1" />
            <Border BorderThickness="2"
                    BorderBrush="{StaticResource SSEGreenBrush}"
                    Grid.RowSpan="2" />
            <TextBlock x:Name="textTitle"
                       Text="{Binding ClientName}"
                       Style="{StaticResource TitleTextStyle}"
                       Foreground="{StaticResource SSEBlueBrush}"
                       Margin="10,5,5,5" />
            <StackPanel Orientation="Horizontal"
                        Grid.Row="1"
                        HorizontalAlignment="Stretch">
                <TextBlock Text="Last Edit :"
                           Style="{StaticResource SubtitleTextStyle}"
                           Foreground="{StaticResource SSEBlueBrush}"
                           Margin="3,0,0,3"
                           VerticalAlignment="Center" />
                <TextBlock Text="SurveyDate"
                           Style="{StaticResource SubtitleTextStyle}"
                           Foreground="{StaticResource SSEBlueBrush}"
                           Margin="3,0,0,3"
                           VerticalAlignment="Center" />
            </StackPanel>
        </Grid>
    </DataTemplate>

The listview is within a grid column with a fixed width of 240.

When the view is displayed the ListViewItems don't stretch to the width of the ListView. I've tried setting numerous properties including the HorizontalContentAlignment but I can't seem to get the ListViewItem to stretch!

Can anybody help?

Thanks in advance.

I'm using Visual studio 2012, C# 4.5 and developing a Windows store app.


Source: (StackOverflow)

The request was aborted: Could not create SSL/TLS secure channel

We are unable to connect to an HTTPS server using WebRequest because of this error message:

The request was aborted: Could not create SSL/TLS secure channel.

We know that the server doesn't have a valid HTTPS certificate with the path used, but to bypass this issue, we use the following code that we've taken from another StackOverflow post:

private void Somewhere() {
    ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(AllwaysGoodCertificate);
}

private static bool AllwaysGoodCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors policyErrors) {
   return true;
}

The problem is that server never validates the certificate and fails with the above error. Does anyone have any idea of what should I do?

EDIT 1

I should mention that a colleague and I performed tests a few weeks ago and it was working fine with something similar to what I wrote above. The only "major difference" we've found is that I'm using Windows 7 and he was using Windows XP. Does that change something?


Source: (StackOverflow)

How to Distribute Compiled Windows 8 Metro Applications without Windows Store?

I am just curious if there is a way to package up a Windows 8 Metro application to distribute it to others with the Windows 8 Developer Preview installed? It would be nice to be able to allow someone to just download and install, rather than requiring them to install VS'11 Preview and compile the code themselves in order to test out / use a Windows 8 Metro application that I've built.

Is there a way to distribute a compiled Windows 8 Metro application for others to test/use since the Windows Store is not yet live?

This would likely be useful for testing Metro apps on non-development machines even after the Windows Store is live.


Source: (StackOverflow)

gem install json -v 1.7.3 gives 'Please update your PATH to include build tools'

When I run:

rails new blog

I get:

Installing json (1.7.3)
Gem::InstallError: The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occurred while installing json (1.7.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.3'` succeeds before bundling.

When I run:

gem install json -v 1.7.3

I get:

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

I'm using Windows 8. I do have c:\ruby193\bin in my path. What do I do to remedy these errors?


Source: (StackOverflow)