Skip to content

Feed aggregator

Getting Started with .NET Code Coverage

getting_started_blogWe live and breathe code coverage and the pursuit of building quality code. Since we have been doing it for years, we forget that each and every day new people discover and are getting started with .NET code coverage.

With that in mind, we thought it would be helpful to pull together some of the most common questions we receive about code coverage and NCover.  Here they are:


What is Code Coverage and Why Does It Matter?

In a nutshell, code coverage is the process of determining which sections of your source code have been tested and which sections of your source code have not been tested. This insight allows you to improve your overall testing strategies and the overall health of your code base. The ultimate golas for most organizations are (1) to  increase revenue by providing end users with a higher quality application that is easier to sell and (2) to reduce the total costs of supporting that application in terms of general support and bug fixes. Looking for more Code Coverage 101? We’ve got you covered here.

Can I Collect Code Coverage on My Build Server?

Collecting code coverage on your build service is available through our server-based product, Code Central. It allows you to monitor any number of build servers and test machines and collect coverage data. Code Central can collect coverage directly if it is installed locally on the build server or it can connect to any machine with Collector installed and collect coverage remotely.

Now that you know you can – the next question is HOW? Well – we’ve got that spelled out for you in three easy steps right here.

Can I Cover IIS and My .NET Web Apps?

Yes you can! NCover collects coverage on your .NET web apps by profiling IIS. Specifically, NCover watches the w3wp.exe, the IIS worker process, in order to collect coverage. This approach allows you to automatically capture coverage once you have properly configured your project. How do I properly configure my project? Well we’ve got that for you right here.

Did we miss your question? Leave us a comment or check out our support and resources sections to help find the answers you are looking for. Keep covered and code on our friends. We cannot wait to see what you make next.

The post Getting Started with .NET Code Coverage appeared first on NCover.

Categories: Companies

Introduction to Claims Based Identity

.NET TV - 10 hours 5 min ago
Implementing claims-based solutions in your organization for authentication and authorization is now easier than ever before. Microsoft technologies including Active Directory Federation Services and Windows Identity Foundation (WIF) make it possible to quickly add claims-based identity solutions into your existing active directory infrastructure. This presentation: * Provides an introduction to claims-based identity, * Discusses claims-based […]
Categories: Blogs

Creating database while MDF is Compressed

C-Sharpcorner - Latest Articles - 11 hours 46 min ago
Here you will see how to create database while MDF is compressed.
Categories: Communities

Decorator Pattern in C#

C-Sharpcorner - Latest Articles - 11 hours 46 min ago
This article describes the Decorator Pattern.
Categories: Communities

Microsoft Windows App Studio Beta: Publish the Menu App in the Store

C-Sharpcorner - Latest Articles - 11 hours 46 min ago
The purpose of this article is to show how to submit, in the Store, the Menu App created by Windows AppStudio.
Categories: Communities

ASP.NET Identity 2.2.0-alpha1

Visual Web Developer Team Blog - Fri, 10/24/2014 - 02:15

We are releasing a preview of ASP.NET Identity 2.2.0-alpha1. The main focus in this release was to fix bugs and address performance issues.

Download this release

You can download ASP.NET Identity from the NuGet gallery. You can install or update these packages using the NuGet Package Manager Console, like this:

Install-Package Microsoft.AspNet.Identity.EntityFramework –Version 2.2.0-alpha1 -pre 

Install-Package Microsoft.AspNet.Identity.Core -Version 2.2.0-alpha1 -pre

Install-Package Microsoft.AspNet.Identity.OWIN -Version 2.2.0-alpha1 –pre

What’s in this release?

Following query has the list of all issues fixed in this release..

Samples/ Documentation Migrating from ASP.NET Identity 2.1.0

This is a compatible release with 2.1.0 and there are no database schema changes with this release.

Give feedback and get support
    • If you find any bugs please open them at our Codeplex Site where we track all our bugs https://aspnetidentity.codeplex.com/
    • If you want to discuss these features or have questions, please discuss them on Stack Overflow and use the following tag “asp.net-identity”
Categories: Companies

How to Implement Exception Handling in jQuery While Calling Web Service

C-Sharpcorner - Latest Articles - Thu, 10/23/2014 - 08:00
In this article you will learn how to implement exception handling in jQuery while calling a Web Service.
Categories: Communities

Read a Word File in ASP.Net C#

