Now that was a smooth transition. Within minutes BloggingAbout.NET was upgraded from version 2007.1 to Community Server 2008. We've gotten a brand new license from the great folks over at Telligent, the folks behind Community Server.
For logged in users, the frontpage will show recent activity of blogs, posts, threads and friends you're linked to or were active in. Not logged in users will see a welcome message and latest activities. That page is quite empty with no recent activity, I'm looking into it why this is. Also not all posts for every blog comes up in the blogs overview when you're not logged in.
If you see any other problems or have questions, don't hesitate to contact us.
Thanks,
Dennis van der Stelt
TAGS
When you've installed Community Server on Windows 2008 and especially are running under IIS7, you'll probably get some problems with at least your tags. Community Server will throw a 404 "Page not found" error on tags with spaces. If that's the case, open up your web.config and paste the following code at the bottom, but within the "configuration" tags.
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true" />
</security>
</system.webServer>
Now IIS7 might still throw an error because the configuration won't allow you to overrule the default setting. In this knowledge base article you'll find more information.
Find the following file %windir%\System32\inetsrv\config\applicationHost.config and open it in Notepad under Administrator permissions. Find the key 'requestFiltering' and set overrideModeDefault to "Allow" instead of "Deny".
AVATARS
When your avatars aren't showing, it might be because you're running in "Classic .NET AppPool" mode and not in "Integrated Pipeline". Change it and it should work.
If you're looking at this, you're looking at BloggingAbout.NET on a brand new 19" server that's dedicated to BloggingAbout.NET. We were hosted on a server with about 100 or 200 other sites and we were pulling so much traffic and resources that our sponsor has decided to give us a brand new 19" in their own rack. Here are some pictures.

