Quantcast
Channel: MSDN Blogs
Viewing all 12366 articles
Browse latest View live

[Sample Of Mar. 15] How to bubble an event from User Control to the web page in ASP.NET

$
0
0
Mar. 15 Sample : https://code.msdn.microsoft.com/How-to-bubble-an-event-458eb7c8 The sample code demonstrates how to bubble an event from User Control to the web page in ASP.NET. You can find more code samples that demonstrate the most typical programming scenarios by using Microsoft All-In-One Code Framework Sample Browser or Sample Browser Visual Studio extension . They give you the flexibility to search samples, download samples on demand, manage the downloaded...(read more)

Checklist: Performance do Servidor (SQL)

$
0
0

Podemos criar um breve checklist sobre como validar a infraestrutura de um servidor SQL usando o Performance Monitor.

Artigo complementar: Checklist: Performance do Servidor (Windows)

Desafio: Analisando Servidor com Perfmon

O primeiro passo na análise do SQL Server no Performance Monitor é criar um baseline inicial para caracterizar a carga. Depois, complementamos com informações sobre a utilização de memória pelos componentes internos do SQL.

 

Baseline do SQL Server

Esses contadores devem ser usados para ajudar a caracterizar a carga no banco de dados:

General Statistics

  • Connection Reset/sec: taxa de sessões reiniciando a sessão através do connection pooling
  • Logins/sec: taxa de autenticações no servidor
  • Logouts/sec: taxa de usuários desconectando do servidor
  • User Connections: quantidade de sessões de usuários

SQL Statistics

  • Batch Requests/sec: taxa de requisições recebidas por segundo
  • Safe Auto-Params/sec: taxa de autoparametrização (auto-param) realizadas
  • Forced Parametrizations/sec: taxa de parametrização forçada (forced-param) realizadas
  • SQL Compilations/sec: taxa de compilação pelo otimizador
  • SQL Re-Compilations/sec: taxa de recompilação pelo otimizador

Existem valores e sugestões para esses contadores. No entanto, o mais importante é ter um baseline para comparação futura.

 

Buffer Manager: Consumo de Memória

A memória do servidor SQL Server pode ser observada melhor com o auxílio dos contadores:

  • Buffer Manager: Page life expectancy: verificar se esse valor se mantém constante ou subindo ao longo do tempo. O cálculo do Page Life Expectancy é mais complexo em máquinas NUMA e corresponde a uma média harmônica entre os nós. As quedas desse contador indicam o momento de aumento de carga. Valores de referência:
    • <10 : excessivamente baixo, podendo gerar erros, asserts e dumps
    • <300 : baixo
    • 1000: razoável
    • 5000 : bom
  • Buffer Manager: Free list stalls/sec: garantir que é sempre zero. A ocorrência de stall significa que as threads foram congeladas e estão todas trabalhando em conjunto com o Lazy Writer para a liberação de memória. Em geral, esse comportamento ocorre quando o Page Life Expectancy fica próximo de zero.
  • Buffer Manager: Lazy writes/sec: usar esse número como baseline. O processo de Lazy Writer (LW) ocorre lentamente em background. Quando esse contador aumenta, isso pode significar que a memória livre está baixa e, por isso, o servidor acelerou o processo do LW.
  • Buffer Manager: Page lookups/sec: usar esse número como baseline. 
  • Buffer Manager: Page reads/sec: usar esse número como baseline de comparação com as operações de leitura em disco (Read IOPS). Podemos estimar que cada Page Read corresponde a um I/O de leitura no disco.
  • Buffer Manager: Readahead pages/sec: usar esse número como baseline de comparação com as taxas de leitura no disco (MB/s). Podemos dizer que cada Readahead page corresponde a 8Kb de leitura sequencial no disco.

 

Distribuição de Memória do SQL Server