C-Sharpcorner - Latest Articles - Thu, 10/23/2014 - 08:00
This article shows how to read a Word file.
Categories: Communities

3D Image Slider

C-Sharpcorner - Latest Articles - Thu, 10/23/2014 - 08:00
In this article we will make a 3D Image Slider.
Categories: Communities

Code Acceptance Checklist in .NET

C-Sharpcorner - Latest Articles - Thu, 10/23/2014 - 08:00
This article provides a Code Acceptance Checklist for .NET.
Categories: Communities

.NET Binary Reverse Engineering: Part 1

C-Sharpcorner - Latest Articles - Thu, 10/23/2014 - 08:00
The prime objective of this article is to explain the .NET mother language called Common Instruction Language (CIL) that has laid the foundation of .NET.
Categories: Communities

Some Node pitfalls – 1. Global state

I’ve been teaching myself Node over the last few weeks, by building a non-trivial application. In the process, I’ve been faced with a number of difficulties that I think are worth blogging about. First, let me say that I really like Node. It’s fast, powerful, smartly-designed, and has a liberating effect on my programming style. It is definitely trying to steer developers to a pit of success. It tends to do so, however, by surrounding the pit of failure with deep holes with spikes on the bottom…

Today’s post is about global state in Node. Global state is evil. It is, however, a little too easy to inadvertently create in Node. Node modules are loaded once, and then cached. That’s a good thing, of course, because reading files is expensive, and ‘require’ is a synchronous API. This is no different from a .NET application loading .NET assemblies, except that Node does it more lazily, and with typically smaller units of code (more good things). Because of that, however, anything that is defined on the module’s exports (what the module exposes and that the rest of the application can ‘require’), is essentially static, i.e. global state.

Take this foo.js module for example:

function Foo() {
}

module.exports = {foo: new Foo()};

This code will only be executed the first time the module is ‘require’d. Subsequent ‘require’s will just return the exports object as it was at the end of the first call. This means that require(‘foo’).foo is a singleton. Its state is going to be shared by the whole application.

That may look like an easy one to avoid, but I’ve only showed a trivial case of it. I’m currently investigating a bug in my code where the first request to the server works fine, but subsequent requests crash. I know that there is some hidden global state at play, but I haven’t found it yet. It seems to be hiding really well, and to be a lot more subtle than the above example.

The way I’ve been avoiding global state so far has been to manage my scopes very carefully, and by attaching the state that I need to an object that represents that scope unambiguously. The higher the scope, the more I try to keep state at a minimum, and immutable.

The site knows about the services that are available and enabled, and about its settings, that are immutable (or rather never muted).

Data that is scoped to the request is stored… on the request object, and this is passed around as a parameter when necessary. I’ve tried to keep that to a minimum, but I think I still have too much.

Services are either exposing static, stateless APIs, or they are providing an entirely new instance every time they are needed (they export the constructor, not an instance), and they encapsulate their state.

Did you have similar problems when learning node yourself? If so, how did you solve them?

Categories: Blogs

How to Hadoop: 4 Resources to Learn and Try Cloud Big Data

Are you curious about how to begin working with big data using Hadoop? Perhaps you know you should be looking into big data analytics to power your business, but you’re not quite sure about the various big data technologies available to you, or you need a tutorial to get started.  

  1. If you want a quick overview on why you should consider cloud Hadoop: read this short article from MSDN Magazine that explores the implications of combining big data and the cloud and provides an overview of where Microsoft Azure HDInsight sits within the broader ecosystem.  

  1. If you’re a technical leader who is new to Hadoop: check out this webinar about Hadoop in the cloud, and learn how you can take advantage of the new world of data and gain insights that were not possible before.  

  1. If you’re on the front lines of IT or data science and want to begin or expand your big data capabilities: check out the ‘Working with big data on Azure’ Microsoft Press eBook, which provides an overview of the impact of big data on businesses, a step-by-step guide for deploying Hadoop clusters and running MapReduce in the cloud, and covers several use cases and helpful techniques.  

  1. If you want a deeper tutorial for taking your big data capabilities to the next level: Master the ins and outs of Hadoop for free on the Microsoft Virtual Academy with this ‘Implementing Big Data Analysis’ training series

What question do you have about big data or Hadoop? Are there any other resources you might find helpful as you learn and experiment? Let us know. And if you haven’t yet, don’t forget to claim your free one month Microsoft Azure trial