Although this won't be the only site on this server, all will be personal sites and will probably not pull as much traffic as this one. With uncompressed traffic we were pulling over 2.5 Gigabytes a day. On this new server we should be running much faster and hopefully never go down, although that's all up to me now, with some support from our sponsor of course. Thanks to Tellus for providing this!
The first site I tested this with is my brand new personal site http://dennisvanderstelt.nl/ running on GraffitiCMS. Although it's in Dutch, it's probably worth taking a look.
I was looking for CopySourceAsHtml for Visual Studio 2008, but for some reason it's not on the 'official' page so I had to search for it. There are multiple versions, but on Guy Burstein's blog there's more information and the only RTM version I could find.
I always search on Jan Schreuder his weblog for the following piece of css to include:
border-top: windowtext 1pt solid;
border-top-color: #CCCCCC;
padding-top: 1pt;
border-left: windowtext 1pt solid;
border-left-color: #CCCCCC;
padding-left: 1pt;
border-right: windowtext 1pt solid;
border-right-color: #CCCCCC;
padding-right: 1pt;
border-bottom: windowtext 1pt solid;
border-bottom-color: #CCCCCC;
padding-bottom: 1pt;
width: 100%;
overflow: auto;
background-color: #F5F5F5;
Can't live without CopySourceAsHtml now, can we?!
BloggingAbout.NET is doing great in visitors, bloggers and traffic. Unfortunately a bit too good for what we can provide. We're running into increasing hosting costs as we currently pull dozens of Gigabytes of data and our database is also growing larger and is reaching almost 200GB. Therefore the BloggingAbout.NET team has made some decisions on how to move forward in the future.
The first wave of change will be adds on every page, including in the RSS feed.
The next wave will be to charge of a small fee to all who currently have a weblog at BloggingAbout.NET.
We've provided excellent support and a great change for everyone to grow so we think our community is definitely worth it. We're still deciding on how much we'll charge, but it'll be around $10 per month or a slightly larger yearly fee. If you want you can comment and tell us what your preferences are, both as weblogger and as visitor.
Thanks in advance for the understanding,
BloggingAbout.NET team
Update : It's April 2nd now... Hope you got it, because April fools! ;-)
Update 2 : What is cool is that BloggingAbout.NET is currently on a server with a load of other websites. Soon we'll have a dedicated 19" machine! And no, no payment required from anyone! ;-)
In Visual Studio 2008 you can right-click a project and choose for "Add service reference" to create a proxy class for your web service. WCF preferred, of course.
But for some reason, the Visual Studio team disabled it when you're in debug mode. Something that used to work in Visual Studio 2005, so after starting a host, you could add the reference. In VS2008 this is disabled, or grayed out'.
The solution is to set your host as startup project, press CTRL-F5 so it'll be started without debugging and then you're able to choose to add the service reference.
I've been looking all around for information about Silverlight its Isolated Storage. I was doing some tests with storing files and wanted to clear the isolated storage. I'll repeat the same words for SEO purposes : clear silverlight isolated storage. :-)
After I finally found the folder myself, using Sysinternals ProcessMonitor, I searched again on the internet if anyone had referenced the folder yet. Of course the one and only Mike Taulty did. How come these three English chaps do so much great work?
The word is that the isolated storage for Silverlight is cleared when the browser cache is flushed, and perhaps it's because of the beta, but this wasn't my experience. If you want to clear the cache, go to the folder below, find the specific file(s) and delete them there.
C:\Users\Dennis\AppData\LocalLow\Microsoft\Silverlight\is
If you want more information about Isolated Storage in Silverlight 2, check out this page.
When people want start learning about .NET in general or a specific subject like Silverlight or security, can be send to the "How Do I?" videos. I do this myself a lot of times, because a lot of videos aren't 60+ minutes.
Just as a reminder to myself, the root url is this one.
If you're ready for Silverlight 2, here are some links to help you get started.
- Guy Burstein has a complete list with all the downloads.
- If you're running into troubles, here's a list that might help you.
- Scott Guthrie has a bunch of tutorials online here.
- Scott's tutorials can also be viewed in Silverlight video at Dan Wahlin's site.
And of course the regular sites like silverlight.net.
Wouldn't you like to be able to use the Query Analyzer again? I couldn't count the number of times people have asked for the query analyzer during SQL Server sessions at conferences or at classes. Unfortunately, it doesn't exist anymore. Or at least not for public use! If you've been to sessions you might've seen Microsoft employees (or a single certain Microsoft employee ;-) use his own Query Analyzer.
There is a way to get it back though. I've heard that if enough people vote on an item in Microsoft Connect, the team can't just ignorantly close it again. That's why I'm writing this.
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=297428
Click the above link and tell Microsoft it's important for you to get the Query Analyzer back by rating the item.
Thanks
Last year was a surprise to developers that so much new technology was announced at MIX07. I was there and had a blast. This year I have to read the news from behind my pc. But I'm gathering all news for you and myself.
- Silverlight 2 with GoLive license.
It's downloadable!
Silverlight 2 Beta 1 for Windows
Silverlight 2 Beta 1 for Mac - Silverlight 2 now has controls.
But that's not just it, you get source code and a lot (!) of unit tests for the controls. Always nice to have a look at. - Silverlight on Nokia phones
Microsoft announced that with the help of Nokia they're porting Silverlight to the Nokia S60. The plan is to show it during the keynote.
Read more... - Silverlight 2 for Windows Mobile
Yeah! All my dreams coming true! First .NET Compact Framework, then WCF and now Silverlight?! What could I want more?!
See the first mobile app in Silverlight here. This is IE though! :) - Silverlight 2 and Seadragon
Zooming in on extreme large images. - Silverlight and Sharepoint
Read about it here. - WPF & Shading support
Support for some cool hardware accelerated shaders! Do I hear WPF games?! :) - Internet Explorer 8 Beta 1
It's released, download here for Vista, download for WinXP here.
Awesome!
David, Alex and me just needed to get a load of data from some Excel sheets and work with the data. What's better than to load the data into a DataSet using OleDB and process it using LINQ to DataSets?
Make sure you know what the format of your columns is and that the first row in your sheet holds the name of the column. Then below would be what you need for code.
string filename = @"C:\myfile.xls";
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";
OleDbDataAdapter dataAdapter = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn);
DataSet myDataSet = new DataSet();
dataAdapter.Fill(myDataSet, "ExcelInfo");
DataTable dataTable = myDataSet.Tables["ExcelInfo"];
var query = from r in dataTable.AsEnumerable()
select new
{
RelationNr = r.Field<double>("RelationNumber"),
ClientName = r.Field<string>("ClientName"),
};
foreach (var item in query)
{
Console.WriteLine(item.ClientName);
}
In my last post I explained how you could use WCF and MSMQ to respond to messages asynchronously. We've setup a class library with our service, a console application for our host and a console application for our client. In this post I'll explain how we can use the class library again for hosting our WCF service in a Windows Service.
1: Add the Windows Service
Add a new Windows Service project. Right-click the solution, choose "Add" -> "New Project..." and select "Windows" from the tree on the left. Then select "Windows Service" from the project templates. Call it "MailServiceHost" for example. It'll create the project with a file (class) called 'Service1.cs". Rename it to 'MailService.cs' using the solution explorer.
2: Implement OnStart and OnStop methods
When you look into your MailService class, you'll see that it's derived from ServiceBase and that two methods are already defined. We'll first implement the OnStart method. Here we'll do exactly the same as in the console application created in the previous article.
- Create the message-queue of it does not exist yet.
- Create and open the ServiceHost
The only difference now is that it's a private member variable (defined on class level) because the OnStop method must have access to it as well.
1 ServiceHost _host = null;
2
3 protected override void OnStart(string[] args)
4 {
5 string queueName = ConfigurationManager.AppSettings["SendMailQueueName"];
6
7 Trace.WriteLine("Starting Class-A E-mail Service...");
8
9 if (!MessageQueue.Exists(queueName))
10 {
11 Trace.WriteLine("Creating queue : " + queueName);
12 MessageQueue.Create(queueName, true);
13 }
14
15 _host = new ServiceHost(typeof(SendMailService));
16 _host.Open();
17 }
Here's a quick overview
- Line 1 declares the ServiceHost as member variable.
- Line 5 retrieves the queue name from your configuration file.
- Line 9 & 12 create the queue if it doesn't exist yet.
- Line 15 & 16 instantiate and open the host.
- I've also added a few trace messages. The easiest way to see these is to get DebugView from SysInternals.
Now we have to implement the OnStop method.
protected override void OnStop()
{
Trace.WriteLine("Shutting down Class-A E-mail Service...");
if (_host != null)
{
_host.Close();
_host = null;
}
}
Note that the above code does not do any error handling or check if the ServiceHost its state is actually open, etc, etc.
3: Configuration
Now we have to add configuration. Add a new Application Configuration file and just copy & paste the entire configuration file from our previous Console Application host project.
4: ProjectInstaller
We've created our service, but aren't done yet. For Windows Services it's best if you add a ProjectInstaller so the service can easily be installed. Choose to add a new item to the project and select the "General" category and then the "Installer Class" template.
[RunInstaller(true)]
public partial class ProjectInstaller : Installer
{
public ProjectInstaller()
{
InitializeComponent();
ServiceProcessInstaller processInstaller= new ServiceProcessInstaller();
ServiceInstaller serviceInstaller = new ServiceInstaller();
processInstaller.Account = ServiceAccount.LocalSystem;
serviceInstaller.StartType = ServiceStartMode.Automatic;
serviceInstaller.ServiceName = "Class-A E-Mail MSMQ Service";
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}
}
In the above code we've added a ServiceProcessInstaller and a ServiceInstaller. The ServiceProcessInstaller is used by InstallUtil.exe and we're using it to specify that we want to use the Local System account to run our service. If you specify ServiceAccount.User and don't provide a username and password, it'll request these during installation of the service. With the ServiceInstaller we're specifying that our service has to start automatically on Windows startup and the name of our service.
That's it, our WCF service is now running inside a Windows (Managed) Service.
Download the solution for a complete view on what we've done.
It's been a while since I blogged about one of my favorite topics, Windows Communication Foundation.
In this article I'll explain how you can use MSMQ with WCF to really process messages asynchronously. It's unbelievable how easy this is. Read my complete WCF series on how to set up your first service. The idea in this example is that we have to send some e-mails, but we don't want that to be done immediately.
We'll setup the service with a Console Application. In another post we'll host our service using a Windows Service.
1: Make sure MSMQ is installed.
MSMQ must of course be installed. Check your Windows components to see if it's installed. In Vista this is under "Control Panel" -> "Programs and Features" -> "Turn Windows features on or off".
On the right you can see I've turned on everything. If it's already installed you should be able to take a look at the queues. Right-click on the "Computer" icon and choose "Manage". It's under "Services and Applications".
2: Setup a class library.
Create a new project and make it a class library. Add a really simple interface. Again, if you want to know the how and why, read my complete WCF series.
[ServiceContract(Namespace="http://schemas.class-a.nl/msmq/example01/2008/02/", SessionMode=SessionMode.NotAllowed)]
public interface ISendMail
{
[OperationContract(Name = "SubmitMessage", IsOneWay = true)]
void SubmitMessage(MailMessage message);
}
Now we need an implementation for our service. In the code below I only output the message to the console. Normally you'd use tracing or logging for this, but in a bit we'll build a console application to host everything.
public class SendMailService : ISendMail
{
public void SubmitMessage(MailMessage message)
{
Console.WriteLine("To : " + message.ToAddress);
Console.WriteLine("From : " + message.FromAddress);
Console.WriteLine("Subject : " + message.Subject);
Console.WriteLine("Body : " + message.Body);
}
}
As you can see I'm transferring a MailMessage. Here's the datacontract for it.
[DataContract(Name="MailMessage", Namespace="http://schemas.class-a.nl/msmq/example01/2008/02/")]
public class MailMessage
{
[DataMember(Name="ToAddress", IsRequired=true, Order=1)]
public string ToAddress { get; set; }
[DataMember(Name = "FromAddress", IsRequired = true, Order = 2)]
public string FromAddress { get; set; }
[DataMember(Name = "CCAddress", IsRequired = false, Order = 3)]
public string CCAddress { get; set; }
[DataMember(Name = "BCCAddress", IsRequired = false, Order = 4)]
public string BCCAddress { get; set; }
[DataMember(Name = "Subject", IsRequired = true, Order = 5)]
public string Subject { get; set; }
[DataMember(Name = "Body", IsRequired = true, Order = 6)]
public string Body { get; set; }
}
That's our service, let's get to hosting
3: Create a host
In a next post I will explain hosting this WCF service in a Windows Service. For now, a Console Application will do. It's also much simpler to debug and test our application that way. Add a new Console Application to your solution.
First thing we need to do, is make sure we have a queue. First create a reference to the System.Messaging assembly. Then past the following code in your Main() method.
string queueName = ConfigurationManager.AppSettings["SendMailQueueName"];
if (!MessageQueue.Exists(queueName))
MessageQueue.Create(queueName, true);
As you can see, we're getting the SendMailQueueName from the configuration and if it doesn't exist yet, we'll create it. For the configuration, just download the complete solution.
Now just create a ServiceHost and open it.
Type serviceType = typeof(SendMailService);
using (ServiceHost host = new ServiceHost(serviceType))
{
host.Open();
}
Beside the fact we've checked for existence of the queue using System.Messaging, we did nothing so far concerning MSMQ. The only thing noticeable is setting the operation as a OneWay operation.
4: Setting up the host configuration
Let's have a look at the services configuration. We've configured a single service, based on the SendMailService. It as two endpoints, but one's for exchanging metadata (MEX endpoint). As you can see from the binding and the address of the other endpoint, this is the first time we're specifying that we want to use MSMQ. We're using the NetMsmqBinding and a private queue for our service.
<system.serviceModel>
<services>
<service behaviorConfiguration="MetadataBehavior" name="EmailService.SendMailService">
<endpoint
address="net.msmq://localhost/private/ClassA_SendMail"
binding="netMsmqBinding"
contract="EmailService.ISendMail"
bindingConfiguration="SendMailNetMsmqBinding" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/SendMail/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
Pay attention to the 'behaviorConfiguration' attribute on the service and my 'SendMailNetMsmqBinding binding configuration'. The behavior configuration isn't interesting, it's just enabling the MEX endpoint to work. The binding configuration for the endpoint is slightly interesting. As you can see below I've set the security to 'None'. That's because my laptop isn't attached to a domain. By default it's on transport security, meaning it'll use Active Directory integration, which won't allow me to connect in my situation. You'll get a nice :
Binding validation failed because the binding's MsmqAuthenticationMode property is set to WindowsDomain but MSMQ is installed with Active Directory integration disabled. The channel factory or service host cannot be opened.
The deadLetterQueue attribute is Windows version specific, because I can only set it to custom on Vista and Windows Server 2008. No need for a custom created queue here, it'll just group the messages in the dead-letter queue, so you'll know they're yours. Read this article on MSDN for more info.
<bindings>
<netMsmqBinding>
<binding name="SendMailNetMsmqBinding" deadLetterQueue="Custom">
<security mode="None" />
</binding>
</netMsmqBinding>
</bindings>
5: Creating a client
Normally our client is calling the service directly. We can't do that, but we can get the metadata from our service, because we've set up a MEX endpoint. Add a new console application to your solution and create a service reference to the service. You can add a service reference by starting your service WITHOUT debugging. This way the option isn't disabled in your console client.
Now open the proxy code and insert a message!
static void Main(string[] args)
{
SendMailClient svc = new SendMailClient();
MailMessage msg = new MailMessage();
msg.ToAddress = "dennis@nospam.class-a.nl";
msg.FromAddress = "dvdstelt@nospam.gmail.com";
msg.Subject = "Test mail";
msg.Body = "Wow, is this going to work?";
svc.SubmitMessage(msg);
}
Isn't that extremely simple?! The only difference is in the configuration. This proves a lot of what's WCF is in the configuration.
Test MSMQ by stopping the service and just running the client. You can see the message in MSMQ. Start your host and it should disappear almost immediately.
Download the solution for a complete view on what we've done.
Adel Khalil wrote a post about Mark Miller's latest post on his weblog. And now I'm continuing the linking fest! :)
The woman on the left is a super model named Sara. The reason Mark Miller is blogging about Sara is that she was at DevConnections in Las Vegas. You could challenge her in a coding contest. Interesting was that she had never touched a PC before in her life! Six hours of training in DevExpress' CodeRush and she can beat any developer out there, not using CodeRush! Isn't that fantastic?! See the video for a little proof. You could also go watch Gina code an Outlook style app in under 30 minutes.
Jim Holmes practiced his code using ReSharper but failed to win from Sara! Read about it here. Don't forget to read the comments, where some ReSharper developer comes around and comments : "Still, our tool is better". The arrogance! :) DevExpress challenged him to come by and test his tool against Sara and CodeRush. Way to go DevExpress!
I think the idea to compete against a super model in a coding contest is an excellent idea and proves their product is worth taking a look. Especially since so many people think ReSharper is the only way to go.
More Posts
Next page »