0

Problems running Windows Communication Foundation (.svc) on an upgraded Windows 7 and IIS 7

Posted by Al on Oct 20, 2009 in Dotnet  | View Original Article
 

The installation to upgrade from Vista to Windows 7 does not fix or upgrades IIS 7. So IIS 7 wasn’t fix to run Silverlight xap files of Windows Services.

When trying to run a Windows Service with SVC extension on a Windows 7 machine that was upgraded from Vista, IIS 7 won’t be changed to register the .xap file for silverlight or windows services extensions, you’ll have to do that manually in IIS 7.

Registering the Silverlight XAP extension.

Go to your IIS Manager and open the Mime Types

image

For File extension enter: .xap

For Mime type enter: application/x-silverlight-app

image

 

Register the Windows Service on IIS7

Do not register the .svc extension like xap, you need to register in a different way, open a console application running as Administrator, navigate to:

C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation>

Run ServiceModelReg –i

 

Finally restart IIS with a normal Iisreset or using the IIS manager.

Hope this helps

Cheers

Al

Follow me in twitter | bookmark me | Subscribe to my feed | Add stats to your blog

 

Tags:

 
0

MVC 2 Areas and Containers

Posted by K. Scott Allen on Oct 20, 2009 in Dotnet  | View Original Article
 

Some projects use a container like StructureMap to completely replace MVC’s DefaultControllerFactory. They do by registering all controllers by name using StructureMap’s scanning feature during application startup.

ObjectFactory.Initialize(x =>
    x.Scan(s => {
        s.AssembliesFromPath("bin");
        s.AddAllTypesOf<IController>()
                 .NameBy(type =>
                     type.Name.Replace("Controller", ""));
    }));

A simple controller factory to make this work would look like this:

public class SimpleControllerFactory : 
    IControllerFactory
{
    public IController CreateController(
        RequestContext requestContext, string controllerName)
    {
        return 
            ObjectFactory.GetNamedInstance
                <IController>(controllerName);
    }

    // ...
}

As I mentioned in a previous post, using Areas in MVC 2 means you have the potential for multiple controllers with the same name. A Home controller in the parent project, and a Home controller in each sub-project, for example. Now the simple approach we are using in the code above breaks down. We could do some work to make sure we are registering and looking up types using the proper namespaces, but the logic to look at the namespace constraints is already embedded in MVC’s DefaultControllerFactory.

An easier approach is to use the DefaultControllerFactory to lookup controller types and only use StructureMap to instantiate the controller and resolve dependencies. Doing so means we don’t need to scan any assemblies. StructureMap (and most IoC frameworks) are capable of instantiating an unregistered type as long as the type is concrete. All we need to do is derive from DefaultControllerFactory and override the GetControllerInstance method.

public class BetterControllerFactory
    : DefaultControllerFactory 
{
    protected override IController GetControllerInstance(
        RequestContext requestContext, Type controllerType)
    {
        IController result = null;
        if (controllerType != null)
        {
            result = ObjectFactory.GetInstance(controllerType)
                as IController;
        }
        return result;                
    }
}

Moral of the story: Don’t automatically throw away the DefaultControllerFactory. You may find it has some conventions you can make use of!

 
0

Using SqlBulkCopy To Perform Efficient Bulk SQL Operations

Posted by 4GuysFromRolla.com Headlines on Oct 20, 2009 in Dotnet  | View Original Article
 

Over the years I've worked on a number of projects that have shared a common requirement - the ability for users to quickly import large amounts of data into a back end SQL Server database. One such project was a web application used by teachers and other staff members. The software was initially purchased for just two schools in the district, but was soon expanded to encompass other schools. Every few months one or two new schools were brought into the fold; every time a new school was added an administrative user would have to create accounts for the new teachers and staff members so that they could sign into the site. Initially, the application offered a web page for the administrator to create new user accounts one at a time, but this interface quickly became tedious and impractical once larger schools with upwards of 100 users were brought online.