A distribuição de memória do Database Cache pode ser observada com os contadores:

  • Database pages: número de páginas correspondente ao Database Cache.  
  • Free pages: número de páginas livres no Buffer Pool. Se a quantidade de páginas livres ficar constante (acima de 1000), então está sobrando memória.
  • Stolen pages: quantidade de páginas dedicadas para tarefas internas do banco de dados (compilação, execução, object cache). Quanto maior for o número de stolen pages, menos páginas ficarão disponíveis para o Database Cache. Sugestão de valores:
    • 25% : normal
    • 50% : relativamente alto, pode causar pressão de memória interna – exceto se houver muitas Free Pages disponíveis
    • 75% : excessivamente alto, investigar qual o Memory Clerk responsável pelo consumo – exceto se houver muitas Free Pages disponíveis
  • Target pages: total de páginas a ser alcançado pelo SQL Server em um futuro. Monitorar se existem quedas bruscas nesse valor, que indicaria uma pressão de memória externa.
  • Total pages: total de páginas alocadas pelo SQL Server.
    • Target pages = Total pages : normal
    • Target pages > Total pages : warmup do servidor ou a memória está sobrando
    • Target pages < Total pages : enquanto essa condição for verdadeira, o Lazy Writer estará trabalhando agressivamente para reduzir o número de páginas até igualar ao Target Page.

 

Referência

Os demais artigos dessa série estão listados abaixo.

Artigo: Perfmon- Falso Sentido de Monitoração

Artigo: Os 7 Grandes Mitos do Perfmon:

Artigo: Contadores do Perfmon

Desafio: Analisando Servidor com Perfmon

Artigo: Monitorando com o Perfmon

Checklist

Microsoft to acquire Xamarin: Build native mobile apps on any platform using C#

$
0
0

In the last week of February, Microsoft has signed an agreement to acquire Xamarin, a leading platform provider for mobile app development. In conjunction with Visual Studio, Xamarin provides a rich mobile development offering that enables developers to build mobile apps using C# and deliver fully native mobile app experiences to all major devices – including iOS, Mac OS, Android, and Windows.

Xamarin’s approach enables developers to take advantage of the productivity and power of .NET to build mobile apps, and to use C# to write to the full set of native APIs and mobile capabilities provided by each device platform. This enables developers to easily share common app code across their iOS, Android and Windows apps while still delivering fully native experiences for each of the platforms.

Through the Xamarin Test Cloud, various types of mobile developers including C#, Objective-C, Java and hybrid app builders can test and improve the quality of apps using thousands of cloud-hosted phones and devices.

With the announcement of the acquisition, we will make our world class developer tools and services even better with deeper integration and seamless mobile app development experiences. The combination of Xamarin, Visual Studio, Visual Studio Team Services, and Azure provides a complete mobile app development solution that provides everything needed to develop, test, deliver and instrument mobile apps for every device.

More information and plans for the future will be shared at the //Build 2016 conference in San Francisco coming up on March 29 at 5pm (CET). Make sure you don’t miss the keynotes streamed live on the //Build website.

And just a quick reminder that during the whole month of March 2016, you have a chance to win daily prizes when watching select top, free online trainings for developers, IT and database professionals and students on our “31 Days of Learning” website.

Microsoft übernimmt Xamarin: Erstellen nativer mobiler Apps auf jeder Plattform mit C#

$
0
0

In der letzten Februarwoche unterzeichnete Microsoft einen Vertrag zur Übernahme von Xamarin, einem führenden Plattform-Anbieter für die Entwicklung mobiler Apps. In Verbindung mit Visual Studio bietet Xamarin eine umfangreiche Basis für mobile Entwicklungen, um mobile Apps mit C# zu erstellen und vollständig native mobile Apps für alle wichtigen Geräte zu liefern, wie z.B. iOS, Mac OS, Android und Windows.

Mit Xamarin können Entwickler die Produktivität und Leistungsfähigkeit von .NET für die Erstellung mobiler Apps nutzen und mit C# für die Gesamtheit nativer APIs und mobiler Einsatzmöglichkeiten schreiben, welche die jeweilige Plattform bietet. Damit können Entwickler ganz leicht gemeinsamen App-Code für ihre iOS-, Android- und Windows-Apps nutzen und dabei vollständig native Benutzeroberflächen für jede der Plattformen schaffen.

Über die Xamarin Test Cloud können verschiedene Mobilentwickler, wie C#-, Objective-C-, Java- und Hybrid-App-Builder, die Qualität der Apps mit Tausenden von cloud-gehosteten Phones und Geräten testen und verbessern.

Die Bekanntgabe der Übernahme bedeuten noch bessere Entwicklertools und -services von Weltrang durch verstärkte Integration und mobile App-Entwicklungen, die sich nahtlos einfügen. Die Kombination von Xamarin, Visual Studio, Visual Studio Team Services und Azure bietet eine komplette Mobile-App-Entwicklungslösung, die alles mit sich bringt, was für Entwicklung, Testen, Bereitstellung und Ausrüstung mobiler Apps für jedes Gerät benötigt wird.

