wwer
MSDN Blogs: ttttw
MSDN Blogs: 在Centennial project中使用C++运行环境
[原文发表地址]Using Visual C++ Runtime in Centennial project
[原文发表时间] 2016/7/7
前言:
在VS2015的更新中,我们提出了Desktop Bridge(以前叫做Project Centennial),给UWP添加桌面应用程序。利用桌面应用程序转换器,你可以把你的桌面应用程序打包成一个appx包部署到window10 桌面上。参考链接https://developer.microsoft.com/en-us/windows/bridges/desktop可以对Desktop Bridge了解更多. 如果你想转换你的C++ 桌面应用程序(如:win32, MFC等等), 你就必须处理VC++运行配置,例如vcruntime140.dll,像平时对C/C++应用程序所做的操作一样。
我们对 VC++ 11.0版本,12.0版本和14.0版本提供了Visual C++运行环境支持。通过Window存储, 集中部署VC++ runtime DLLs. 这个Runtime是CRT, STL, ConCRT, MFC, ATL和C++ amp 建立的桌面Visual C++库。从Window下载中心可以下载这些可用的VC++ runtime服务版本:
- VC 14.0 framework packages for Desktop Bridge
- VC 12.0 framework packages for Desktop Bridge
- VC 11.0 framework packages for Desktop Bridge
关于应用程序开发,我们为VC++14.0(VS2015),VC++12.0(VS2013)和VC++(VS2011)的C运行创建了带有桌面库的框架包。此安装程序将把框架包放在扩展SDKs文件夹下: %PROGRAMFILES(X86)%Microsoft SDKsWindows Kits10ExtensionSDKs
我们新建的框架包将会包含下列所有的Visual C++ Runtime组件:debug x86,debug x64,release x86,release x64.
从转换的桌面应用中引用VC Runtime框架包:
1.首先,确定你已经设置为使用Desktop Bridge (Centennial).参考说明Desktop App Converter Preview (Project Centennial).
2.运行转换器然后安装Win32应用程序。转换器 会捕捉到布局配置,注册表变动和Appx列表输出。
3.在Appx布局中,修改AppxManifest.xml,通过在<Dependencies> 元素下添加<PackageDependency>元素给VCLibs UWPDesktop框架包添加引用:
<PackageDependency Name=”Microsoft.VCLibs.140.00.UWPDesktop” MinVersion=”14.0.24217.0″ Publisher=”CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US” />
然后,从appx配置中移除C++ Runtime dll. 推荐通过框架包来消耗runtime。
注意:用桌面应用转换器v0.1.23,转换器将自动检测VCLibs依赖并将包依赖项添加到AppxManifest.xml文件中。同时也会移除所有本地拷贝的C++runtime dlls.
4.根据你的目标配置和架构安装VCLibs UWPDesktop 框架包。使用加载appxpackage命令行开关。
例如: 如果的应用程序目标是X86 Retail配置,打开powershell:
a. Goto %PROGRAMFILES(X86)%Microsoft SDKsWindows Kits10ExtensionSDKsMicrosoft.VCLibs.Desktop14.0AppxRetailx86
b. Add-appxpackage Microsoft.VCLibs.x86.14.00.Desktop.appx
5.使用add-appxpackage-register AppMainfest.xml 命令行工具配置你的应用程序或者使用MakeAppx重新包装它。
这里可以看到此选项的更多细节。
调试程序:
配置应用程序的调试版本,将一个PackageDependency添加到调试框架包中,Microsoft.VCLibs.140.00.Debug.UWPDesktop:
<PackageDependency Name=”Microsoft.VCLibs.140.00.Debug.UWPDesktop” MinVersion=”14.0.24217.0″ Publisher=”CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US” />
Universal CRT(UCRT)是window10 system32操作系统中的一部分安装(像user32.dll), 但是如果你想调试uCRT版本, 首先你需要安装它。你可以在Window 10 SDK下找到调试版本(和创建应用程序使用的是相同版本)
如果目标机器上没有uCRT调试版本,你就必须在本地打包调试uCRT应用程序。调试的时候,把ucrtbased.dll[1]从C:Program Files (x86)Windows Kits10bin<arch>ucrtbased.dll复制到下一级执行文件中。
VC++ 12.0支持:
VC 12.0(visual studio2013) 的框架包安装在: %PROGRAMFILES(X86)%Microsoft SDKsWindows Kits10ExtensionSDKsMicrosoft.VCLibs.Desktop.120下
要引用120框架包,在AppxManifest.xml中添加下面内容:
<PackageDependency Name=”Microsoft.VCLibs.120.00.UWPDesktop” MinVersion=”12.0.40653.0″ Publisher=”CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US” />
调试程序:
将包依赖项的名字改为Microsoft.VCLibs.120.00.Debug.UWPDesktop, 然后配置调试版本。
注意,现有的在 Windows 8 的时间范围内创建的VC++12.0库会进行运行时检查来确定这个应用程序是否正在应用程序容器下运行。当运行一个打包的桌面应用程序,这些检查可能会限制桌面应用程序的功能或者导致它像一个UWA(Universal Windows Application)(有限的文件系统访问或者创建线程初始化MTA等等.)我们已经修复了框架包中包含VC++ 库的这种行为,因此桌面应用程序中也会取消最新的应用程序限制。
下一步:
尝试Desktop Bridge,把你的桌面应用程序打包成appx,负载,部署让我们知道在您在使用Visual C++ runtime DLLs时的体验和问题。
MSDN Blogs: Universal Windows Platform and Xbox One
I posted a little while ago about some interesting things that come with the Windows 10 Anniversary Update, including the ability to target Xbox One with UWP.
One thing I wanted to call out was that while you can use integrate Xbox Live usage on Windows 10 by joining ID@Xbox, you don’t need to do the latter to start developing on your console. Simply turn on dev mode following the instructions, and off you go.
There is a ton of value in targeting UWP for game development; you can find some great highlights here.
Enjoy!
MSDN Blogs: Experiencing Alerting failure for Availability Data Type – 08/24 – Investigating
We are aware of issues within Application Insights and are actively investigating. Some customers may experience Alerting failure. The following data types are affected: Availability.
- Work Around: None
- Next Update: Before 08/24 04:30 UTC
We are working hard to resolve this issue and apologize for any inconvenience.
-Sapna
MSDN Blogs: Debug protractor script in Visual Studio Code
Selenium is a popular open source project to support web end-to-end automation, especially it supports multiple programming languages, such as C#, Java and Python etc. Protractor is based on selenium webdriverjs and provides progamming support from JavaScript approach. Protractor has handy element location support for angularjs, this has made it very popular.
As protractor is based on Node.js and VS Code has built-in debugging support for Node.js runtime, it is easy to develop and debug protractor script in visual studio code. This article will introduce how to debug the script in vs code.
Prerequisite
Suppose you installed Node.js and configured protractor by “npm install protractor –save-dev“. For more script development and basic selenium knowledge, please check with http://www.protractortest.org/
Protractor Configuration
The easiest way to begin with protractor configuration is copy node_modulesprotractorexampleconf.js to your source repository. Suppose you have it named to protractor.conf.js and support the following two suites:
suites:{
smoke: 'spec/smoketests/*.js',
full: 'spec/full/*.js'
},
Create launch.json
Click on the Debugging icon in the View Bar on the side of VS Code. Click on the Configure gear icon on the Debug view top bar, choose Node.js as the debug environment and VS Code will generate a launch.json file under your workspace’s .vscode folder.
Configure protractor in launch.json
Locate the “Launch” entry in launch.json, change program and args in the following
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/protractor/bin/protractor",
"stopOnEntry": false,
"args": ["${workspaceRoot}/protractor.conf.js"],
Debug
Now, you can click F9 to set breakpoint, F5 to debug the script. Watch and Call stack panels are handy to inspect the running status.
Support Suite in Configuration
Suppose you just want to debug smoke test suite while don’t want to change the Launch entry in the launch.json, you can simply copy the Launch entry and rename it to SmokeTest shown below. Furthermore, add “–suite” and “smoke” to the args array entry.
"name": "SmokeTest",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/protractor/bin/protractor",
"stopOnEntry": false,
"args": ["${workspaceRoot}/protractor.conf.js", "--suite", "smoke"],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
Make sure you have chosen SmokeTest in the debug view and it will only run against smoke suite in the next debug session then.
For more information regarding to debug in visual studio code, there is good introduction in https://code.visualstudio.com/docs/editor/debugging
MSDN Blogs: [Sample Of Aug. 24] How to access data from SQL Server database in Win10 UWP
Sample : https://code.msdn.microsoft.com/How-to-access-data-from-935e360c
This sample demonstrates How to access data from SQL Server database in Win10 UWP.
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 samples in a centralized place, and automatically be notified about sample updates. If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage http://1code.codeplex.com/.
MSDN Blogs: Pozvánka na exkluzivní seminář s Paulou Januszkiewicz
Rádi bychom vás pozvali na exkluzivní seminář System Forensics and Incident Handling, který pořádá Počítačová škola Gopas. Proběhne 25. 10. 2016 pod vedením mezinárodně uznávané bezpečnostní expertky Pauly Januszkiewicz (Microsoft Ignite No. 1 speaker). Paula o semináři říká:
„This is a deep dive seminar on security operations: vulnerability management, anomalies detection, discovery of industry attacks and threats, understanding how compromised system or solution looks like, defining the indicators of the attack, incident handling also daily servicing on SIEM platform. We will also walk through the advanced access rights, password mechanisms, windows internals, PowerShell usage for security purposes, gaining unauthorized access, advanced DNS configuration and common configuration mistakes, forensics techniques, Active Directory security, IIS Security, debugging, advanced monitoring and troubleshooting and much more!“
Více informací o semináři na SECURITY DAY.
MSDN Blogs: Experiencing Data Gaps for Availability Data Type – 08/24 – Resolved
We’ve confirmed that all systems are back to normal with no customer impact as of 08/24, 04:15 UTC. Our logs show the incident started on 08/24, 05:15 UTC and that during the one hour that it took to resolve the issue some customers experienced data gaps in web test results.
- Root Cause: The failure was due to the configuration changes to one of the back end services.
- Incident Timeline: 1 Hour – 08/24, 04:15 UTC through 08/24, 05:15 UTC
We understand that customers rely on Application Insights as a critical service and apologize for any impact this incident caused.
-Praveen
We are aware of issues within Application Insights and are actively investigating. Some customers may experience Data Gaps in web test results. The following data types are affected: Availability.
- Work Around: none
- Next Update: Before 08/24 12:00 UTC
We are working hard to resolve this issue and apologize for any inconvenience.
-Praveen
MSDN Blogs: “Small steps to big impact” – Register now for Hack The Classroom, September 24th
Hack The Classroom is back! On Saturday 24th September educators from all over the world will come together to share ideas, experiences, insights and conversation, as the education community as a whole looks to drive further innovation in the classroom through the use of technology.
Register now for Hack The Classroom – 24th September, 1600-1800 BST
The theme for this live event will be “small steps to big impact”, and joining host Anthony Salcito is a line-up of exciting industry speakers and trailblazing educators, featuring many hacks created by teachers from around the world.
Speakers include:
- John Kao
- Patricia Romero
- Jordan Shapiro, PhD
- Lauren Pittman
- Dyane Smokorowski
Further information on all speakers can be found in this post on the Microsoft in Education blog.
Excited? Here’s what you can do right now to make sure you’re set to participate in this amazing event:
- Register for the event at aka.ms/hacktheclassroom
- Keep an eye out for the Class Hacks Contest, kicking off on September 5. We are inviting everyone to submit their own one-minute classroom hacks, and the winning entries (determined by public voting) will be broadcast live during Hack the Classroom on September 24.
- Let your friends know you’re attending by posting on Twitter of Facebook with the #HackTheClassroom hashtag!
- Get inspired by viewing the winners of the Class Hacks Contest from the previous Hack the Classroom event!
MSDN Blogs: “Small steps to big impact” – Register now for Hack The Classroom, September 24th
Hack The Classroom is back! On Saturday 24th September educators from all over the world will come together to share ideas, experiences, insights and conversation, as the education community as a whole looks to drive further innovation in the classroom through the use of technology.
Register now for Hack The Classroom – 24th September, 1600-1800 BST
The theme for this live event will be “small steps to big impact”, and joining host Anthony Salcito is a line-up of exciting industry speakers and trailblazing educators, featuring many hacks created by teachers from around the world.
Speakers include:
- John Kao
- Patricia Romero
- Jordan Shapiro, PhD
- Lauren Pittman
- Dyane Smokorowski
Further information on all speakers can be found in this post on the Microsoft in Education blog.
Excited? Here’s what you can do right now to make sure you’re set to participate in this amazing event:
- Register for the event at aka.ms/hacktheclassroom
- Keep an eye out for the Class Hacks Contest, kicking off on September 5. We are inviting everyone to submit their own one-minute classroom hacks, and the winning entries (determined by public voting) will be broadcast live during Hack the Classroom on September 24.
- Let your friends know you’re attending by posting on Twitter of Facebook with the #HackTheClassroom hashtag!
- Get inspired by viewing the winners of the Class Hacks Contest from the previous Hack the Classroom event!
MSDN Blogs: “Small steps to big impact” – Register now for Hack The Classroom, September 24th
Hack The Classroom is back! On Saturday 24th September educators from all over the world will come together to share ideas, experiences, insights and conversation, as the education community as a whole looks to drive further innovation in the classroom through the use of technology.
Register now for Hack The Classroom – 24th September, 1600-1800 BST
The theme for this live event will be “small steps to big impact”, and joining host Anthony Salcito is a line-up of exciting industry speakers and trailblazing educators, featuring many hacks created by teachers from around the world.
Speakers include:
- John Kao
- Patricia Romero
- Jordan Shapiro, PhD
- Lauren Pittman
- Dyane Smokorowski
Further information on all speakers can be found in this post on the Microsoft in Education blog.
Excited? Here’s what you can do right now to make sure you’re set to participate in this amazing event:
- Register for the event at aka.ms/hacktheclassroom
- Keep an eye out for the Class Hacks Contest, kicking off on September 5. We are inviting everyone to submit their own one-minute classroom hacks, and the winning entries (determined by public voting) will be broadcast live during Hack the Classroom on September 24.
- Let your friends know you’re attending by posting on Twitter of Facebook with the #HackTheClassroom hashtag!
- Get inspired by viewing the winners of the Class Hacks Contest from the previous Hack the Classroom event!
MSDN Blogs: Road to APC: rhipe embraces the Spotify and Netflix models to deliver cloud consumption
The calibre of companies which have been named as finalists in the Microsoft Australia Partner Awards (MAPA) has never been higher. These are businesses that are deeply engaged in the digital transformation initiatives of their customers, and are contributing more broadly to the innovation fabric of Australia.
In this story we meet rhipe, which is a finalist in multiple categories of MAPA 2016 recognising Excellence in Licensing, Excellence in Marketing, and Excellence in Wholesale Distribution.
What Netflix has done for movies, and Spotify has done for music, rhipe wants to do for computing.
Cloud computing is prompting a radical rethink of the way businesses consume resources – offering flexibility, choice and a completely different payment model through the delivery of platform-as-a-service, infrastructure-as-a-service and software-as-a-service.
While cloud is impacting how corporates, businesses and governments tackle computing, it’s having a similarly profound effect across the channel community.
Cloud channel company rhipe’s entire focus is to support its partners and ultimately their customers make a fuss-free transition to cloud computing. At rhipe’s core – and its 12-year history – is a subscription platform; channel partners download and consume software from that platform, and receive a rhipe bill at the end of each month.
The company has also developed an impressive technical ability and advises partners on how to deploy cloud solutions, how to license software in a virtualised machine environment, and how to ensure licence compliance.
rhipe however goes the extra mile for its channel partners – and offers a range of new subscription services such as consulting-as-a-service, marketing-as-a-service, contracts-as-a-service, support-as-a-service – in fact, everything possible to streamline the move to the cloud.
CEO Dominic O’Hanlon explains; “Marketing, sales enablement, training as a service – anything you can think a partner might need to do to manage the CSP (cloud solutions provider) business we can do as a service – including invoicing-as-a-service.”
The end user of the services only ever sees the channel partner as rhipe white labels all of its services – the invoice has the partner’s logo, the support centre answers the phone as the partner. According to O’Hanlon this ensures that end customers receive the services they expect but at the same time frees the channel partner to focus on its area of expertise.
“If someone said to me what is your number one differentiator – the one thing getting us a lot of traction is marketing-as-a-service. Most distributors: you assume that you just come to them to buy stuff. What we do is help you find leads, and we help enable your digital transformation and help you enable your customers’ digital transformation.”
Offering specialist cloud-distribution services benefits both channel partners and the ultimate Microsoft user adds O’Hanlon; “If you’re a consumer, and you need one copy of Office 365 you possibly will go and buy that from the Microsoft store and you pay retail price. If you are a business you don’t want to pay retail, and you want someone that’s going to help you deploy and service those licences.
“One option: partners do everything themselves. They provide a 24×7 support desk on Office 365, which includes expertise in Word and Excel but also in Sharepoint, Yammer, Skype for Business. They help you with Azure and workloads and integrate into Microsoft’s back end, and they have a billing platform built that can extract your usage and add margins.
“Or, Option Two: they come to rhipe because we do all of that for them.”
Option Two is clearly resonating, as rhipe has 1,800 partners working with it across the region, and within a year of launching its Indirect Cloud Service Provider offering selling Microsoft’s public cloud, had signed up 440 partners which sold more than 53,000 seats on Office 365.
The largest provider of subscription licences for Microsoft in Asia Pacific, rhipe is headquartered in Australia and also operates in New Zealand, Singapore, Malaysia, Thailand, Indonesia, the Philippines, and the US. It was recently appointed by Microsoft to emerging countries in the region including Sri Lanka, Bangladesh, the Maldives, Bhutan, Brunei and Laos.
Across the region O’Hanlon says cloud computing is engineering entirely new economic models as cloud computing means; “You can turn it on and off when you want, you pay for what you use and your usage is elastic.”
At the same time O’Hanlon says cloud solutions deliver greater enterprise agility, support mobile flexible workforces, encourage innovation, and in some regional markets where it has been a challenge, help tackle software piracy issues.
Partners who are interested in attending the Australian Partner Conference can register here.
MSDN Blogs: DreamSpark は 9月7日をもって Microsoft Imagine になります
DreamSpark をお使いの皆さまへ重要なお知らせです。
2016年9月7日(日本では9月8日)をもって、
「DreamSpark」 のブランド名を「Microsoft Imagine サブスクリプション」に変更することになりました。
- 旧)ブランド名:DreamSpark
- DreamSpark (学生個人向け)
- DreamSpark Standard (教育期間向け)
- DreamSpark Premium (教育期間向け)
- 新)ブランド名:Microsoft Imagine サブスクリプション
サブスクリプションの内容や特典に変更はございません。
本変更に伴い、日本のDreamSpark 公式サイトは9月中旬ごろにリニューアルを予定しております。
https://www.microsoft.com/ja-jp/education/dreamspark.aspx
今後ともよろしくお願いいたします。
MSDN Blogs: Deprecating some predefined Unified Service Desk themes
We’ll be deprecating the following predefined themes in the next release of Unified Service Desk:
- Blue theme
- Style theme
For information about these themes, see Predefined Themes available in Unified Service Desk.
Deprecating these themes implies that we intend to remove these themes in a future “major” release of Unified Service Desk. Until the themes are officially removed, they will continue to work. After removal, you won’t find these themes in the Unified Service Desk client.
By announcing the deprecation now, we are notifying you so that you have sufficient time to plan and update your configuration if you rely on these themes.
After these themes are removed in a future “major” release of Unified Service Desk, we will provide these themes (XAML files) in the User Interface Integration (UII) SDK under the “UIIUSD Developer Assets” folder. You can configure your Unified Service using these XAML files to configure the themes, if required. For information about configuring themes in Unified Service Desk, see Customize themes in Unified Service Desk.
MSDN Blogs: Prague Hacks 2016: Využijte otevřená data a zlepšete život v Praze
Fond Otakara Motejla vyhlašuje Prague Hacks 2016, víkendový programovací maratón, který přivede na jedno místo vývojáře, idea makery, datové analytiky a urbanisty, aby pracovali s pražskými otevřenými daty a hledali nápady na nové služby pro lepší život v hlavním městě. Společně naplní „pražský dashboard“, webovou platformu, která ukáže, co všechno se dá s otevřenými daty dělat. Podobnou “nástěnku” už má řada měst jako Londýn či Leeds.
Na prvním ročníku Prague Hacks, který proběhl vloni v červnu, vzniklo 13 prototypů aplikací postavených na otevřených datech. Šlo například o platformu pro sdílení informací o kvalitě škol, model aplikace sledující pohyb prostředků hromadné dopravy v reálném čase nebo prototyp aplikace pro chytré hodinky sledující bezpečnost v ulicích. Účastníci letošního Prague Hacks budou během tří dnů vytvářet jednoduché miniaplikace (widgety), jež popíší život v Praze ve čtyřech tématických oblastech: mobilita & obyvatelstvo, volný čas & vzdělávání, dobré vládnutí & transparentnost, životní prostředí & sociální služby. Díky vzniklým widgetům pak zájemce na dashboardu najde na jednom místě informační služby, vzešlé z pražských otevřených dat. Dashboard a jeho výstupy budou v otevřeném kódu, aby bylo možné je upravovat a doplňovat i v budoucnu.
Účastníci Prague Hacks 2016 budou mít k dispozici data z pražského katalogu otevřených dathttp://opendata.praha.eu, kde jsou např. mapové podklady Prahy, jízdní řády MHD, ekonomická data některých městských částí, data pražské ZOO, Technické správy komunikací a řada dalších. Organizátoři Prague Hacks 2016 uvítají zapojení dalších datových zdrojů, které mohou být zpřístupněny všeobecně, či jen pro účely Prague Hacks. Jde o data o pohybu obyvatel po městě, data o trávení volného času, data popisující vzdělávací aktivity a jejich využití, data o městské ekonomice a/nebo jejích slabých místech, data o politickém rozhodování, data o životním prostředí a data o sociální ohleduplnosti a péči.
“Prague Hacks je příležitost představit Prahu jako město, otevřené spolupráci mezi jeho správci, obyvateli a uživateli, mezi samosprávou a firmami, které zde poskytují své služby. Město je odpradávna sdílený prostor – otevřená data a (spolu)práce s nimi pro nás proto představují zcela logický vývoj městského prostředí v digitální éře,” říká za organizátory Michal Tošovský z Fondu Otakara Motejla.
Přihlásit se na Prague Hacks 2016 je možné od 3. 8. 2016. Více informací k registraci naleznete na stránce http://www.praguehacks.cz/. Hlavním organizátorem akce je Fond Otakara Motejla ve spolupráci s Node5, StartupYardem, reSITE za finanční a technologické podpory společností Microsoft ČR, CZ.NIC, RedHat ČR a Nadace Open Sociery Fund Praha. Záštitu poskytla primátorka Hlavního města Prahy Adriana Krnáčová.
„Na projektech a aktivitách Fondu Otakara Motejla spolupracujeme dlouhodobě. I v případě této akce jsme se rozhodli podpořit ji a to jak finančně, tak především formou poskytnutí konzultací odborníků ze sdružení CZ.NIC. Naše participace na Prague Hacks 2016 bude spočívat ve zprostředkování vybraných dat z projektu Netmetr. V rámci akce budou také kolegové vystupovat jako mentoři, kteří pomohou účastníkům se v datech z toho projektu zorientovat a ukáží jim, jak s nimi vhodně pracovat,“řekl Ondřej Filip, výkonný ředitel sdružení CZ.NIC, které je partnerem projektu Prague Hacks 2016.
“V Praze se každý rok odehrají desítky hackathonů. Prague Hacks je mezi nimi možná vůbec tím nedůležitějším, protože využívá otevřená data ke zlepšení života ve městě a dotýká se zcela zásadních témat, jako jsou kvalita a transparentnost veřejné správy, životní prostředí či poskytování sociálních služeb,” uzavírá Cedric Maloux ze StartupYardu.
#PragueHacks
Sledujte nás na Facebooku.
MSDN Blogs: タブレット モード ON の Windows 10 モーダル ダイアログ動作について
こんにちは、Platform SDK (Windows SDK) サポートチームです。
Windows 10 を タブレット モード ON で使用している時のモーダル ダイアログ動作についてご案内します。
現象
バージョン 1511 (OS ビルド 10586.0) までの Windows 10 を タブレット モード ON で使用していると、アプリケーションが表示したモーダル ダイアログが親ウィンドウの背面に表示される現象が発生します。
モーダル ダイアログが閉じるまでは親ウィンドウに制御が返らないため、ユーザーはアプリケーションを操作できなくなります。
本現象は、Win32 や WPF 等のデスクトップ アプリケーションにおいて発生します。
また、Windows 10 Anniversary Update (バージョン 1607 (OS ビルド 14393.0)) では発生しません。
回避策
バージョン 1511 (OS ビルド 10586.0) までの Windows 10 に対する回避策として、以下の三つの方法が確認されています。
Alt + Tab キーを押下して一旦他のアプリを前面に表示してから、再度 Alt + Tab キーを押下してモーダル ダイアログを表示します。
Windows 10 Anniversary Update (バージョン 1607 (OS ビルド 14393.0)) にアップグレードします。
Windows 10 Anniversary Update へのアップグレードに関しては、弊社 Web サイトにても FAQ を公開しておりますのでご覧くださいませ。Windows Update: FAQ
< https://support.microsoft.com/ja-jp/help/12373/windows-update-faq>アプリケーションを開発する際に、モーダル ダイアログのウィンドウ スタイルに WS_POPUP スタイルを与えます。
(WPF アプリの場合は、モーダル ウィンドウの Window.ShowInTaskbar プロパティを FALSE に設定します)
制限事項
前述した三つの回避策の内、2. と 3. にはそれぞれ以下の制限事項があることが確認されています。
2. の回避策の制限事項
表示されたモーダル ダイアログの位置を、ユーザー操作で変更する (モーダル ダイアログを移動する) ことができません。
アプリケーションを開発する際に、予め表示するダイアログの位置を調整しておくことをお勧めいたします。
3. の回避策の制限事項
モーダル ダイアログの動作が、以下の二つの点で変化します。
・ モーダル ダイアログがタスクバーに表示されなくなります。
・ Alt + Tab キーを押下しても、モーダル ダイアログがウィンドウのリストに表示されなくなります。
関連資料
Window.ShowInTaskbar Property
< https://msdn.microsoft.com/en-us/library/system.windows.window.showintaskbar.aspx>
Window Styles
< https://msdn.microsoft.com/en-us/library/windows/desktop/ms632600.aspx>
Window.ShowDialog Method ()
< https://msdn.microsoft.com/en-us/library/system.windows.window.showdialog.aspx>
Windows 10 の更新履歴
< https://support.microsoft.com/ja-jp/help/12387/windows-10-update-history>
MSDN Blogs: Use local-npm for offline NPM package installation
npm is a Node.js package manager. Users can fetch and install Node.js packages easily using npm. It makes it easier to resolve package dependencies.
The official repository of npm is https://www.npmjs.com/
Why do we need offline NPM package installation?
There are scenarios where not every user has access to the official npm repository. For example:
- You may deliver an on-site workshop. The trainees need to run
npm install
for their lab in the restricted environment. - You may need to install packages on a flight.
Why do I choose local-npm?
Addy Osmani has a nice post comparing local-npm
to other options. I just follow this post.
local-npm Installation
Environment: I am using a Windows 2008 R2 Server with .NET Framework 4.5.2 installed.
1. Install Node.js
Download and install the current version of Node.js from https://nodejs.org/en/download/
Because local-npm depends on node-gyp, you need to install Python 2.7 (
v3.x.x
is not supported) and Visual C++ Build Environment. (Refer to the document of node-gyp) Otherwise you will receive the following error when you run the command npm install -g local-npm
directly.
2. Install Visual C++ Build Environment
- Option 1: Install Visual C++ Build Tools using the Default Install option.
- Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup.
3. Install Python 2.7
Download and install Python 2.7 from https://www.python.org/downloads/ (I installed it in the default folder c:python27
)
You may meet the following error during Python 2.7 installation:
"There is a problem with this Windows Installer Package. A program required for this install to complete could not be run. Contact your support personnel or package vendor"
I applied the solution in this Stack Overflow post.
- De-select pip from the install options. Then install.
- After the installation completes, re-run the setup.
- Choose “
change python
” and then install pip.
4. Launch command prompt, run the command npm config set python C:Python27python.exe
5. Run the command npm config set msvs_version 2015
6. Simply run the command npm install -g local-npm
Basic Usage of local-npm
Before you run the command
local-npm
to start local-npm, you’d better create a folder (e.g. c:local-npm
) and change the current directory to this folder. The reason to create a specific folder is because local-npm will replicate the skimdb from the official repository and store the data in local folder. The default folder to store the data is the folder where you run local-npm. (You can specific the folder by the command line option -d, --directory
)
Run the command local-npm
Then the users can set npm to get registry through the local server:
npm set registry http://127.0.0.1:5080
If you want to switch back to the official repository, run this:
npm set registry https://registry.npmjs.org
Now the users can run npm install
to get the package through the local-npm server.
Offline mode
After you start local-npm, it will begin to replicate skimdb from remote official registry.
There’s no need to wait for the complete skimdb download (which can take a few hours). You can test it with the following steps:
- Make sure the network is up.
- Run an
npm install
to grab a module. (e.g.npm install jquery
) - local-npm will cache it.
- delete jquery from node_modules directory.
- Turn off the network.
- Run that npm install again. (e.g.
npm install jquery
) - You will notice the following behaviors
- If the complete skimdb has been replicated (100%), you will get the cached package immediately from local-npm.
- If the replication is still in process, local-npm will try to connect to the official registry three times. After about 1 minutes, you will still get the cached package from local-npm.
MSDN Blogs: Mehr Sicherheit mit Windows 10. Jetzt für unseren Webcast anmelden
Egal ob Digitale Transformation, Enterprise Mobility oder Cyber Defense;
Dies sind Begriffe, mit dem sich heutzutage sowohl die IT Manager, als auch die Systemadministratoren von Schulen und Universitäten beschäftigen müssen. Mit dem Windows 10 Anniversary Update unterstützt Microsoft Sie dabei.
Gerne laden wir Sie zu einem spannenden Webcast ein um Ihnen das Windows 10 Anniversary Update näher zu erläutern. Wir empfehlen die Teilnahme von IT-Entscheider und Systemadministratoren.
Datum: 26. August 2016 10:00 – 15:45 Uhr
Webcast Anmeldung: https://aka.ms/onlinefestival
Das Microsoft Deutschland Team wartet bereits auf Sie! Die Begrüßung startet mit Herrn Michael Kranawetter, National Security Officer, und gibt Ihnen einen Update zur Lage in Deutschland in Bezug auf Cyber-Angriffe.
Im Anschluss begrüßt Sie Herr Milad Aslaner, Senior Product Marketing Manager und demonstriert Ihnen, wie Sie Ihr Unternehmen vor Cyber-Angriffen schützen können.
Danach geht es weiter mit Windows 10 als Treiber der Digitalen Transformation und am Ende übernimmt Herr Andreas Mangerich, Technology Solution Professional und zeigt Ihnen wie Sie durch das Anniversary Update nicht nur die Produktivität steigern sondern auch das Deployment dank Windows-As-a-Service beschleunigen können.
UHRZEIT THEMA SPRECHER
10:00-10:30 Eröffnungsrede:
Cyber-Angriffe: Lage in Deutschland Michael Kranawetter
10:30-10:45 Pause
10:45-11:45 Windows 10 Anniversary Update: Cyber-Angriffe Erfolgreich bekämpfen Milad Aslaner
11:45-12:00 Pause
12:00-12:30 Windows und die Digitale Transformation Milad Aslaner
12:30-13:00 Mittagspause
13:00-14:00 Windows 10 Anniversary Update: Schnelleres Deployment mit Windows-as-a-Service Andreas Mangerich
14:00-14:15 Pause
14:15-15:00 Windows 10 Anniversary Update: Produktivitäts-Boost durch Windows Ink, Cortana und mehr! Andreas Mangerich
15:00-15:15 Pause
15:15-15:45 Zusammenfassung Milad Aslaner
Melden Sie sich und Ihre Kollegen schnell an, da die Teilnehmerplätze limitiert sind .
MSDN Blogs: Setup IIS with URL Rewrite as a reverse proxy for real world apps.
Url Rewrite, one of the many modules that can be added on to the IIS web-server to make this a very versatile tool can be used to perform a variety of tasks, including allowing you to setup your IIS web-server as a reverse-proxy server to some other back-end HTTP service. A reverse proxy is a network device that takes in traffic coming from the Internet (for example), and forwards this traffic to a backend server on your private network, allow that backend server to be accessible to people who are not necessarily connected to your network. There are a lot of articles on how to use IIS and Url Rewrite as a reverse proxy, but I have found that many are incomplete with regards to real world scenarios from today’s web applications.
Scenario: Setting up IIS with URL rewrite as a reverse proxy with SSL offloading for a backend service.
Details: suppose that we have a web-application hosted on one of our backend web-servers, IIS or another web server, and that this application server cannot be configured to use SSL and is not accessible to the end users because the end users do not have access to the network the server is on. We want IIS to perform the following tasks:
- Take in requests from the end users for content from this application using SSL
- Route these requests to the backend application server using HTTP
- Rewrite all responses from the backend server, so that any hyperlinks, form action tags and such are constructed with the URL that the IIS reverse proxy server has.
Below is the diagram of the setup we wish to accomplish using IIS as a reverse proxy server:
I would like to take you through the configuration steps required to setup such a system, where requests are routed via the IIS server to the backend application server and the re-written back again with the public host-name of the IIS server and sent back to the connecting clients.
Install URL Rewrite
The first step is to install the add-on module for URL Rewrite. With Windows Server 2012 R2, you can use the Microsoft Web Platform Installer (WebPI) to download and install the URL Rewrite Module. Just search for ‘URL Rewrite’ in the search options and click ‘Add’. You can also download the extension from IIS.net – http://www.iis.net/downloads/microsoft/url-rewrite .
Once the module is installed in IIS, you will see a new Icon in the IIS Administration Console, called URL Rewrite. This icon is present at the level or each site and web-application you have in the server, and will allow you to configure re-write rules that will apply from that level downwards.
Setup a Reverse Proxy rule using the Wizard.
Open the IIS Manager Console and click on the Default Web Site from the tree view on the left. Select the URL Rewrite Icon from the middle pane, and then double click it to load the URL Rewrite interface.
Chose the ‘Add Rule’ action from the right pane of the management console, and the select the ‘Reverse Proxy Rule’ from the ‘Inbound and Outbound Rules’ category.
Now we can proceed to fill in the routing information based on the diagram above in the Wizard window that is provided to us.
While still in the same configuration window, we also need to provide information to take care of the responses that will be emitted by the backend server and will transit the IIS server on their way back to the requesting browser. These responses may have absolute hyperlinks inside and other information which contains the hostname of the backend server. If these are sent to the browser as is, the end user will not be able to access the resources these links point to simply because the browser does not know where http://privateserver:8080/HomePage.aspx is located and how it can be reached. We need to convert these into the hostname of the reverse proxy server, and have them look like: https://www.mypublicserver.com/HomePage.aspx . For this reason, we will check the ‘Rewrite the domain names of the links in HTTP responses’ checkbox in the Outbound Rules section.
The basic setup for the reverse proxy is now complete, with IIS able to capture incoming traffic and forward it to the backend server, and inspect responses from the backend server and rewrite URL links inside the responses to match the host headers that IIS uses to publish the site.
Read on in part number 2 to see where the problems with this setup start.
By Paul Cociuba
http://linqto.me/about/pcociuba
MSDN Blogs: IIS with URL Rewrite as a reverse proxy – part 2 – dealing with 500.52 status codes
This is the second article in a three-part series of articles dealing with setting up IIS as a reverse proxy. Check out part one here.
IIS acting as reverse proxy: Where the problems start:
Testing this new setup for basic scenarios may work, but you can also be presented with a couple of issues. The first one is that you may have 500 status codes when you try to access your backend server. If you do FREB tracing, you will see that these status codes are actually logged by IIS and Url Rewrite with the following message in the trace:
Outbound rewrite rules cannot be applied when the content of the HTTP response is encoded (“gzip”).
Status code for this is 500.52.
This is because the responses that are coming from the back end server are using HTTP Compression, and URL rewrite cannot modify a response that is already compressed. This causes a processing error for the outbound rule resulting in the 500.52 status code.
Fixing the 500.52 status code cause by compressed responses.
A client indicates to the server that it is willing to accept compressed content by indicating this in the http headers it sends to the server alongside the request. This is indicated in the ‘Accept-Encoding’ Header.
There are two ways to work around this: either you turn off compression on the backend server that is delivering the HTTP responses (which may or may not be possible, depending on your configuration), or we attempt to indicate to the backend server the client does not accept compressed responses by removing the header when the request comes into the IIS reverse proxy and by placing it back when the response leaves the IIS server.
I will only detail the second alternative, with regards to the removal and re-instatement of the HTTP header. To do this, we will first need to create two HTTP Variables in URL Rewrite. After selecting the URL Rewrite Icon and double clicking it in the IIS Manager Console, you will have a ‘View Server Variables’ action button on the right hand side pane. Click this button to be able to add new server variables.
Click the ‘Add’ button on the right hand side pane to add a new server variable. We will need to add two variables named HTTP_ACCEPT_ENCODING and HTTP_X_ORIGINAL_ACCEPT_ENCODING as shown here:
Once this is complete, we will need to use these variables both in the inbound rules, to remove the Accept-Encoding header and in the Outbound Rules to place this header back again.
Go to the Inbound Rules section in Url Rewrite. This section should just contain one inbound rule, called ‘Reverse Proxy Inbound Rule 1’. Select this rule and click the ‘Edit’ action link on the right hand side panel of the IIS Administration Console to be able to edit the details of this rule.
In the ‘Server Variables’ section we will need to add the two server variables that we have declared earlier. We will be copying the contents of the HTTP_ACCEPT_ENCODING server variable (which captures the content of the Accept-Encoding Header) into the HTTP_X_ORIGINAL_ACCEPT_ENCODING. To do this, click the Add button on the interface, and then chose the HTTP_X_ORIGINAL_ACCEPT_ENCODING from the dropdown list that appears in the ‘Set Server Variables’ window:
Set this variable to capture the value of HTTP_ACCEPT_ENCODING by placing the string {HTTP_ACCEPT_ENCODING} in the Value textbox. Whenever you see something between curly braces {} in URL Rewrite, this means that URL Rewrite will use the value of whatever expression is inside the braces – in this case the server variable.
Now it is time to repeat the process for the HTTP_ACCEPT_ENCODING variable which we should be setting to empty. This variable will be used by URL Rewrite when it builds the request to forward to the backend server. So if we do not wish this request to have an Accept-Encoding header, we must empty its value. Press the ‘Add’ button again on the ‘Server Variables’ pane, and then fill in the ‘Set Server Variable’ window as follows:
Note that the interface will not allow you to set the variable’s value to empty, hence you can set this to any arbitrary string (I just use ‘eee’). We will correct this manually in the configuration files afterwards. Once this is done, press the ‘Apply’ button to save the configuration changes to the IIS configuration store – in this case the web.config of your website.
Once the changes are saved, time to do some manual tweaking using Notepad or Notepad++, or any other XML editor of your choice. Open the web.config file that is present at the root of your website, and find the <rewrite><rules> section. Here you should find the InboundReverseProxyRule1 rule definition which should look like the snippet below:
<rule name=”ReverseProxyInboundRule1″ stopProcessing=”true”>
<match url=”(.*)” />
<conditions logicalGrouping=”MatchAll” trackAllCaptures=”false” />
<serverVariables>
<set name=”HTTP_X_ORIGINAL_ACCEPT_ENCODING” value=”{HTTP_ACCEPT_ENCODING}” />
<set name=”HTTP_ACCEPT_ENCODING” value=”eee” />
</serverVariables>
<action type=”Rewrite” url=”http://privateserver:8080/{R:1}” />
</rule>
In the <ServerVariables> section, set the value of the HTTP_ACCEPT_ENCODING variable to empty (delete the value that is between the quotes). The new line of configuration should look like the following:
<set name=”HTTP_ACCEPT_ENCODING” value=”” />
Note: if you cannot save the file because of elevation privileges requirements, then you can save the web.config to another folder, like ‘My Documents’ and then copy it over manually replacing the original web.config. This will require you to confirm the replace with an elevated prompt as well, but that should not be a problem.
Now on to the outbound rule modification.
When we receive the responses from the backend server, we need to forward them back to the browser. To be able to correctly do this, we will need to restore the value of the HTTP_ACCEPT_ENCODING variable to what it was before we changed it to empty. Create a new Outbound Rule from the Url Rewrite Pane, by clicking the ‘Add Rule’ action link on the right hand side pane, and then selecting the ‘Blank Rule’ from the Outbound Rules section of the ‘Add Rule(s)’ Window.
Call the new rule ‘RestoreAcceptEncoding’. Outbound rules in URL Rewrite are only executed if we are able to match a precondition. A pre-condition is a check we will be running on the response to determine if we wish to perform an action or not. So the next part of the configuration will be to create a new pre-condition to be used with the outbound rule we are creating.
Select <New Precondition> from the Preconditions dropdown, and then configure the precondition as follows. Give the precondition a name – call it NeedsRestoringAcceptEncoding, and the select ‘Regular Expression’ from the ‘Using’ dropdown:
Select the ‘Match All’ from the ‘Logical Grouping’ dropdown list and proceed to add a condition by pressing the ‘Add’ button. The condition will be the check we will be running to determine if we wish to apply the transformation which will be detailed in the outbound rule. We can have several conditions grouped together in one precondition clause. Configure the condition as follows: set the {HTTP_X_ORIGINAL_ACCEPT_ENCODING} as a value for the ‘Condition Input’ textbox, select the ‘Matches the Pattern’ item from the ‘Check if input String’ dropdown, and finally place ‘.+‘ as a pattern.
After having created the pre-condition for the outbound rule, we can now proceed to configure the rule itself. Select ‘Server Variable’ from the Matching Scope dropdown, and place the HTTP_ACCEPT_ENCODING variable name in the ‘Variable Name’ textbox. Select ‘Matches the Pattern’ in the Variable Value dropdown and the ‘Regular Expressions’ in the Using dropdown, and place the following pattern ‘^(.*)‘ in the Pattern textbox:
In the ‘Actions’ pane, select ‘Rewrite’ as an action from the ‘Action’ dropdown, and place the {HTTP_X_ORIGINAL_ACCEPT_ENCODING} value in the ‘Value’ textbox. Check the ‘Replace Existing Server variable value’ checkbox.
Click the ‘Apply’ button to save the changes entered by this rule to the IIS configuration store.
By configuring the Inbound and Outbound rules, we are now able to mitigate the 500.52 status code if our backend server was compressing the responses as a result of the client browser sending ‘Accept-Encoding’ headers in the incoming requests.
In the next part, we will look at configuring more outbound rules to deal with complex scenarios of javascript encoded data.
By Paul Cociuba
http://linqto.me/about/pcociuba