To allow school administrators to quickly import new users we created a web page from which a user could upload an Excel spreadsheet that contained the one row for every new user; the columns in the spreadsheet mapped to table columns in the database. After uploading this spreadsheet, the application would walk through each row and insert a record into the table. Through this mechanism an administrator could create the 100+ user accounts by first building an Excel spreadsheet (something many of the schools already had on file) and then upload that spreadsheet. This technique may sound familiar - in Importing an Excel Spreadsheet Using Typed DataSets and TableAdapters, author Nannette Thacker walked through building such an interface.

While the described approach works well when importing hundreds of records, it starts to seriously slow down when importing thousands or tens of thousands of records. The slowdown is due to the fact that each imported record sends its own INSERT statement to the database. This results in a lot of "chatter" between the web server and the database server. If you are importing data to Microsoft SQL Server the good news is that this process can be dramatically sped up using ADO.NET's SqlBulkCopy class. In my testing, importing 10,000 records using the one INSERT statement per import record took more than three seconds to complete; using SqlBulkCopy took a fraction of a second.

This article look at how to use the SqlBulkCopy class to efficiently execute bulk operations against Microsoft SQL Server. Read on to learn more!
Read More >

 
0

Mark Miller Will Beat You With a Guitar!

Posted by Mehul Harry (Developer Express) on Oct 20, 2009 in ASP.Net, Dotnet  | View Original Article
 

Check out this 8 minute Mark Miller video interview where he discusses:

  • How he got an Xbox Guitar working with Visual Studio
  • The coding challenge at the DevExpress booth during Microsoft’s PDC 2009

Click the image below and watch the video to learn why I’m so excited to see this in action:

Video: Guitars and Code With Mark and Mehul

PDC Challenge

The coding challenge is simple:

  • You both have a PC with a standard install of Visual Studio.
  • You get to use a standard keyboard and mouse.
  • Mark will use an Xbox guitar and CodeRush.
  • You battle against each other by writing a piece of code.
  • Finish first and win big prizes.

Now, I’m a little skeptical whether Mark can pull it off. I mean that I’m basically crippled without my Microsoft Natural Ergonomic Keyboard 4000. But one thing I’ve learned is that you don’t underestimate Mark “the Millinator” Miller.

What do you think? Will he slaughter the competition or has he bitten off more than he can chew this time? Drop me a line below with your thoughts.

DevExpress PDC 2009 Platinum SponsorDXperience? What's That?

DXperience is a royalty-free tool suite for rapid business application development for WinForms and ASP.NET apps.

Instantly enhance your WinForms and ASP.NET apps by dropping in new feature sets encapsulated in components. DXperience contains:

  • IDE Productivity Tools - Make Visual Studio easier and more effective with IDE enhancements
    • DXCore - IDE tools extensible engine
    • CodeRush - Extensible swiss army knife of tools to make source code editing faster and easier, including code editing templates, code editing utilities (selection, navigation, clipboard), inline code visualizations and the upcoming unit test runner.
    • Refactor Pro - Code editing tools specifically geared for refactoring source code.
  • XAF - Business app framework for WinForms and ASP.NET
  • XPO – Object-relational mapping for .NET
  • Reporting - Reporting "platform" for WinForms and ASP.NET
  • UI Components for WinForms, ASP.NET, WPF and Silverlight

Try a fully-functional version of DXperience for free now: http://www.devexpress.com/Downloads/NET/

Tags: , , , , ,

 
0

Calender Eightysix: JavaScript DatePicker Component

Posted by W3Avenue Team on Oct 20, 2009 in Javascript  | View Original Article
 

Calendar Eightysix is an unobtrusive developer friendly calendar and date-picker, offering a rich user experience for date related functionalities. Powered by MooTools, Calendar Eightysix is cross browser component and has been tested on: IE6+, Firefox 3+, Opera 9 – 9.5+, Safari 3.1+ and Google Chrome.

Calendar Eightysix has a variety of options to style and format the calendar to your needs. All options reside in a JavaScript object which is passed as an argument.

Features

  • Quick navigation by jumping back and forth between months, years and decades without drop-down boxes
  • Highly / easily customizable
  • Packed with three themes
  • Lightweight (9.5 kB compressed)
  • Pure JavaScript; AJAX-less and no PHP needed

Calendar Eightysix script is licensed under the Creative Commons Attribution- NonCommercial 3.0 License. What that means is: Use these files however you want, but don’t redistribute without the proper credits and do not use this for commercial purposes.

