Amazon brings .Net Core support to AWS Cloud

aws.jpg

Re-post from http://opensourceforu.com/2017/07/amazon-brings-net-core-support-aws-cloud/

Encouraging developers to massively build cross-platform applications, Amazon has added .Net Core support to its AWS Cloud services. The series that has been upgraded with the new support includes the AWS CodeStar and AWS CloudBuild services.

“The support for .Net Core in AWS CodeStar and AWS CodeBuild opens the door for .Net developers to take advantage of the benefits of Continuous Integration and Delivery when building .Net based solutions on AWS,” said Tara Walker, technical evangelist, Amazon Web Services (AWS), in a statement.

The AWS team launched the CodeStar service back in April for Amazon EC2, AWS Elastic Beanstalk and AWS Lambda projects using five programming languages, including JavaScript, Java, Python, Ruby and PHP. Though the original list of supported languages was covering a large part, Amazon has now planned to target developers on Microsoft’s Azure by enabling .Net Core support.

Deploy code on Amazon EC2 and AWS Lambda

Developers can leverage the latest support to build and deploy their .Net Core application code to both Amazon EC2 and AWS Lambda. This ability comes through the CodeBuild service that brings two new project templates to AWS CodeStar for .Net Core applications. Also, there is sample code and a full software development toolchain to ease the development.

Importantly, the presence of Visual Studio 2017 is required alongside the AWS Toolkit for Visual Studio 2017 to start building .Net Core applications for Amazon’s cloud solution. You can also deploy your existing .Net Core code enable your applications on AWS.

by  on July 13, 2017

 

Re-blog: C# Version History: Examining the Language Past and Present

Please note I am not the author of this blog post, it is a re-blog, please visit original article at https://blog.ndepend.com/c-versions-look-language-history/

I still remember my first look at C# in the early 2000s.  Microsoft had released the first major version of the language.  I recall thinking that it was Java, except that Microsoft made it, called it something else, and put it into Visual Studio.  And I wasn’t alone in this sentiment.  In an old interview, Java inventor James Gosling called it an imitation.  “It’s sort of Java with reliability, productivity, and security deleted,” he said.  Ouch.

A lot changes in 15 years or so.  I doubt anyone would offer a similar assessment today.  In that time, Java has released four major language versions, while C# has released six.  The languages have charted divergent courses, and C# has seen a great deal of innovation.  Today, I’d like to take a look back on the history of C# and highlight some of those key points.

What did the language look like in its earliest incarnations?  And how has it evolved in the years since?

C# Version 1

When you go back and look, C# version 1 really did look an awful lot like Java.  As part of its stated design goals for ECMA, it sought to be a “simple, modern, general purpose object-oriented language.”  At the time, it could have done worse thank looking like Java in order to achieve those goals.

But if you looked back on C# 1.0 now, you’d find yourself a little dizzy.  It lacked the built in async capabilities and some of the slick functionality around generics that we take for granted.  As a matter of fact, it lacked generics altogether.  And Linq?  Nope.  That would take some years to come out.

C# version 1 looked pretty stripped of features, compared to today.  You’d find yourself writing some verbose code.  But yet, you have to start somewhere.

C# Version 2

Now things start to get interesting.  Let’s take a look at some major features of C# 2.0, released in 2005, along with Visual Studio 2005.  (Check out the book by NDepend creator Patrick Smacchia about .NET 2.0.)

While Microsoft may have started with a pretty generic object-oriented language, C# Version 2 changed that in a hurry.  Once they had their feet under them, they went after some serious developer pain points.  And they went after them in a big way.

With generics, you have types and methods that can operate on an arbitrary type while still retaining type safety.  So, for instance, having a List<T> lets you have List<string> or List<int>  and perform type safe operations on those strings or ints while you iterate through them.  This certainly beats creating ListInt inheritors or casting from Object for every operation.

Oh, and speaking of iterators, C# Version 2 brought iterators.  To put it succinctly, this let you iterate through the items in List (or other Enumerable types) with a foreach loop.  Having this as a first class part of the language dramatically enhanced readability of the language and people’s ability to reason about the code.