Categories: Companies

Career planning: What is your path?

Ayende @ Rahien - Wed, 10/22/2014 - 10:00

I got a lot of really great answers about my “Where do old developers go?”, I’m feeling much better about this now Smile.

Now let turn this question around, instead of asking what is going on in the industry, let’s check what is going on with you. In particular, do you have a career plan at all?

An easy way to check that is asking: “What are you going to do in 3 years, in 7 years and in 20 years from now?”

Of course, best laid plans of mice and men will often go awry, plans for the futures are written in sand on a stormy beach and other stuff like this. Any future planning has to include the caveats that they are just plans, with reality and life getting in the way.

For lawyers*, the career path might be: Trainee, associate, senior associate, junior partner, partner, named partner. (* This is based solely on seeing some legal TV shows, not actual knowledge.) Most lawyers don’t actually become named partners, obviously, but that is what you are planning for.

As discussed in the previous post, a lot of developers move to management positions at some point in their careers, mostly because salaries and benefits tend to flat line after about ten years or so for most people in the development track. Others decide that going independent and becoming consultants or contractors is a better way to increase their income. Another path is to rise in the technical track in a company that recognize technical excellence, those are usually pure tech companies, it is rare to have such positions in non technical companies. Yet another track that seems to be available is the architect route, this one is available in non tech companies, especially big ones. You have the startup route, and the Get Rich Burning Your Twenties mode, but that is a high risk / high reward, and people who think about career planning tend to avoid such things unless carefully considered.

It is advisable to actually consider those options, try to decide what options you’ll want to have available for you in the next 5 – 15 years, and take steps accordingly. For example, if you want to go in the management track, you’ll want to work on thinks like people’s skill, be able to fluently converse with the business in their own terms and learn to play golf. You’ll want to try to have leadership positions from a relatively early start, so team lead is a stepping stone you’ll want to get to, for example. There is a lot of material on this path, so I’m not going to cover this in details.

If you want to go with the Technical Expert mode, that means that you probably need to grow a beard (there is nothing like stroking a beard in quite contemplation  to impress people). More seriously, you’ll want to get a deep level of knowledge in several fields, preferably ones that you can tie together into a cohesive package. For example, networks expert would be able to understand how TCP/IP work and be able to actually make use of that when optimize an HTML5 app. Crucial at this point is also the ability to actually transfer that knowledge to other people. If you are working within a company, that increase the overall value you have, but a lot of the time, technical experts would be consultants. Focusing on a relatively narrow field gives you a lot more value, but narrow your utility. Remember that updating your knowledge is very important. But the good news is that if you have a good grasp of basics, you can get to grips with new technology very easily.

The old timer mode fits people who work in big companies and who believe that they can carve a niche in that company based on their knowledge of the company’s business and how things actually work. This isn’t necessarily the one year experience, repeated 20 times, although in many cases, that seems to be what happens. Instead, it is a steady job with reasonable hours, and you know the business well enough and the environment in which you are working with, that you can just get things done, without a lot of fussing around. Change is hard, however, because those places tend to be very conservative. Then again, you can do new systems in whatever technology you want, at a certain point (you tend to become the owner of certain systems, you’ve been around longer than the people who are actually using the system). That does carry a risk, however. You can be fired for whatever reason (merger, downsizing, etc) and you’ll have hard time finding equivalent position.

The entrepreneur mode is for people who want to build something. That can be a tool or a platform, and they create a business selling that. A lot of the time, it involve a lot of technical work, but there is a huge amount of stuff that needs to be done that is non technical. Marketing and sales, insurance and taxes, hiring people, etc. The good thing about this is that you usually don’t have to have a very big investment in your product before you can start selling it. We are talking about roughly 3 – 6 months for most things, for 1 – 3 people. That isn’t a big leap, and in many cases, you can handle this by eating some savings, or moonlighting. Note that this can completely swallow your life, but you are your own boss, and there is a great deal of satisfaction around building a product around your vision. Be aware that you need to have contingency plans around for failure and success. If your product become successful, you need to make sure that you can handle the load (hire more people, train them, etc).