Calendar Eightysix requires a purchased commercial license when used commercially. You can find further information, demos and download on Calendar Eightysix Website.

Similar Posts:

You can also stay updated by following us on Twitter, becoming a fan on Facebook or by subscribing to our FriendFeed.

Tags: , , ,

 
0

Introducing Guild 3 Software

Posted by David Starr on Oct 20, 2009 in Dotnet  | View Original Article
 

Three of the Elegant Coders, myself among them, have an announcement to make. Jason Grundy, Jarod Ferguson, and I have all left good, stable jobs to do something we’ve all wanted to do for a long time.guild3_logo_green_white_B..

We’re starting a software company!

Specifically, we have partnered together to open the doors on Guild 3 Software. Readers of Elegant Code are probably familiar with our writing and interests, so hopefully you can guess what we’re about.

Jarod, Jason, and I are strong believers in the ideals set forth in the Manifesto for Agile Software Development and in the Manifesto for Software Craftsmanship. Our shared appreciation for the craft of software development has always drawn us into a huddle at user group meetings and other places where developers gather. We are excited to bring this passion to our customers and our products. Accordingly Guild 3 is founded on four core values:

Integrity, Craftsmanship, Agility, and Community.

You can read more about these, our founding values, here.

But, What Are You Doing?

Several things.

We are working on some exciting, super-secret product opportunities. Maybe they’ll be more on that another time.

In addition, Guild 3 is a professional services organization committed to bringing the ideals of software craftsmanship to our work. We are already working with a few clients and delivering software, of course!

Further, we are participating in community events, conferences, and other opportunities to learn from our peers.

Regarding Elegant Code

To be very clear, ElegantCode.com is not a business. It is a blogging community of professional software developers who simply enjoy each other’s contributions. We will all stay actively involved in ElegantCode.com and will retain our blogging sites here.

Wouldn’t have it any other way.

On a personal note, this doesn’t change my status as a Pluralsight instructor. That’s still a large part of my life. Hopefully I’ll get a chance to visit your company some day.

Shameless Appeal for Work

Surely you saw this coming!

If you have any software development projects you think might be a good fit for an intensely focused group of software craftsmen, give us a ring.

Tags: ,

 
0

JavaScript / jQuery password generator

Posted by Uzbekjon on Oct 20, 2009 in Ajax, Javascript  | View Original Article
 This month, October, is a National Cyber Security Awareness Month. The aim is to increase cyber and internet security awareness among surfers. Google and others are joining the move. So I thought I would write a post regarding internet security to add my 2 cents. In this post you will find JavaScript function that generates random passwords of any length as well as jQuery version. JavaScript

Tags: , ,

 
0

Dynamically Creating Classes From XML

Posted by Jesse Freeman on Oct 20, 2009 in Flex  | View Original Article
  Advanced Flash Tactics or AFTs are techniques that come from deep within the Flash Art Of War, the oldest Flash military treatise in the world. Each AFT is designed to be quickly digested, usually only taking a few minutes to get up and running, and contains valuable information you can directly apply to your next Flash campaign. In this AFT I will go over - Dynamically Creating Classes From XML.

Tags: , , , , , ,

 
0

Getting to No

Posted by nospam@example.com on Oct 20, 2009 in Miscelleneous  | View Original Article
 A bad client relationship is like a bad marriage without the benefits. To avoid such relationships, or to fix the one you’re in, learn the five classic signs of trouble. Recognizing the never-ending contract revisionist, the giant project team, the vanishing boss and other warning signs can help you run successful, angst-free projects.

Tags:

 
0

The Myth of Usability Testing

Posted by nospam@example.com on Oct 20, 2009 in Miscelleneous  | View Original Article
 Usability evaluations are good for many things, but determining a team’s priorities is not one of them. The Molich experiment proves a single usability team can’t discover all or even most major problems on a site. But usability testing does have value as a shock treatment, trust builder, and part of a triangulation process. Test for the right reasons and achieve a positive outcome.

Tags:

Copyright © 2010 Answer My Query All rights reserved. Maintained by Orange Brains .