Posts tagged with .NET

  • Playing with TeamCity on Azure

    I spent the past two days playing with setting up TeamCity on Azure. This is just a poc more than anything else, but it’s always fun to do something new. I had to fiddle about with some things that didn’t work as expected, so here are some notes to remember what I did.

  • How to use StyleCop.Analyzers

    I played a bit with StyleCop.Analyzers the other day and I wanted to share what I did. I’ll be showing how to add a stylecop file, how to use the same rules across projects, how to create a custom ruleset file.

  • TDD with .NET Core and Visual Studio Code

    In this post we’ll see how to create a .NET Core solution with two projects with using nothing but the command line. Once that is setup, we’ll do a bit of TDD using Visual Studio Code.

  • Code coverage for open source .NET with AppVeyor and Coveralls

    Code coverage is a useful metric of the quality of your code. It shows how much code is being covered by unit tests. It doesn’t necessarily mean that the unit tests are well written, but no metric can probably tell you that. However, aiming for a specific code coverage, let’s say 70%, is a good practice, because failing to meet the goal might mean somebody didn’t write enough unit tests.

  • Troubleshooting TypeLoadException in mono

    I don’t do a lot of .NET programming these days. At work we deal mostly with JavaScript. However, C# is still the language I’m more fluent in and, also important, a language that I really like. That’s why sometimes I like to code a bit in C# at home. That can be either on Windows or on a Mac with Mono. The problem with Mono is that things can always be a bit different and require some extra effort.

  • View .NET assembly version on Ubuntu

    When you want to view the assembly version of a .NET assembly in Windows, you just right click the DLL and view its properties. Or, you just hover the mouse over the file and the version number will be shown in the tooltip. In Linux, things aren’t as easy.

  • Compiling Mono and friends on Ubuntu, v2

    This is an updated guide on how to compile mono from source on Ubuntu. This time, it’s about Ubuntu 14.04 (trusty tahr). This post covers:

  • log4net SmtpAppender on mono

    I have some problems with the SmtpAppender of log4net on mono. I couldn’t figure out what was going wrong, it just wasn’t sending any e-mails.

  • Using controllers with the same name in ASP.NET MVC

    How to use controllers that have the same class name but different namespaces in ASP.NET MVC.

  • MSBuild Community Tasks NUnit and Mono

    As an experiment, I modified an NUnit test project to automatically test itself after the build process. This way, the unit tests become an integral part of the build; just by building in Visual Studio you’ll know if you’ve broken a unit test.

  • Compiling Mono and XSP on Ubuntu

    For future reference, this is what you need to do in order to install Mono and XSP on Ubuntu Server 12.04.3 LTS x64. This is about a completely blank installation, where only the SSH server role was selected during the installation of the OS.

  • BlogEngine.NET MVC - Progress update

    Here’s a short update on what I’ve been working on. Time is a bit limited but I like to hack around in this project and that’s what it’s all about!

  • BlogEngine.NET MVC - Posts and Pages

    In the latest commit on BlogEngine.NET MVC, which is always available here, the following have been added:

  • BlogEngine.NET MVC - Login time

    It’s not difficult to implement a basic login system. BlogEngine.NET comes with its own membership and roles providers, so all we need to do is create a controller that uses the standard Membership features of .NET.

  • BlogEngine.NET MVC - Hello world

    So, to share a bit more of my excitement, here’s a screenshot of the classic ASP.NET and the MVC versions running side by side:

  • BlogEngine.NET MVC

    Finally, I got to play with ASP.NET MVC for a real project at work. I really enjoyed it, but it lasted only for a few weeks.

  • w3c-nant version 1.2.0 released

    Version 1.2.0 of w3c-nant was released today. This version contains some improvements submitted by Rob Richardson:

  • Run dotCover from msbuild and ccnet

    TeamCity is a very nice tool that I use at home. Unfortunately the free license allows up to 20 configurations. That’s why I’m experimenting also with another free tool, CruiseControl. It’s definitely not as easy as TeamCity, you have to edit (which means learn) an XML file that the server picks up. In general, it probably supports what TeamCity supports, but you have to make everything yourself with a lot of work. Then again, it’s completely free.

  • Synchronizing App_Data with git

    When you have a web application that stores data in it’s App_Data folder, at some point you’ll want to synchronize the development environment(s) with the live environment. This way your development machine will have the latest live data. This is a task that can be achieved with git.

  • Mac and Mono

    Some random steps on getting my Mac up to speed with Mono development.

  • w3c-nant version 1.1.1 released

    Short after releasing version 1.1.0, a new bug-fix version is been released.

  • w3c-nant version 1.1.0 released

    A new version for w3c-nant was released today. What is new in this version:

  • Extending NUnit: NUnit Companion

    I have several test fixtures (test classes) written in NUnit that verify my data layer works against a live database (MSSQL). By live I mean that there is no mocking or anything like that - that’s for the higher layers where I mock the data layer.

  • Announcing w3c-nant version 1.0.2 - now with FTP upload task!

    I added a new NAnt task in the w3c-nant library to allow FTP uploads. Using the same fileset mechanism as the copy task, you can create powerful scripts to automate deploying in a remote FTP server. Or at least that’s what I’m using it for!

  • Continuous Deployment with a Windows Service project

    For a long time now I had a long running process here at home implemented as a Windows Console application. The application was quite stable, but from time to time I had to fix a bug or add a new feature. Before deploying a new version, I would have to login to the deployment machine where the application was running and terminate it, otherwise deployment would fail trying to copy over the new files. Quite tedious. And then I would have to start it again, as soon as the deployment server had finished its job. I like to automate this kind of things.

  • WCF and deferred execution - where is my Exception?

    A long time ago, I blogged about WCF and deferred LINQ queries and some surprises that combination may have. Back then, our WCF service would crash inexplicably when the returning type of an operation would contain an enumerable whose evaluation was deferred until after the WCF operation was out of scope.

  • Overriding EPiServer pages

    It is not very frequent or pretty but still sometimes it’s inevitable: we have to “steal” the code of EPiServer through Reflector/ILSpy/other and modify it to suit our needs. This way you can customize pages or user controls anyway you wish, beyond the way EPiServer allows through conventional channels.

  • WCF, JSON and the DateTime

    I’m playing with a WCF service that works with JSON. If you haven’t done this already, it’s fairly easy. In the web.config, make sure your service is using the webHttpBinding binding. Also you’ll need an endpoint behavior that looks like this:

  • MasterType directive and namespace conflicts

    Let me start by saying that I hope you won’t run into this one and that you probably won’t.

  • IIS 7 gives 404.17 error with svc WCF services

    If you try to access a svc service hosted in IIS and you get the following error:

  • Exceptions using type initializer based singletons

    A popular web page describing how to implement a singleton in C# is this one, where several ways to implement a singleton are discussed. I usually pick the last option, which, according to the author of that page, has the most benefits. The author goes on to mention some problems that can occur if an exception is thrown in the constructor, but I never paid attention to that until recently.

  • How to use SQLite with Mono and Fluent NHibernate

    So I have setup my project playing nice in Windows .NET 4.0 with SQLite and Fluent NHibernate. I opened it up from my Mac to see if it would still work and, big surprise, it didn’t. It complained about System.Data.SQLite.dll not found, even though the dll was there.

  • Thread-safe code

    Consider this code:

  • Custom progress indicator for UpdatePanel

    In ASP.NET the UpdatePanel can help you create an AJAX experience very fast and easy. It is typical to provide some visual element in the page that indicates that the AJAX request is been processed. This can be an animated image, a simple text message, a pretty modal box with a nice shadow effect - anything that does the trick and tells the user that the page is not broken but it’s busy.

  • SystemWebCompanion

    In many ASP.NET web applications, there are some small bits of code that you have to write over and over again. They’re too small so you never bother to refactor them out as a reusable dll. After all they are so small that it’s very fast to create from scratch again. They end up as a Utils.cs file somewhere in your project, probably repeated in all your projects in one form or another.

  • Valid HTML and Valid CSS

    This blog (and this site in general) has two nice image buttons at the end of the page, saying that the HTML and CSS are valid. Are they really?

  • ASP.NET IsMobileDevice and how it works

    In ASP.NET, you can use the IsMobileDevice property in the Request.Browser object of the current request to figure out if the user is calling your application using a mobile device.

  • WCF with IIS and multiple http bindings

    If you’re writing a WCF service using .NET 3.5 and the service is hosted in IIS, there is a situation where you will get this strange error message:

  • Getting the client's timezone in ASP.NET

    The client (browser) doesn’t send any information to the server regarding the client’s timezone. It’s just not supported. One might try to guess the timezone from the culture or even try to guess it from this new geo-location feature. Maybe in the future there will be a new header like “X-Client-Timezone: UTC+1” but for the time being a good approach is the following.

  • Playing with MonoMac

    Yesterday I played a bit with MonoMac, a new framework for Mono that you can use in order to create .NET applications that have a native look and feel in Mac OS X. I have never done any Mac related development in the past so I had to read up on how Apple builts its UIs. My experiments made their way to ResxTranslator’s code base, so I intend that ResxTranslator will have three separate UIs: WinForms, GTK# and now Cocoa via MonoMac!

  • ResxTranslator: a resx file editor

    ResxTranslator is an open source project that facilitates easy translation of resx files. Resx files are XML files that .NET uses to store localizable strings. Visual Studio offers a built-in designer but MonoDevelop currently doesn’t offer support for resx files. In addition to that, ResxTranslator is able to open multiple files in the same window, so that a user can translate strings while looking at the original text at the same time. Oh, and it is at this moment developed only by me when I have some time to spare :-)

  • Deferred LINQ queries in WCF services

    Consider the following WCF service:

  • First Umbraco experience

    Today I played a bit with Umbraco for the first time. I mostly focused on its multilingual support, which is a feature I usually expect from a CMS.

  • Playing with Castle DynamicProxy

    If you’ve ever used an ORM tool, such as NHibernate or the Entity Framework, you’ll probably have noticed that their goal is to be as unobtrusive as possible. They say, and I agree, that you shouldn’t be forced to have your business objects inherit from strange classes like MarshalByRefObject, or to annotate your properties with all sorts of ORM specific attributes. In that aspect, I find NHibernate to be rather clean.

  • Dynamic PNG Image Generation with ASP.NET

    I had created a small web app in MonoDevelop that created a png image on the fly. Porting the app to Windows .NET 3.5 with Visual Studio 2008 was almost painless, but it did include two unexpected incident. The first one was… well the app didn’t run anymore, showing the dreadful “A generic error occured in GDI+”. A bit of a research lead to this article here. Apparently the problem occurs only with PNG images. The stream that you write the generated image to needs to be seekable and I guess in Mono the Response.OutputStream is seekable but in .NET it’s not. The solution is to use an intermediate MemoryStream to write the image to and then dump that stream on Response.OutputStream.

This site uses third party cookies from Google Analytics and Google AdSense Accept and close popup