Weitere Informationen und Pläne für die Zukunft erfahren Sie auf der Konferenz //Build 2016 in San Francisco, die am 29. März um 17.00 (CET) beginnt. Notieren Sie sich als wichtigen Termin die Keynotes, die auf der //Build Website live gestreamt werden.

Und nur kurz zur Erinnerung: Im ganzen Monat März 2016 haben Sie die Chance, täglich Preise zu gewinnen, wenn Sie exklusive kostenlose Top-Online-Kurse für Entwickler, IT- und Datenbankprofis und Studenten auf unserer Website «31 Days of Learning» ansehen.

Microsoft rachète Xamarin: développez des applications mobiles sur n'importe quelle plate-forme au moyen de C#

$
0
0

La dernière semaine de février, Microsoft a signé un accord afin de racheter Xamarin, le fournisseur d'une plate-forme de développement d'applications mobiles qui est l'un des leaders dans ce secteur. Associé à Visual Studio, Xamarin fournit une riche offre d'outils de développement qui permet aux développeurs de développer des d'applications mobiles en C# et de fournir une expérience mobile native sur tous les appareils, comme ceux sous iOS, Mac OS, Android, et Windows.

L'approche de Xamarin permet aux développeurs de bénéficier de la productivité que leur procure .NET et de la puissance de ce dernier afin de développer des applications mobiles et d'utiliser C# afin d'écrire toutes les API natives et d'exploiter toutes les fonctionnalités mobiles de toutes les plates-formes. Ils peuvent ainsi partager facilement le code commun entre les applications iOS, Android et Windows tout en fournissant une expérience native pour chaque plate-forme.

Grâce au cloud de test Xamarin, différents types de développeurs d'applications mobiles, comme ceux qui développent en C#, Objective-C, Java et ceux qui développent des applications hybrides peuvent tester et améliorer la qualité de leurs applications au moyen des milliers de téléphones et d'appareils qui y sont hébergés.

Ce rachat nous permet d'améliorer encore nos outils et nos services de développement de pointe grâce à une intégration plus poussée ainsi qu'à une expérience de développement d'applications mobiles parfaite. L'association de Xamarin, de Visual Studio, de Visual Studio Team Services et d'Azure fournit une solution complète de développement d'applications mobiles qui comporte tout ce qu'il faut afin de développer de tester, de livrer et d'implémenter les applications mobiles pour tous les appareils.

Nous communiquerons de plus amples informations et nos futurs projets à la conférence //Build 2016 qui se déroulera à San Francisco le 29 mars prochain à 17h00 (heure d'Europe centrale). Ne manquez pas les keynotes qui seront diffusées en direct en streaming sur //Build website.

Juste un petit rappel pour finir: n'oubliez pas que vous pouvez gagner des prix tous les jours du mois de mars 2016 en regardant nos formations vidéo en ligne destinées aux développeurs, aux professionnels de l'informatique, aux spécialistes des bases de données et aux étudiants sur notre site Web «31 Days of Learning».

Пришло твое время спасать мир с помощью …кода!

$
0
0

Прими участие в конкурсе «Магистр кода». Выбери за какую команду сражаешься ты: Бэтмена или Супермена. Разработай оригинальное мобильное приложение, игру или сайт, которые помогут людям, прокачай свои навыки программирования и выиграй суперкомпьютер Predator 15 для настоящих героев!

И не пропусти фильм Бэтмен против Супермена: На заре справедливости!

Зарегистрироваться для участия в конкурсе можно на сайте - http://aka.ms/masterofcode2016

Workflow Manager 1.0 Refresh Disaster Recovery (further) Explained

$
0
0

Premier Developer Consultant Brian Gregor recently took some time on his blog to document his experiences implementing disaster recovery for Workflow Manager.  The following is an excerpt from his post, get the full story over at Brian’s blog Nose to the GrindStone:


With the release of SharePoint 2013, Microsoft released a new platform for workflows called Workflow Manager (WFM). As of this writing the current version is 1.0 Cumulative Update 3. Unfortunately disaster recovery (DR) for this product is not as straight forward as just setting up database replication.

Following are a list of resources I’ve used to implement disaster recovery:

I found that each of the above references hold vital clues to making DR for WFM work, but none of them had details upon which I was stumbling. There are two basic concepts where I needed to do additional research:

    • Certificates (which ones to use where and how to restore effectively)
    • Changing service accounts and admin groups upon a failover