And yet, Microsoft continued to play a bit of catch up with Java.  Java had already released versions that included generics and iterators.  But that would soon change as the languages continued to evolve apart.

C# Version 3

C# Version 3 came in late 2007, along with Visual Studio 2008, though the full boat of language features would actually come with C# Version 3.5.  And what a version this proved to be.  I would go so far as to say that this established C# as a truly formidable programming language.  Let’s take a look at some major features in this version.

In retrospect, many of these features seem both inevitable and inseparable.  In fact, I have a hard time a true headliner, since they all fit together so strategically.  Others won’t have that same problem, though.  They’ll say that C# Version 3’s killer feature was the query expression, also known as Linq (Language INtegrated Query).

I chase a little more nuance because I view expression tress, lamba expressions and anonymous types as the foundation upon which they constructed Linq.  But, in either case, we found ourselves presented with a fairly revolutionary concept.  Microsoft had begun to lay the groundwork for turning C# into a hybrid OO-functional language.

Specifically, you could now write SQL-style, declarative queries to perform operations on collections, among other things.  Instead of writing a for loop to compute the average of a list of integers, you could now do that as simply as list.Average().  The combination of query expressions and extension methods made it look as though that list of ints had gotten a whole lot smarter.

It took a little while for people to really grasp and integrate the concept, but they gradually did.  And now, years later, code is much more concise, simple, and functional.

C# Version 4

C# Version 4 would have had a difficult time living up to the groundbreaking status of version 3.  With version 3, Microsoft had moved the language firmly out from the shadow of Java and into prominence.  The language was quickly becoming elegant.

The next version did introduce some cool stuff, though.

Embedded interop types alleviated a deployment pain.  Generic covariance and contravariance give you a lot of power, but they’re a bit academic and probably most appreciated by framework and library authors.  Named and optional parameters let you eliminate a lot of method overloads and provide convenience.  But none of those are exactly paradigm altering.

I’ll leave that distinction for the introduction of the dynamic keyword.  By doing this, Microsoft introduced into C# Version 4 the ability to override the compiler on compile time typing.  That’s right.  By using the dynamic keyword, you can now shoot yourself in the foot a la dynamically typed languages like JavaScript.  You can create a dynamic x = “a string” and then add six to it, leaving it up to the runtime to sort out what on earth should happen next.

I say that a bit tongue in cheek, obviously.  This gives you the potential for errors but also great power within the language.

C# Version 5

With C# Version 5, Microsoft released a very focused version of the language.  They put nearly all of their effort for that version into another pretty groundbreaking language concept.  Here is the major features list.

Now, don’t get me wrong.  The caller info attribute is pretty cool.  It lets you easily retrieve information about the context in which you’re running without resorting to a ton of boilerplate reflection code.  I actually love this feature.

But async and await are the real stars of this release.  When this came out in 2012, Microsoft changed the game again by baking asynchrony into the language as a first class participant.  If you’ve ever dealt with long running operations and the implementation of webs of callbacks, you probably loved this language feature.

C# Version 6

With versions 3 and 5, Microsoft had done some pretty impressive stuff in an OO language.  (Version 2 did as well, but they were fast following Java with those language features.)  With version 6, they would go away from doing a dominant killer feature and instead release a lot of features that delighted users of the language.  Here are some of them.

Taken individually, these are all cool language features.  But if you look at them altogether, you see an interesting pattern.  In this version, Microsoft worked really hard to eliminate language boilerplate and make code more terse and readable.  So for fans of clean, simple code, this language version was a huge win.

Oh, and they did do one other thing along with this version, though it’s not a traditional language feature, per se.  They released Roslyn the compiler as a service.  Microsoft now uses C# to build C#, and they let you use the compiler as part of your programming efforts.

C# Version 7

Finally, we arrive at C# version 7.  That’s the current version as of the writing of this post.  This has some evolutionary and cool stuff in the vein of C# 6, but without the compiler as a service.  Here are some of the new features.

All of these offer cool new capabilities for developers and the opportunity to write even cleaner code than ever.  In particular, I think Microsoft scratched some long term itches by condensing the declaration of variables to use with the “out” keyword and by allowing multiple return values via tuple.

