Tag | .NET Posts

What are Wearable Devices? The terms “wearable devices“, and “wearables” all refer to electronic technologies or computers that are incorporated into items of clothing and accessories which can comfortably be worn on the body. Examples are Google Glass and Smart Watches. I had the opportunity to explore on android wearable devices, particularly smart watches and have decided to use Xamarin and Visual Studio for the following reasons: Xamarin allows you to build cross-platform apps (iOS, Andriod and ...
Win32 API offers a lot of functionality for Windows platform, which the .NET Framework doesn’t have for good reason – One of them being ‘managed’. However, that doesn’t stop us from doing some unsafe things! We can always build a wrapper for Win32 API and then call those functions directly from .NET. Let us evaluate one of such area which requires calling Win32 API functions from .NET. That area is ‘Simulating UI Automation’. Of course, the subject is too vast to fit in a single blog post, however, ...
If you’re familiar with NetSqlAzMan or CanCan, you know that checking permissions based on a user’s activities is easier to manage and more flexible that working with the roles a user is in. Whatever method you take to add activity based authorization, if you are working in MVC you will run into the issue that AuthorizeAttribute only cares about Users and Roles. The good news is that you can inherit from AuthorizeAttribute and easily adapt it to account for activity-based authorization. If you didn’t ...
Assembly is the smallest unit of deployment in .NET Framework. When you compile your C# code, it will get converted into a managed module. A managed module is a standard EXE or DLL. This managed module will have the IL (Microsoft Intermediate Language) code and the metadata. Apart from this it will also have header information. The following table describes parts of a managed module. Part Description PE Header PE32 Header for 32-bit PE32+ Header for 64-bit This is a standard Windows PE header which ...
I have been following the events at X-tensive.com and excited by the release of DataObjects.Net community license and new features in version 4.5.4. I have always had a sweet spot on DataObjects.Net, mainly because of the clean architecture and features that the product has. Now my mind is getting blown away by features that I never thought may be possible in an ORM. Over the past few months the DataObjects.Net community started working on plugins that would extend the functionality of DataObjects.Net. ...
I recently created a DLL and I wanted to reference it from a project I was developing in Visual Studio. In previous versions of Windows, doing so was simply a matter of dropping the DLL file in the C:\Windows\assembly folder. That would add the DLL to the Global Assembly Cache (GAC) and make it accessible in Visual Studio. However, as is often the case, Window 7 is different. Even if you have Administrator privileges on your machine, you still do not have permission to drop a file in the assembly ...
Good things are hard to kill. One of the most useful predefined compiler macros in C/C++ were __FILE__ and __LINE__ which do expand to the compilation units file name and line number where this value is encountered by the compiler. After 4.5 versions of .NET we are on par with C/C++ again. It is of course not a simple compiler expandable macro it is an attribute but it does serve exactly the same purpose. Now we do get CallerLineNumberAttribute == __LINE__ CallerFilePathAttribute == __FILE__ CallerMemberNameAttribute ...
This is first in series of articles about project I've been building in my spare time since last Summer. Actually it all began when I was researching a topic of modeling human motion kinematics in order to create gesture recognition library for Kinect. This ties heavily into motion theory of robotic manipulators so I also glanced at some designs of robotic arms. Somehow I stumbled upon this cool looking open source robotic arm: It was featured on Thingiverse and published by user jjshortcut (Jan-Jaap). ...
For those out there that are interested… I am now one of the hosts of the Driven2Distraction podcast. Being a fan of podcasts like .Net Rocks and Hanselminutes for years now, I have always wanted to be involved in the recording of a podcast and now that time has finally come. What makes the Driven2Distraction podcast different from all the others out there is its uniquely South African flair. It’s focus is towards Software Development in the Southern Africa – and has a mix of “what happening locally” ...
Just a small tidbit that's sprung up today. I had to book-keep and emit diagnostics for the average thread performance in a highly-threaded code over a period of last X number of calls and no more. Need of the day: a thread-safe, self-managing stats container. Since .NET 4.0 introduced new thread-safe 'Collections.Concurrent' objects and I've been using them frequently - the one in particular seemed like a good fit for storing each threads' performance data - ConcurrentQueue. But I wanted to store ...
Have you ever had the need to implement a 3rd party JavaScript plugin, but your needs didn’t fit the model and usage defined by the API or documentation of the plugin? Recently I ran into this issue when I was trying to implement a web snapshot plugin into our site. To use their plugin, you had to include a script tag to the plugin on their server with an API key. The second part of the usage was to include a <script> tag around a function call wherever you wanted a snapshot to appear. The ...
The Microsoft Press half price deal of the day at http://shop.oreilly.com/pro... is the training material for the MCTS Self-Paced Training Kit (Exam 70-516) "Accessing Data with Microsoft® .NET Framework 4""EXAM PREP GUIDE Ace your preparation for the skills measured by MCTS Exam 70-516—and on the job—with this official Microsoft study guide. Work at your own pace through a series of lessons and reviews that fully cover each exam objective. Then, reinforce and apply what you’ve ...
Node.js is a server-side JavaScript platform "for easily building fast, scalable network applications". It's built on Google's V8 JavaScript engine and uses an (almost) entirely async event-driven processing model, running in a single thread. If you're new to Node and your reaction is "why would I want to run JavaScript on the server side?", this is the headline answer: in 150 lines of JavaScript you can build a Node.js app which works as an accelerator for WCF REST services*. It can double your ...
Introduction I’m currently working on broadening the content in the Windows Azure Service Bus Developer Guide. One of the features I have been looking at over the past week is the support for transactional messaging. When using the direct programming model and the WCF interface some, but not all, messaging operations can participate in transactions. This allows developers to improve the reliability of messaging systems. There are some limitations in the transactional model, transactions can only ...
Hey everyone, I just discovered this great post yesterday that shows how to have msbuild build projects in parallel Basically all you need to do is… Read more at http://blog.danskingdom.com... ...
For the last decade, I have repeatedly, in my imitable Microsoft fan boy style, offered an alternative view to commonly held beliefs about Microsoft's stance on open source licensing. In earlier times, leading figures in Microsoft were very vocal in resisting the idea that commercial licensing is outmoded or morally reprehensible. Many people interpreted this as all-out corporate opposition to open source licensing. I never read it that way. It is true that I've met individual employees of Microsoft ...
So, day 1 of DevWeek. Lots and lots of Windows 8 and WinRT, as you would expect. The keynote had some actual content in it, fleshed out some of the details of how your apps linked into the Metro infrastructure, and confirmed that there would indeed be an enterprise version of the app store available for Metro apps.) However, that's, not what I want to focus this post on. What I do want to focus on is this: Windows 8 does not make .NET developers obsolete. Phew! .NET in the New Ecosystem In all the ...
Financial Apps feel the need for speed – this can come via parallelization, and via infrastructure - fast messaging and non-blocking distributed memory management. This blogpost gives an overview + examples of various technologies that can squeeze performance out of your trading apps and clock cycles out of your modeling apps. Low Latency via Infrastructure ZeroMQ · ZeroMQ is a messaging library - ‘messaging middleware’ , ‘TCP on steroids’ , ‘new layer on the networking stack’. not a complete messaging ...
Unlike the other concurrent collections, ConcurrentBag does not really have a non-concurrent analogy. As stated in the MSDN documentation, ConcurrentBag is optimised for the situation where the same thread is both producing and consuming items from the collection. We'll see how this is the case as we take a closer look. Again, I recommend you have ConcurrentBag open in a decompiler for reference. Thread Statics ConcurrentBag makes heavy use of thread statics - static variables marked with ThreadStaticAttribute. ...
For those interested, myself and a few other people from Red Gate will be going to DevWeek 2012 in London this week. I'll be mostly around the .NET and C# talks, but may drop into the architecture and agile talks as well. I'll be blogging interesting stuff I come across as well. If you want to meet up, do feel free to contact me via the blog or on twitter at @simonmcooper. See you there!Cross posted from Simple Talk ...
In our last post I demonstrated how to implement the datagram channel shape, and in the second and third post I described the request reply shape. In this post I will explain the last MEP in WCF, duplex, which is the most complex one. Basis of the Duplex Channel Shape (MEP) In the MSDN document it said that “The duplex MEP allows an arbitrary number of messages to be sent by a client and received in any order. The duplex MEP is like a phone conversation, where each word being spoken is a message. ...
In the previous post I demonstrated how to implement a very basic transport extension over an in memory message bus that supports request reply MEP. At the end of that post I created a console application and establish the service and client directly through the channel listener (on the server side) and the channel factory (on the client side). But this is not the WCF usage that we are familiar with. If you have been using the WCF for a while the common pattern is to create a ServiceHost on the server ...
Cloud computing gives us more flexibility on the computing resource, we can provision and deploy an application or service with multiple instances over multiple machines. With the increment of the service instances, how to balance the incoming message and workload would become a new challenge. Currently there are two approaches we can use to pass the incoming messages to the service instances, I would like call them dispatcher mode and pulling mode. Dispatcher Mode The dispatcher mode introduces ...
This post is continued HERE. Go to Part 1 – List of Product Updates for information on Visual Studio and TFS 2012 updates Looking for the VS 2010 extensions ? Go to Visual Studio 2010 - List of Product Updates (Part 1) + Extensions (Part 2). Looking for links to the test adapters, go to this blog post. UPDATE Aug 18th 2013: Updates: Visual Studio Tools for Git, TypeScript, ReSharper, TFS Power Tools, Code Contracts, Build Manager, Web Essentials, Code Contracts, tangible T4 editor , Just Decompile, ...
I have seen many Sharepoint Newbies cracking their head to create a Console/Windows application in VS2010 and make it talk to Sharepoint 2010 Server. I had the same problem when i started with Sharepoint in the begining. It is important for you to acknowledge that SharePoint 2010 is based on .NET Framework version 3.5 and not version 4.0. In VS 2010 when you create a Console/Windows application, Make Sure you select .Net Framework 3.5 in the New Project Dialog Window.If you have missed while creating ...
Today's $10 Deal of the Day from APress at http://www.apress.com/97814... is Pro Agile .NET Development with SCRUM."Pro Agile .NET Development with SCRUM guides you through a real-world ASP.NET project and shows how agile methodology is put into practice." ...
The beta for BIDS Helper 1.6 was just released. We have not updated the version notification just yet as we would like to get some feedback on people's experiences with the SQL 2012 version. So if you are using SQL 2012, go grab it and let us know how you go (you can post a comment on this blog post or on the BIDS Helper site itself). This is the first release that supports SQL 2012 and consequently also the first release that runs in Visual Studio 2010. A big thanks to Greg Galloway for doing the ...
One of the earliest lessons I was taught in Enterprise development was "always program against an interface". This was back in the VB6 days and I quickly learned that no code would be allowed to move to the QA server unless my business objects and data access objects each are defined as an interface and have a matching implementation class. Why? "It's more reusable" was one answer. "It doesn't tie you to a specific implementation" a slightly more knowing answer. And let's not forget the discussion ...
In my early development days, I used Microsoft Access for building databases. It made things easy since I only needed to package the database with the installation package so my clients would have access to it. When we began the development of a new package in Visual Studio .NET I decided to use SQL Server Express. It was free and provided good tools - also free. I thought it was a tremendous idea until it came time to distribute our new software! What a surprise. The nightmare Ah, the choices! Detach ...
Don’t ask me why I did it because I don’t have a good answer. Just because I can probably. I have a solution with several DLL projects some of which depend on others. They all reference (via project references) a common “Library” project for instance. All of these are then referenced by the main application project. It occurred to me to set the “Copy Local” property of references to things like the Library to False. Why have all that junk copied to your output folder when it’s not really needed there? ...
If you are installing SharePoint 2010 on a new box you might see the Setup Errors notification from the installer. In my case, I am using Windows Server 2008 R2, but I have seen the similar Error on Windows 7 as well with little less requirements. As you can understand all the “-“ bullets are the requirements that needs to be installed or configured on the box. There are two ways to do this 1) Microsoft SharePoint 2010 Product Preparation tool In the SharePoint 2010 Splash Form, you can find that ...
I have a few conferences I’ll be speaking at in the next few weeks. The first is SharePoint Cincy in Cincinnati, OH on Friday March 16th. The other is SharePoint Saturday Twin Cities in Minneapolis, MN on April 14th. Below are the details for each. Assuming copies of my book arrive in time for either conference I’ll be giving away a book or two and signing them. Stop by and see me if you’ll be attending either conference. Sessions Where: SharePoint Cincy 2012 Title: PowerShell for the SharePoint ...
In my attempt of installing and configuring SharePoint 2010 Farm, I have given a new Windows Server 2008 R2 box that should have SQL Server 2008. So when I attempt to install SQL Server 2008 on it, I came across the following error message. Not so weird because every server product have a set of requirement to be installed. First off, before you do any thing Just run the Windows Update. That’s recommended because there can be some thing else that is not mention in this post or any other but can hanged ...
The new mobile framework we released today extends to Enterprise Mobility the revolution that Visual WebGui brought to Enterprise RIA Applications. Just like Visual WebGui for Web, the new Enterprise Mobile framework also provides a classic .NET development paradigm within Visual Studio. This allows leveraging existing development skillset for building HTML5 mobile applications and extending enterprise IT to the post PC era. The new framework is optimized for enterprise mobility and supports the ...
Today's 50% off Deal of the Day from O'Reilly is Developer's Guide to Collections in Microsoft® .NET "Put .NET collections to work—and manage issues with GUI data binding, threading, data querying, and storage. Led by a data collection expert, you'll gain task-oriented guidance, exercises, and extensive code samples to tackle common problems and improve application performance. This one-stop reference is designed for experienced Microsoft Visual Basic® and C# developers—whether you’re already using ...
If anyone of you has debugged managed crash dumps, I am sure you must have come across a situation when debugger keeps telling you it’s not able to load mscordacwks.dll. It usually happens when the dump was taken from a machine that had a specific version on .NET framework with patches installed and the machine where the crash dump is being analyzed has different .NET framework version number. When I talk about different version no, I mean the minor version. E.g. Crash dump was taken from machine ...
We wanted to follow recommendation from http://omaralzabir.com/best... to“add “From” header and set the server name. I do this on each webserver and specify different names on each box. It’s handy to see from which servers requests are being served. When you are trying to troubleshoot load balancing issues, it comes handy to see if a particular server is sending requests” However one of the client of our rest service reported that From value in the response ...
It is an oft-repeated maxim that you shouldn't add methods to a publically-released interface in an API. Recently, I was hit hard when this wasn't followed. As part of the work on ApplicationMetrics, I've been implementing auto-reporting of MVC action methods; whenever an action was called on a controller, ApplicationMetrics would automatically report it without the developer needing to add manual ReportEvent calls. Fortunately, MVC provides easy hook when a controller is created, letting me log ...
I decided to download and install the Windows 8 and Visual Studio 11 previews. I figured I had an Acer Inspire One netbook that BARELY met min specs that was holding down paper (as on does with an Acer netbook....) I will not tell you about the installation of Win8. This is because I had my brother download and install it. I will say that he had already downloaded and created the install package on a USB drive. I gave him the netbook at 1PM. He sent me a text saying it was done at 5PM. To me, that's ...
If you have not heard the latest technical news yet, the SQL Server 2012 Virtual Launch event is today March 8, 2012! Register to not to miss this opportunity to interact with technology experts and win cool prizes! I am thrilled and excited! Why? Because like in the automotive industry, every new iteration of a vehicle is more fuel efficient, safer, more polished, looking more attractive and fun to drive. Sure, the the new version of the SQL Server is ready to take me further in what I can deliver ...
After months of plotting and planning and organizing the logistics to host a full day workshop for the local area .NET developers/enthusiasts (refer to my post, Trials and Tribulations of Running a Full Day Workshop), CTTDNUG's Mobile + Cloud App Workshop went off without a hitch! Not without some minor bumps along the way, believe you me. In the 24 hours leading up to that event, I had my fair share of concerns. Mainly the weather. Environment Canada had issued a severe weather alert that resembled ...
Microsoft recently (12-29-2011) released an update to address several serious security vulnerabilities in the .NET Framework. One of the fixes introduced by MS11-100 temporarily mitigates a potential DoS attack involving hash table collisions. It appears this fix breaks pages that contain a lot of POST data. In our case, on pages that have very large checkbox lists. Why would this be the case? There are some information on this limit to be at 1000....so if your webpage was working fine earlier and ...
It is highly significant that a Go-Live licence is now available for Visual Studio 11 beta. The key sentence is "Visual Studio 11 Beta and .NET Framework 4.5 Beta meet our high standards for pre-release software, so we support application design, development, test, and deployment in test and production environments.".Full details of the Go-Live at http://www.microsoft.com/vi... is still on-going with VS11. I intend to install VS11 on my development PC. ...
Last week I was asked to mask or obfuscate a large volume of data residing in a production database for our software quality assurance team to use in testing some functionality. The data resided in various tables and in several columns per table. Yet, this procedure would need to be done over and over again as the data gets depleted. Yet, the masking supposed to be hidden from the QA people and centrally controlled. I proposed to use SSIS. The next day I did a web scan to just find out that noting ...
It is about time to look at the new .NET Framework 4.5 release along with the brand new Visual Studio 11 Beta 1. Besides the new features I wanted to see if the massive performance complaints have been taken and addressed. First the good things. VS11 Beta 1 does start a lot quicker as its predecessors. It is nearly as fast as VS2008 which was from the performance aspect the best release since VS6. This is great news. Below are some numbers I did compile on my Windows 7 x32 PC with a Intel Duo 6600 ...
From Brian Keller: “I’m very pleased to announce the availability of the Visual Studio 11 Beta ALM Virtual Machine along with 6 hands-on-labs / demo scripts. This marks an exciting milestone in our journey towards RTM. You can now roll up your sleeves and start learning about the many capabilities we announced at TechEd North America last year and have been talking about in greater detail since then. You can download and install the beta of Visual Studio 11 (and Team Foundation Server 11, .NET Framework ...
Recently, I've been doing some work involving cryptography, and encountered the standard .NET CryptographicException: 'Padding is invalid and cannot be removed.' Searching on StackOverflow produces 57 questions concerning this exception; it's a very common problem encountered. So I decided to have a closer look. To test this, I created a simple project that decrypts and encrypts a byte array: // create some random data byte[] data = new byte[100]; new Random().NextBytes(data); // use the Rijndael ...
1 What are closures? 1.1 Evolution of Delegates in C# 1.2 Delegates => Closure 2 Captured Variable 2.1 Value of Captured variable 2.2 Lifetime of Captured Variable 1 What are closures? Closures are function which can be stored in a variable, passed around as parameter and refer to the variables visible at the time they are defined. 1.1 Evolution of Delegates in C# If we look at the evolution of delegates over the time, it has evolved from standard way of declaration to Anonymous method in C# 2.0, ...
Contents Purpose Audience What is floating point number? Types of floating point number in C# System.Single (float) System.Double (double) System.Decimal (decimal) Caveats of floating number Comparing results of double and decimal operations. Comparing performance of binary and decimal floating number When to use decimal? 1. Purpose This article compares the pros and cons of using different floating numbers and discusses when to use what. It stresses upon the implications of using floating numbers ...
Using locks to implement a thread-safe collection is rather like using a sledgehammer - unsubtle, easy to understand, and tends to make any other tool redundant. Unlike the previous two collections I looked at, ConcurrentStack and ConcurrentQueue, ConcurrentDictionary uses locks quite heavily. However, it is careful to wield locks only where necessary to ensure that concurrency is maximised. This will, by necessity, be a higher-level look than my other posts in this series, as there is quite a lot ...