As pointed out there are plenty of TechNet articles and blogs that talk about how to do WFM Disaster Recovery (DR), so I am not going into detail on the individual steps, but I decided to document my discoveries in hopes that others can benefit from my experiences.

So, at a high level, the basic operation is as follows. I’ll have sections below describing each of the areas where I had concerns:

    • Install production WFM and configure
    • Configure your backup/replication strategy for the WF/SB databases
    • Install WFM in DR
    • Execute the failover process
    • Re-connect SharePoint 2013
    • (Optional) Changing RunAsAccount and AdminGroup

Check out the full article here:

https://blogs.msdn.microsoft.com/briangre/2016/02/24/workflow-manager-1-0-refresh-disaster-recovery-further-explained/

SharePoint 2016 und Project Server 2016 RTM

$
0
0
Seit gestern ist SharePoint 2016 'Release to Manufacturing' (RTM) und mit SharePoint auch der Project Server 2016, der als Teil von SharePoint 2016 vertrieben wird. Derzeit ist eine Trial Version vom RTM Release zum Herunterladen verfügbar. Über das Microsoft Volume Licensing Service Portal wird SharePoint 2016 erst im Mai verfügbar sein. Dieses RTM Datum steht gleichzeitig auch für die generelle Verfügbarkeit von Cloud Hybrid Suche für SharePoint 2013 und höher...(read more)