But Microsoft is also busy putting the language to ever broader use.  .NET now targets any operating system and has its eyes firmly on the cloud and on portability.  This certainly occupies the language designers’ thoughts and time, in addition to coming up with new features.

I’ve been familiar with C# for just under 15 years now, and the language has been under development for even longer than that.  It’ll be exciting to see what features and capabilities the future brings.

Visual Studio 2012 Update 2 Released

Aside

Tip

To download for team sharing/network deployment, download web installer from the link, then at command prompt use the command: –

“<download path>\VS2012.2.exe” /Layout “<my save path>”

replacing <download path> and <my save path> as required…. This will download the full install (1.8GB).

The same also works for SSDT (SQL Server Data Tools) installers.

Download now from http://www.microsoft.com/visualstudio/eng/downloads#d-visual-studio-2012-update or http://go.microsoft.com/fwlink/?LinkId=273878

Very nice code mapping features during debug and error tracing, watch the video below (or at here – about 25 minutes into video) for details.


Most of the following content has been extracted from http://www.microsoft.com/visualstudio/eng/visual-studio-update#story-update-2

46 minutes, 36 seconds

New Features include

Agile planning

Visual Studio 2012 introduced a new set of capabilities to support agile teams—on their terms. Update 2 adds new capabilities for your team to customize and get more out of its agile tooling. You can now add customizable columns to your Kanban boards so that they more accurately reflect your organization’s structure. Work item tagging helps teams to manage their work items by adding tags to get more out of their data.

Quality enablement

Maintaining quality throughout the development cycle is one of the key focus areas for Visual Studio 2012. In Update 2, you can continue to drive quality wherever you are through web access for Test Case Management. You can author and execute test cases remotely, making it easier for all members of your team to participate in test case reviews. You can also profile your unit tests to create better code by tracking the end to end flow of your code, including the unit test itself.

Line-of-business (LOB) application development

With Update 2 we continue to invest in making it easier for you to develop LOB applications. You can quickly create SharePoint apps and HTML5 client apps using LightSwitch. Just design your app and let the LightSwitch templates provide the fit and finish so you can get your LOB applications running quickly. With the addition of WPF, Silverlight and SketchFlow to Blend for Visual Studio, now you have everything you need for designing and coding your desktop applications in Visual Studio.

Developer experience

When you spend a lot of time developing software, you want tools that will provide an enjoyable developer experience. Update 2 includes enhancements and updates to improve the developer experience for Visual Studio 2012. Code map debugger integration gives you a visual representation of your code while debugging so you can identify issues faster. You can also create great apps for Windows Store using profiling enhancements to find issues earlier that could impact your users.

Plus more… Full description of Visual Studio 2012 Update 2 can be viewed at http://support.microsoft.com/kb/2797912

Additional downloads for Visual Studio 2012 Update 2 (Visual Studio 2012.2) are also available for:

.NET Development :: Accessing Special Folders Location Across Different Windows Versions & Tightened Security Within Windows Environment

I am writing this post as I know quite a few developers only now migrating apps from Windows XP environments, most of whom are spending a lot of time fighting with the new tighter security world that started to come in with Windows Vista.

As most know; the directory structure for user files and temporary documents has changed over the life of Windows (“C:\Documents and Settings\…” is now “C:\Users\…”, Program Files location changes for 64 bit, etc).

In addition to this many of the folders and registry keys, that as a developer, you used to be able to write files and values to are no-longer accessible. In addition to this areas of the event log are also locked down, and writing to it can crash your application if not handled correctly.

So now on Windows Vista, Windows 7 and Windows 8, as a developer you cannot and should not be writing to Program Files, the root of any of your drives, Windows folder, etc, etc. This can also include the traditional temp folder (C:\Windows\Temp or C:\Temp).

The only places you can write to with any certainty are the user specific Temp folder, the ProgramData folder, or the users document store.

If you are having to deal with a legacy app you might have to manually (or programatically) override the security settings granting permissions to write files to the locations you need, though you should do so with caution, as Windows updates and security patches can reverse your changes.

All of these locations vary depending on the system setup and operating system, so what is the best way to handle it?

Well in any .NET App you can easily access any of these folders locations using the Environment namespace (System.Environment) and the SpecialFolder enumeration.