The startup mode is very different than the entrepreneur mode. In startup, you are focused on getting investments, and the scope is usually much bigger. There is less of a risk financially (you usually have investors for that), but there is a much higher risk of failure, and there is usually a culture that consider throwing yourself on hand grenade advisable. The idea is that you are going to burn yourself on both ends for two to four years, and in return, you’ll have enough money to maybe stop working altogether. I consider this foolish, given the success rates, but there are a lot of people who consider that to be the only way worth doing. The benefits usually include a nice environment, both physically and professionally, but  it comes with the expectation that you’ll stay there for so many hours, it is your second home.

There are other modes and career paths, but now I’ve to return to my job Smile.

Categories: Blogs

How to Create jQuery AutoComplete Textbox in ASP.Net

C-Sharpcorner - Latest Articles - Wed, 10/22/2014 - 08:00
In this article you will learn how to create JQuery AutoComplete textbox in asp.net.
Categories: Communities

Make Custom Control or Component

C-Sharpcorner - Latest Articles - Wed, 10/22/2014 - 08:00
In this article I explain how to make your own custom control in C#.
Categories: Communities

Protection Against Buffer Overflow Attack in .NET

C-Sharpcorner - Latest Articles - Wed, 10/22/2014 - 08:00
This article explained how buffer overflows occur and how to prevent it.
Categories: Communities

Announcing PostSharp 4 RTM

PostSharp - Blog - Wed, 10/22/2014 - 08:00

Today we’re excited to announce the general availability of PostSharp 4, the newest version of our 100%-compatible productivity extension to C# and VB. PostSharp allows developers and architects to automate the implementation of design patterns by encapsulating them into reusable components named aspects. Unlike other development productivity tools, PostSharp does not just make it easier to type code, but results in a smaller codebase that is easier to understand and has fewer defects.

You can download PostSharp 4 today from Visual Studio Gallery and update your projects using NuGet.

PostSharp 4 applies the success of pattern-driven development to the realm of multithreaded applications and provides a thread-safe extension to C# and VB. Application developers can annotate their classes with custom attributes such as [Immutable], [Actor] or [Synchronized] and have their code automatically validated against the model. Any violations result in build-time errors or run-time exceptions instead of data corruptions.

PostSharp 4 makes it incredibly easy to implement undo/redo in desktop and mobile applications by automatically recording changes in model objects. Additionally, it includes more than 15 other improvements and enhancements.

Information in this release announcement includes:

Threading Models

When comparing modern object-oriented programming to assembly language, one can see that notions like classes, fields, variables or methods really simplify developers’ lives and increase their productivity. But when it comes to multithreading, one cannot state that object oriented programming (OOP) delivers so much value. As a result, multithreading is still being addressed at a low level of abstraction with locks, events or interlocked accesses. The resulting cost for the industry, in terms of development effort and number of defects, is enormous.

Alternatives to OOP like functional programming and actor programming have been proposed to address the challenges of multithreading. However, these paradigms are not as appropriate as OOP for business and mobile applications. They have failed to gain wide adoption, existing only in narrow niches where high performance wins over high development cost.

Instead of trying to replace OOP, PostSharp 4 extends the C# and VB languages with custom attributes like [Immutable], [ThreadAffine], [Synchronized] or [Actor], which allow developers to assign a threading model to a class. Based on these custom attributes, the compiler extension validates the code against the model and generates synchronization or dispatching instructions.

PostSharp 4 implements the following threading models:

  • Immutable and Freezable;
  • Synchronized and Reader-Writer Synchronized;
  • Actor;
  • Thread Affine and Thread Unsafe.
What are the benefits?

Thanks to threading models, source code is safer and simpler. Threading models bring the same kind of productivity gains than the stricter C#/VB memory model brought to C++. Source code is more concise and easier to reason about and there are far fewer chances for non-deterministic data races. Threading models make it easier for everyone on the team, not just for multithreading experts, to build robust business applications.

Why is this a significant innovation?

We believe that our approach to multithreading is innovative in many ways, and that its significance exceeds the scope of the PostSharp community. Points of interest include the focus on business applications and average developers (instead of critical software and expert developers); the idea that several threading models can co-exist in the same application as an extension of a mainstream language (instead of requiring a rewrite in a specialized language); and the use of UML aggregation as a foundation to select the synchronization granularity.

See our technical white paper for more details about our approach. We think this new approach could be applied to other object-oriented languages and environments.

Additional Resources

For more information, see:

Undo/Redo

A feature that always scores at the top of each the wish list of each application is undo/redo. Oddly enough, the feature usually remains unaddressed for years because it is awfully painful to implement using conventional technologies. It simply generates too much boilerplate code.

