谷歌中国开发者社区 (GDG)
  • 主页
  • 博客
    • Android
    • Design
    • GoogleCloud
    • GoogleMaps
    • GooglePlay
    • Web
  • 社区
    • 各地社区
    • 社区历史
    • GDG介绍
    • 社区通知
  • 视频
  • 资源
    • 资源汇总
    • 精选视频
    • 优酷频道

Building .NET apps in Visual Studio for GCP: better than ever

2017-09-02adminGoogleCloudNo comments

By Ivan Naranjo, Senior Software Engineer

Google Cloud Platform (GCP) is a great place to run your .NET workloads, and with the latest release of the Cloud Tools for Visual Studio extension, Cloud Tools for Powershell and our ASP.NET Core runtime for App Engine Flexible, it just got even better.

Cloud Tools for Visual Studio 

We integrated the extension viewers for Stackdriver Logging and Stackdriver Error Reporting into Visual Studio to help you diagnose issues and monitor your code. We also enhanced Cloud Explorer with deeper integration into Google Cloud Storage and Google Cloud Pub/Sub so you can manage your resources without leaving Visual Studio.

Stackdriver integration 

Sometimes even the best of code malfunctions in production. To help you diagnose what’s going on, we integrated Stackdriver Logging and Stackdriver Error Reporting right into Visual Studio, so you can find the source of the problem while you have your Visual Studio solution open.

Regardless of whether your app is based on ASP.NET 4.x or ASP.NET Core, if you’re using Stackdriver Logging to log your .NET app, you can now browse the log entries that your app generated directly in Visual Studio:

You can also query for logs that originate from a particular service and version in Google App Engine (as the above image illustrates) or you can also browse log entries coming from a particular Compute Engine VM.

Even better, if you’re using our Google.Cloud.Logging.V2 NuGet package to send the log entries, the extension can match the log entries with the source code lines where they originated. The extension attempts to fetch the exact version of the source code from git, letting you see exactly from where the log entry originated. See the Stackdriver Log viewer documentation for full details on how to use this feature.

What about when your app crashes? Well, that’s where Stackdriver Error Reporting comes into play. If your application uses Stackdriver Error Reporting to send error reports to Stackdriver, you can now browse the error reports directly from within Visual Studio:

You can see the most frequent errors, the full stack trace of the error and even go directly to the source code line where the error originated. See the Stackdriver Error viewer for further details.

Cloud Explorer enhancements 

We understand that you want to stay within Visual Studio when working on your apps, because moving in and out of Visual Studio is a huge context change. To that end, we keep enhancing our very own Cloud Explorer so you can manage the most important resources directly within Visual Studio. In the latest release we added deeper integration with Cloud Storage and added a new node to manage your Cloud Pub/Sub resources.

Let’s look at what you can now do with the Cloud Storage integration. You have always been able to see what buckets existed under the current project right in Cloud Explorer. Now, you can also open the buckets and see what what files are stored inside of them, treating buckets almost like a hard drive:

With the new integration, you can copy files in and out of buckets, rename them and create new directories — in short, manage the contents of your Cloud Storage buckets right inside of Visual Studio. See the documentation for full details on what you can now do with your Cloud Storage buckets.

Next up is the new Google Cloud Pub/Sub resource that we added to Cloud Explorer:

The new Cloud Pub/Sub node allows you to manage your Pub/Sub topics and subscriptions as well as send new messages to existing topics for testing, all within Visual Studio. Read the documentation for full details on what you can do with this new node.

New Powershell cmdlets 

Visual Studio is a really good environment for most development work, but sometimes the right solution is to use Powershell to automate your GCP resources. To this effect we have added new cmdlets to manage even more resources. We added cmdlets to interact with BigQuery that allow you to run queries, create tables and more. We also added cmdlets to manage Google Container Engine clusters and nodes.

Kubernetes, and its GCP-managed variant Google Container Engine, is becoming one of the most popular ways to manage workloads in the cloud. That’s why we added a set of cmdlets to manage your Container Engine clusters from Powershell. For example, to create a new cluster use the following commands:

# Creates a Container Engine Node Config with image type CONTAINER_VM
# and 20 GB disk size for each node.
$nodeConfig = New-GkeNodeConfig -DiskSizeGb 20 `
                                -ImageType CONTAINER_VM

# Creates a cluster named "my-cluster" in the default zone of the
# default project using config $nodeConfig and network "my-network".
Add-GkeCluster -NodeConfig $nodeConfig `
               -ClusterName "my-cluster" `
               -Network "my-network"

For more information on what you can do with the Container Engine cmdlets see the documentation. 

Then there’s BigQuery, a great data warehousing solution for storing billions of rows and performing queries to extract insights from all that data. Here too we have new cmdlets to manage BigQuery directly from Powershell. For example, here’s how to create a new BigQuery table:

# Creates a schema object to be used in multiple tables.
$schema = New-BqSchema "Page" "STRING" | New-BqSchema "Referrer" "STRING" |
    New-BqSchema "Timestamp" "DATETIME" | Set-BqSchema

# Creates a new table with the Schema object from above.
$table = $dataset | New-BqTable "logs2014" -Schema $schema

For more information about what you can do with the BigQuery cmdlets see the documentation.

We want to hear from you 

We want to work on the features that matter the most to you as we continue to improve .NET and Windows workloads on GCP. Please keep your feedback coming! You can open issues for Cloud Tools for Visual Studio and Cloud Tools for Powershell in their Github repos.



Source: Building .NET apps in Visual Studio for GCP: better than ever

除非特别声明,此文章内容采用知识共享署名 3.0许可,代码示例采用Apache 2.0许可。更多细节请查看我们的服务条款。

Tags: AdWords

Related Articles

A community view: what’s top of mind at Google Cloud Next ’17

2017-03-06admin

CRE life lessons: What is a dark launch, and what does it do for me?

2017-08-04admin

Google joins the OpenChain Project for license compliance

2018-12-06admin

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Recent Posts

  • Admin Essentials: know your options for Modern Enterprise Browser Management
  • TheVentureCity and Google Consolidate Miami as a Tech Powerhouse
  • Keep a better eye on your Google Cloud environment
  • Using HLL++ to speed up count-distinct in massive datasets
  • Season of Docs Announces Results of 2019 Program

Recent Comments

  • admin on Using advanced Kubernetes autoscaling with Vertical Pod Autoscaler and Node Auto Provisioning
  • Martijn on Using advanced Kubernetes autoscaling with Vertical Pod Autoscaler and Node Auto Provisioning
  • Martijn on Using advanced Kubernetes autoscaling with Vertical Pod Autoscaler and Node Auto Provisioning
  • Chen Zhixiang on Concurrent marking in V8
  • admin on 使用 Android Jetpack 加快应用开发速度

Archives

  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • January 1970

Categories

  • Android
  • Design
  • Firebase
  • GoogleCloud
  • GoogleDevFeeds
  • GoogleMaps
  • GooglePlay
  • Google动态
  • iOS
  • Uncategorized
  • VR
  • Web
  • WebMaster
  • 社区
  • 通知

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

最新文章

  • Admin Essentials: know your options for Modern Enterprise Browser Management
  • TheVentureCity and Google Consolidate Miami as a Tech Powerhouse
  • Keep a better eye on your Google Cloud environment
  • Using HLL++ to speed up count-distinct in massive datasets
  • Season of Docs Announces Results of 2019 Program
  • Admin Insider: What's new in Chrome Enterprise, Release 79
  • Discover insights from text with AutoML Natural Language, now generally available
  • Introducing Storage Transfer Service for on-premises data
  • How Mynd uses G Suite to manage a flurry of acquisitions
  • W3C Trace Context Specification: What it Means for You

最多查看

  • 如何选择 compileSdkVersion, minSdkVersion 和 targetSdkVersion (25,381)
  • Google 推出的 31 套在线课程 (22,461)
  • 谷歌招聘软件工程师 (22,337)
  • Seti UI 主题: 让你编辑器焕然一新 (13,824)
  • Android Studio 2.0 稳定版 (9,420)
  • Android N 最初预览版:开发者 API 和工具 (8,036)
  • 像 Sublime Text 一样使用 Chrome DevTools (6,325)
  • 用 Google Cloud 打造你的私有免费 Git 仓库 (6,077)
  • Google I/O 2016: Android 演讲视频汇总 (5,609)
  • 面向普通开发者的机器学习应用方案 (5,539)
  • 生还是死?Android 进程优先级详解 (5,233)
  • 面向 Web 开发者的 Sublime Text 插件 (4,341)
  • 适配 Android N 多窗口特性的 5 个要诀 (4,311)
  • 参加 Google I/O Extended,观看 I/O 直播,线下聚会! (3,624)
© 2019 中国谷歌开发者社区 - ChinaGDG