Temporary Post Used For Theme Detection (0eb9ce31-cc22-442d-a120-2feb5079d80e - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

$
0
0

This is a temporary post that was not deleted. Please delete this manually. (b88e37e8-5a62-43da-84c2-d3c5046066da - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

Temporary Post Used For Theme Detection (2eaf7ade-a278-4530-900e-752d4a70b3a2 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

$
0
0

This is a temporary post that was not deleted. Please delete this manually. (de3f454a-82a9-4ff3-b026-e170d0a729af - 3bfe001a-32de-4114-a6b4-4005b770f6d7)

SQL Server 2016: Changes in default behavior for autogrow and allocations for tempdb and user databases

$
0
0

Configuration of TEMPDB is often critical to scalability and throughput of SQL Server applications. The following link (https://support.microsoft.com/en-us/kb/2964518) outlines how to configure SQL Server 2012 and SQL Server 2014 for optimal scalability and performance.

A SQL Server 2016 primary goal was ‘It Just Works.’ Out of the box a customer should not have to engage in such documentation and tuning exercises. Whenever possible SQL Server should just work and provide the intended scalability and performance outcomes.

TEMPDB

In the past, we have recommended customers to turn on trace flags 1117 and 1118 for applications that use tempdb heavily. However, adding these flags as startup parameters had an impact for the entire instance as opposed to just tempdb.

  • -T1117 – When growing a data file grow all files at the same time so they remain the same size, reducing allocation contention points.
  • -T1118 – When doing allocations for user tables always allocate full extents. Reducing contention of mixed extent allocations

In SQL Server 2016, the functionality provided by TF 1117 or 1118 will be automatically enabled for tempdb. This means, a customer will no longer have to enable these trace flags for a SQL Server 2016 instance.

User Databases

For User Databases, trace flags 1117 and 1118 have been replaced with new extensions in ALTER DATABASE commands. Use the ALTER DATABASE syntax to enable or disable the desired trace flag behavior at a database level.

Trace Flag 1118

    1. Trace flag 1118 for user databases is replaced by a new ALTER DATABASE setting – MIXED_PAGE_ALLOCATION.
    2. Default value of the MIXED_PAGE_ALLOCATION is OFF meaning allocations in the database will use uniform extents.
    3. The setting is opposite in behavior of the trace flag (i.e. TF 1118 OFF and MIXED_PAGE_ALLOCATION ON provide the same behavior and vice-versa).

Syntax

ALTER DATABASE <dbname> SET MIXED_PAGE_ALLOCATION { ON | OFF }

For more information, see https://msdn.microsoft.com/en-US/library/bb522682.aspx

Example

–Default value is OFF so all allocations in AdventureWorks will use uniform extents. To disable and use mixed extents turn the setting to on.

ALTER DATABASE AdventureWorks SET MIXED_PAGE_ALLOCATION  ON;

Catalog changes

A new column is_mixed_page_allocation_on is added to DMV sys.databases that shows which allocation type (uniform or mixed) is being used. For more information see, https://msdn.microsoft.com/en-us/library/ms178534.aspx

Trace Flag 1117

  1. Trace flag 1117 for user databases is replaced by a new ALTER DATABASE setting at the FILEGROUP level.
  2. Default value is to grow a single file – AUTOGROW_SINGLE_FILE (which is same as the trace flag not being enabled).
  3. This setting is at the file group level (not the entire database level).
  4. For a database that contains many files, the AUTOGROW_ALL_FILES setting has to be to enabled for each filegroup.

Syntax

ALTER DATABASE <dbname> MODIFY FILEGROUP <filegroup> { AUTOGROW_ALL_FILES | AUTOGROW_SINGLE_FILE } 

For more information see https://msdn.microsoft.com/en-us/library/bb522469.aspx

Example

–Default value is AUTOGROW_SINGLE_FILE for all files in all filegroups. To enable growth for all files in a file group in AdventureWorks run the following ALTER DATABASE statement.

ALTER DATABASE AdventureWorks MODIFY FILEGROUP [PRIMARY] AUTOGROW_ALL_FILES;

Catalog changes

A new column is_autogrow_all_files is added to DMV sys.filegroups that shows which growth setting is being used. For more information see, https://msdn.microsoft.com/en-us/library/ms187782.aspx

Summary

Use this table for guidance on configuring the settings described in this blog for SQL Server 2016.

 

Database

TF 1117

TF 1118

tempdb

Not required (default)

Not required (default)

user databases

Default behavior will grow single file. Use ALTER DATABASE <dbname> MODIFY FILEGROUP [PRIMARY] AUTOGROW_ALL_FILES to grow all files in the filegroup.

Not required (default). Use ALTER DATABASE <dbname> SET MIXED_PAGE_ALLOCATION  ON to go back to using mixed extents

Other system databases
(master, model, msdb)

-NA-

Allocations use mixed page extents, cannot be changed.

Ajay Jagannathan (@ajayMSFT)

Principal Program Manager

The OWIN OpenID Connect Middleware

$
0
0

This chapter from Modern Authentication with Azure Active Directory for Web Applications, by Vittorio Bertocci, focuses on the OpenID Connect middleware and supporting classes. These are the cornerstones of ASP.NET’s support for web sign-on.

As you saw in Chapter 5, “Getting started with web sign-on and Active Directory,” in the most common case, the OpenID Connect middleware requires very few parameters to enable web sign-on. Beneath that simple surface, however, are knobs for practically anything you want to control: protocol parameters, initialization strategies, token validation, message processing, and so on. This chapter will reveal the various layers of the object model for you, showing how you can fine-tune the authentication process to meet your needs.

OWIN and Katana

When I wrote Programming Windows Identity Foundation (Microsoft Press) in 2009, I didn’t have to spend much time explaining HttpModule, the well-established ASP.NET extensibility technology on which WIF was built. This time around, however, I cannot afford the luxury of assuming that you are already familiar with OWIN and its implementation in ASP.NET—this is the foundational technology of the new generation of authentication libraries.

OWIN is a stable standard at this point, but its implementations are still relatively new technologies. You can find plenty of information online, but the details are rapidly changing (as I write, ASP.NET vNext is in the process of renaming lots of classes and properties), and you need to have a solid understanding of the pipeline and model underlying the identity functionality.

In this section I provide a quick tour of OWIN (as implemented in Katana 3.0.1) and the features that are especially relevant for the scenarios I’ve described throughout the book. For more details, you can refer to the online documentation from the ASP.NET team.

Read the complete chapter here.

New DMF for retrieving input buffer in SQL Server

$
0
0

A new DMF for retrieving the input buffer for a session/request (sys.dm_exec_input_buffer) is now available in SQL Server 2016 RC0. This is functionally equivalent to DBCC INPUTBUFFER.

However, this has a few advantages over DBCC INPUTBUFFER.

  • Directly returns a rowset.
  • Can be conveniently used with sys.dm_exec_sessions or sys.dm_exec_requests by doing a CROSS APPLY.
  • Can use a simple query to retrieve input buffer of multiple sessions without the need for a script and temp table.

For example:

SELECT es.session_id, ib.event_info 
FROM sys.dm_exec_sessions AS es 
CROSS APPLY sys.dm_exec_input_buffer(es.session_id, NULL) AS ib 
WHERE es.session_id > 50
 
Results:
 
session_id event_info
---------- ---------------------------------------------------------------------------
51         select value_in_use from sys.configurations where configuration_id = 16384
52         SELECT es.session_id, ib.event_info FROM sys.dm_exec_sessions AS es CROSS APPLY sys.dm_exec_input_buffer(es.session_id, NULL) AS ib WHERE es.session_id > 50;
53         (@source nvarchar(256),@sourceopt int)SELECT type, data FROM sys.fn_MSxe_read_event_stream (@source, @sourceopt)

 

Ajay Jagannathan (@ajayMSFT)

Principal Program Manager

We’ve Moved!

$
0
0

The Microsoft Green Blog is getting a fresh look! Check out our latest posts by visiting: http://www.microsoftgreen.com. And don’t forget to bookmark the new site to learn more about Microsoft’s ongoing commitment to carbon neutrality and renewable energy. You can also follow us on Twitter at @Microsoft_Green or on Facebook. Thanks for visiting!



Investigating Issues with Search feature in Visual Studio Team Services - 3/15 - Resolved

$
0
0
Final Update: Wednesday, 16 March 2016 04:54 UTC

The issue is confirmed to be resolved for the subset of customers across different regions who were impacted due to this incident. Customers should now be able to access the Search feature without any problems. 

We understand that customers rely on VS Team Services as a critical service and apologize for any impact this incident caused.

Sincerely,
Manjunath


Update: Wednesday, 16 March 2016 03:12 UTC

Our DevOps team continues to work on the issue in Search feature and have root caused the issue. We are working on deploying the fix across the impacted regions to resolve the issue. We apologize for any inconvenience.

Sincerely,
Manjunath


Initial Update: Tuesday, 15 March 2016 23:24 UTC

We are actively investigating issues with the Search feature across multiple regions. Some customers may not be able to obtain complete results while using the Search service.

We are working to resolve this issue and apologize for any inconvenience.

Sincerely,
Manjunath

 
 

 


Investigating issues with Cloud Load Test service on Visual Studio Team Services - 3/16 - Resolved

$
0
0

Update: Wednesday, 16 March 2016 01:59 UTC

 
We have mitigated the issue with a work around to avoid the customer impact. The customers should not see issues on the load test runs.

We apologize for any inconvenience caused.


Sincerely,
Vamsi

 


 

Update: Wednesday, 16 March 2016 06:14 UTC


We have identified an issue with background job execution which lead customer load test runs moved to error state.  We are working on applying necessary steps to mitigate the issue.

We sincerely apologize for any inconvenience caused.


Sincerely,
Vamsi

 


Update: Wednesday, 16 March 2016 03:15 UTC
 

Our DevOps team continues to investigate issues with Cloud Load Test feature in Visual Studio Team Services. Root cause is not fully understood at this time. Some customers might continue to experience errors in their runs.  We currently have no estimated time for resolution. We are working towards the resolution of the incident and apologize for any inconvenience.


Sincerely,
Manjunath


Initial Update: Wednesday, 16 March 2016 01:00 UTC

We are actively investigating issues with Cloud Load Test service in the East US region. Some customer runs might reach into error state.

 
We are working to resolve this issue and apologize for any inconvenience.

Sincerely,
Manjunath

 

 

[Sample Of Mar. 16] How to retrieve the contents of the content control in Word using Open XML SDK

$
0
0
Mar. 16 Sample : https://code.msdn.microsoft.com/How-to-retrieve-the-b2366062 This sample reads the contents of content control from a word document by using OpenXML SDK and displays it into the console window. You can find more code samples that demonstrate the most typical programming scenarios by using Microsoft All-In-One Code Framework Sample Browser or Sample Browser Visual Studio extension . They give you the flexibility to search samples, download samples on...(read more)

Опубликованы видеозаписи трансляции презентации платформы управления данными на базе SQL Server 2016

$
0
0

10 марта состоялась онлайн-трансляция мероприятия из Нью-Йорка, в рамках которого генеральный директор Microsoft Сатья Наделла и другие руководители корпорации презентовали новый SQL Server 2016 и рассказали о том, как с помощью анализа данных компании трансформировать свой бизнес и отрасль в целом.
Смотрите видео

 

 

 

Getting your Azure Subscription GUID

$
0
0

 

1. Navigate to http://portal.azure.com

2. Navigate to Browse

3. In the search box being to type subscription

4. Select Subscription from the search results (see below)

image

5. Find the appropriate subscription and see your Azure subscription GUID  (see below)

image

A tip on how to find some high contrast bugs

$
0
0

This post suggest a quick way to detect some severe bugs that can impact your customers who use high contrast themes.

 

Thinking about high contrast is not all black and white

When designing your app, you’ll have spent a lot of time and effort choosing the default colors shown in your UI. And many of your customers will love those colors! The app looks so cool!

Other customers however will find it more practical to leverage all the great functionality in your app by having specific colors shown which work best for them. Perhaps white or yellow text on a black background will make it quick and easy for them to use your app. So those customers might go to the Ease of Access section in the Settings app, and select a High Contrast theme. The screenshot below shows the theme called “High Contrast Black” being selected in the Settings app.

 
Figure 1: Selecting the High Contrast Black theme in the Settings app.

 

A very important point here is that many customers who choose to use high contrast themes, will customize the colors shown to be the colors that work best for them. So perhaps a customer might select the theme called “High Contrast Black” as a fair starting point, but then they’ll change specific elements of that theme in whatever way they prefer. For example, maybe the colors used for selected text and its background might be changed.

And this is why it’s so important for app devs to consider how UI will be presented when a high contrast theme is active. That is, we never think of specific colors like (say) black or white, but instead we think of UI elements like selected text and selected text background.

 

So what can my customer customize?

In the screenshot above, there are eight UI element colors that your customer can customize. These are:

Text
Background
Button text
Button text background
Selected text
Selected text background
Disabled text
Hyperlink text

 

If you present a Button and don’t customize its colors, then it’ll look just fine when a high contrast theme is active. Its text will be presented using whatever color your customer’s chosen for button text, and its background will be presented using whatever color your customer’s chosen for button text background. So you had to take no action whatsoever to respect your customer’s wishes.

But once you start presenting custom colors, your customers will need you to specify what colors should be used when a high contrast theme is active. Building accessible Windows Universal apps: Colors and contrast discusses how by specifying SystemColorButtonTextColor and SystemColorButtonFaceColor, you don’t have to care what color is being used for the button text, but you’ll know it’s what your customer wants.

In order for you to consider what’s best for your customers, you need a mapping from the UI elements shown in the Settings app, to the various SystemColor* colors that you’ll specify in your code. And this is one of the reasons why Mike’s post at XAML theme resources is so valuable. It includes a table with the following data in it.

 

 Key  Ease of Access name
 SystemColorWindowTextColor Text
 SystemColorWindowColor Background
 SystemColorButtonTextColor Button Text (foreground)
 SystemColorButtonFaceColor Button Text (background)
 SystemColorHighlightTextColor Selected Text (foreground)
 SystemColorHighlightColor Selected Text (background)
 SystemColorGrayTextColor Disabled Text
 SystemColorHotlightColor Hyperlinks

 

So if you feel that some custom UI in your app should show text in the selected text color, with a background of the selected text background color, then in your code you’d specify SystemColorHighlightTextColor for the text and SystemColorHighlightColor for the background.

    <Button …
        Background="{ThemeResource MyButtonBackground}"
        Foreground="{ThemeResource MyButtonForeground}" />

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.ThemeDictionaries>
               
                <ResourceDictionary x:Key="Default">
                    …
                </ResourceDictionary>

                <ResourceDictionary x:Key="Light">
                    …
                </ResourceDictionary>

                <ResourceDictionary x:Key="HighContrast">
                    <SolidColorBrush x:Key="MyButtonBackground"
                        Color="{ThemeResource SystemColorButtonFaceColor}" />
                    <SolidColorBrush x:Key="MyButtonForeground"
                        Color="{ThemeResource SystemColorButtonTextColor}" />
                </ResourceDictionary>

            </ResourceDictionary.ThemeDictionaries>
        </ResourceDictionary>
    </Application.Resources> 

 

More information on implementing high contrast UI can be found at Supporting high-contrast themes (XAML) and Supporting high contrast themes (HTML).

 

So what’s the tip on finding bugs?

When designing your UI, you’ll be considering which of the various UI element colors are most appropriate for you to show. For example, if you have a custom UI that behaves like a link, then your customer will expect the text to be shown using the color appropriate for links. From the table above I can see that I’d use SystemColorHotlightColor for that. Similarly, disabled text would be shown with SystemColorGrayTextColor.

But something occurred to me recently. What would happen if I did a test where I’d customize all text to be in one color, and all background to be in another? Doing that would be no help at all in detecting problems where the wrong color amongst text, button text, selected text, disabled text or hyperlink text was being used, but maybe some big problems would immediately jump out at me. Perhaps I’d find some text and its background both being shown in a text color, or both being shown in a background color, such that the text becomes invisible.

Actually, one thing I’d have to be careful of is where text and its background are shown in both the same color, and that color is the same as the background around it. In that case some UI might be invisible and as a sighted user, I wouldn’t know it’s missing.

So I gave this a go. I set all text to be red, and all backgrounds to be yellow. I didn’t want to use a darker color for the text, as then I might have a hard time recognizing when text was being shown in black inappropriately. (Remembering that a classic high contrast bug is when the UI uses a hard-coded black or white color.)

I called this new custom theme “Red and Yellow”. I made sure to restart any feature I was going to examine after changing the theme, in case the feature only picked up the custom colors when the feature was started.

 

 

Figure 2: Creating a new custom theme called “Red and Yellow” in the Settings app.

 

Overall, things looked pretty good in most of the UI that I then examined. The screenshots below show some UI respecting my custom colors for text and the background behind text.

 

 

Figure 3: Calculator app respecting custom theme colors.

 

 

Figure 4: Start Menu respecting custom theme colors.

 

Having said that, in the screenshot above, I’d imagine that on the tiles where the backgrounds are solid yellow, it’d be preferable if the app icons were shown in red. Also, there are some cases where text bumps up next to the edge of the solid background color behind it. It’d seem preferable if there was some background color padding around the text. For example, the mock screenshot below shows the Weather tile with some padding around the text, to provide an increased and consistent contrast between its text and the background around the text. (In some cases, I expect the tile dev would feel it's most helpful to the customer to only show theme colors in the tile when a high contrast theme is active.)

 

 Figure 5: Start Menu tile with more background color shown around its text.

 

So a bunch of apps did a great job at respecting my custom colors. However, there also seemed to be some UI which didn’t respect my choice of colors. I hit a few types of problems, including the following:

1. Some text which by default appeared white on a gradient black background, appeared with my custom theme as red text on a transparent background. Given that a photo was shown beneath the text, the text became invisible depending on the contents of the photo. Instead of using a transparent background, I’d imagine it’d be best if the background was shown in a solid background color. (One of SystemColorWindowColor, SystemColorButtonFaceColor or SystemColorHighlightColor depending on which color was being used for the text.)

2. A few apps contained buttons where the buttons vanished completely when I hovered the mouse over them.

3. The UI shown in the screenshot below had a black background, and so the text shown was red on black, with relatively low contrast. So it seems that the black background was hard-coded for that UI, rather than using the SystemColorWindowColor color, (or another background color depending on what color was being used for the text).

 

Figure 6: A background shown in black, instead of a background color from my custom theme.

 

4. And I also hit one app where some big blocks containing text changed to be filled with one solid color, as shown in the screenshot below. 

 

Figure 7: App showing four UI elements where text and the text background are presented in the same color.

 

I was particularly curious about this last point, where the app was showing the text and background in the same color. So I went back to my custom theme, and tweaked it such that different types of text and background were shown in different colors. By doing that, I could learn that the problematic text was being shown in the Selected Text color, and its background in the Hyperlinks text color. So both text and background were being shown in colors meant for text. Assuming the text should be shown in the Selected Text color, then the customer will want the background to be shown in the Selected Text Background color. And that means this bug can be fixed by changing the background color from SystemColorHotlightColor (meant for link text) to SystemColorHighlightColor (meant for selected text background).

 

Conclusion

It only takes a few seconds to create a test theme where all text is one color, and all backgrounds are another color. If you then whizz through all your app’s UI, you can quickly get a feel for where a text color or a background color might be being used inappropriately.

This can help avoid a number of bugs which are commonly hit close to shipping, relating to the use of the “High Contrast White” theme. During development, devs often stick to testing with only one high contrast theme, such as “High Contrast Black” or “High Contrast #1”. But while their UI might seem ok in the theme they’re using, testing with only one theme might hide bugs where some text or background has been hard-coded with a color similar to one in the theme they’re using. So the dev thinks all is well, until someone else tries running their app with the “High Contrast White” theme, and a bunch of bugs are logged with little time to fix them before shipping.

A quick test with a custom theme as described in this post could help to get a head start on some of the high contrast bugs that are heading towards your customer. And then a more careful examination using both a light-on-dark theme and dark-on-light theme, (such as “High Contrast Black” and “High Contrast White” respectively,) will give you confidence that your customer will get the colors they want and need for text, button text, selected text, disabled text and hyperlink text.

Guy

 

Viewing all 12366 articles
Browse latest View live