PostSharp 4 takes the boilerplate code out of way. Just add the [Recordable] attribute to your model classes, and they will start appending any change into a Recorder. You can then use the Undo and Redo methods of the Recorder, or add the off-the-shelf WPF buttons to your toolbar.

What are the benefits?

PostSharp 4 makes undo/redo affordable for virtually any application, even line-of-business software that typically has a large object model and a small user base. Previously, the feature had a prohibitive cost and would pay off only in simple applications or software with a large customer base.

The Recordable pattern offers more flexibility than the traditional Memento pattern, and its implementation can be completely automated by the compiler. It demonstrates how better compiler technologies can lead to simpler source code and reduced development effort.

Additional Resources

For more information, see:

Aggregation and Composition

When we built our threading models and undo/redo feature, we realized that we needed a notion of parent-child relationships. When we kept thinking deeper about that, it became clear that most object designs actually relied on this notion. It’s not surprising if one considers that aggregation and composition are core concepts of the UML specification. Yet, it’s a pity it has not been implemented in programming languages. We needed to fix that.

Classes that can be involved in parent-child relationships must be annotated with the [Aggregatable] custom attribute, or with any other attribute that implicitly provides the Aggregatable aspect. Then fields that hold a reference to another object must be annotated with [Child], [Reference] or [Parent].

The principal role of the Aggregatable aspect is simply to automatically set the parent property when a child is assigned to a parent and to implement a child visitor.

For more information, see:

Other Improvements

In addition to the previously described new features, we significantly enhanced the PostSharp Aspect Framework and worked on other components as well:

More Free Aspects in PostSharp Express

PostSharp 4 generalizes the idea of giving our ready-made pattern libraries for free for small projects. PostSharp Express 4 now includes the following features for free – for up to 10 classes per Visual Studio project:

  • NotifyPropertyChanged
  • Recordable, EditableObject (undo/redo)
  • Aggregatable, Disposable
  • Threading (threading models, dispatching)
  • Code Contracts
  • Logging (up to 50 methods)

If you like the new features and want to use them more, you can buy them as a part of PostSharp Ultimate or as an individual product. More on our pricing page.

Platforms Newly Supported

PostSharp 4 adds full support for:

  • Win RT both on Windows 8 (the previous support was error-prone and needed a complete redesign) and Windows Phone 8.1.
  • Windows Phone 8.1 “Silverlight”.
  • C++ “mixed mode” assembly references.
Platforms No Longer Supported

We decided that new releases of PostSharp would not support platforms for which Microsoft no longer provides mainstream support at the time of a PostSharp RTM release.

On development workstations and build machines, PostSharp 4 no longer supports:

  • Windows XP (Vista, 7 or 8 is required).
  • Visual Studio 2010 (2012 or 2013 is required).
  • .NET Framework 4.0 (4.5 is required).

On end-user devices, PostSharp 4 no longer supports:

  • .NET Framework 2.0 (3.5, 4.0 or 4.5 is required).
  • Windows Phone 7 (8 or 8.1 is required).
  • Silverlight 4 (5 is required).

Note that PostSharp 3.1 still supports these platforms.

Summary

While Microsoft has lately been catching up with its competitors in the consumer market, enterprise developers may feel neglected. At PostSharp, our focus is to increase productivity of large .NET development teams. It’s only when you start counting lines of code with 6 or 7 digits – and you realize that every line may cost your employer between $10 and $20 – that you appreciate and receive the full benefits of automating design patterns.

PostSharp 4 marks a significant innovation in the realm of multithreading. It raises the level of abstraction by defining models so the machine can do more and humans must think less. But instead of requiring developers to switch to a different language, it respects their investments in C# and VB and extends the environment in a backward compatible fashion.

PostSharp 4 includes plenty of important new features including undo/redo, parent-child relationships, performance improvements, new advices and more.

It’s an exciting time to be a developer.

Happy PostSharping!

-gael

Categories: Open Source

Code Acceptance Checklist in Sharepoint

C-Sharpcorner - Latest Articles - Wed, 10/22/2014 - 08:00
This article provides a Code Acceptance Checklist for SharePoint.
Categories: Communities

Programmatically Read Discussion Board & Replies

C-Sharpcorner - Latest Articles - Wed, 10/22/2014 - 08:00
In this article we have explored how to fetch Discussion Board Items and Replies.
Categories: Communities