For example: –

Console.WriteLine(“Folder Path: {0}”,
System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData));

A full list of the special folders can be found at http://msdn.microsoft.com/en-gb/library/system.environment.specialfolder.aspx

This is not a list of those accessible for writing to, it is a complete list.

In addition to these you can also access the traditional list of environment variables using: –

System.Environment.GetEnvironmentVariable(string);

Though for this you need to know what is available as it will cause an exception if you call for a variable that does not exist.

You can get a full list of what is on your current system with: –

var s = System.Environment.GetEnvironmentVariables();
foreach (System.Collections.DictionaryEntry item in s)
{
Console.WriteLine(“{0} = {1}”, item.Key, item.Value);
}

But you need to avoid app specific ones, and watch out for some that may have changed names over the years.

You can access the documentation (.NET 4.5) for the System.Environment class at http://msdn.microsoft.com/en-us/library/z8te35sa.aspx or via your Visual Studio help.


With regards to the Event Log, you need to make sure you create your event source during your app install (or have an admin add it into the appropriate event log). This may not be caught during development as most developers run as admin and may even turn off all the UAC protection.

If you don’t then the kind of error you might see in Visual Studio would look something like: –

Security Exception when trying to write to Event Log

Security Exception when trying to write to Event Log.
“The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.”

But all your users will see is something like: –

App crash when trying to write to Event Log

App crash when trying to write to Event Log

If you need to use the event log (which is good practice), then make sure you have created your source during your install and not during your exception handling.


As for the registry, unless your app is running in elevated mode, the only hive you now have access to is HKEY_CURRENT_USER, some of which itself may have been locked down, by specific apps to prevent changes. So if you need to read from HKEY_LOCAL_MACHINE then you should not be using CreateSubKey; but creating your keys/valuse during or app elevation and using OpenSubKey for reading… remember you exception capturing though, similar to Environment Variables, you’ll get an exception if you don’t have access or the key does not exist.

Windows SDK for Windows 7 and .NET Framework 4 on a Windows 8 Pro Dev Box

Ran into an issue today trying to install “Windows SDK for Windows 7 and .NET Framework 4”  (http://www.microsoft.com/en-gb/download/details.aspx?id=8279) on my Windows 8 Pro Dev Box.

The error given is: –

A problem occurred while installing selected Windows SDK components.

Installation of the “Microsoft Windows SDK for Windows 7” product has reported the following error: Please refer to Samples\Setup\HTML\ConfigDetails.htm document for further information.

Please attempt to resolve the problem and then start Windows SDK setup again. If you continue to have problems with this issue, please visit the SDKteam support page at http://go.microsoft.com/fwlink/?LinkId=130245.

Click the View Log button to review the installation log.
To exit, click Finish.

and looks like: –

Windows SDK for Windows 7 and .NET Framework 4 error message on Windows 8 Pro system

Windows SDK for Windows 7 and .NET Framework 4 error message on Windows 8 Pro system

Microsoft Visual C++ 2010 Redistributable

Before it tries to install it warns you that the “Microsoft Visual C++ 2010 Redistributable – 10.0.40219” is installed, is newer than the one included and so will not be updated… however this is the cause of the failed install…

Before installing you need to remove all C++ 2010 components.

Note that this issue is not unique to Windows 8, also affects Windows 7 and probably Windows XP too, though not tried it there.

You can also install OK, if during the component selection process you de-select “Microsoft Visual C++ 2010” under  “Redistributable Packages” and “Visual C++ Compilers” under “Windows Native Code Development“: –

Windows SDK for Windows 7 and .NET Framework 4 Component Selection

Windows SDK for Windows 7 and .NET Framework 4 – de-select C++ bits…

Meet the new ASP.NET and Web Tools 2012.2 release…

ASP.NET tooling gets a little better, with updates to Page Inspector, IntelliSense, Publishing and the Editor; Along with a batch of updated project Templates. See: –

http://channel9.msdn.com/posts/Introduction-to-the-ASPNET-and-Web-Tools-20122-Release

for a short-ish (~25min) video on the details.

You can get the ASP.NET and Web Tools 2012.2 installer at: –

http://asp.net/vnext

Image