I opened up an old bloated project today in Visual Studio 2010 and i had huge issues with debugging. I usually use the attach to process way in this project but that suddenly that didn’t work anymore. Then i tried to debug with F5 but that caused my entire Visual Studio to hang. As i said, this is a old and bloated project.
Finally i realized that for some reason the “Attach to process” dialog had change the option “Attach to:” and it was set to “Managed (4.0) code”. When i changed it to “Managed (v2.0, v1.1, v1.0) code” it worked again.
July 26th, 2010 | Posted in ASP.NET, visual studio | No Comments
Google Analytics has become more or less the standard tool for web statistics. Before Google Analytics came to market, you had to either pay or use statistics based on the web server log files. When Google bought Urchin and branded it to Google Analytics they changed all this by giving it away for free.
I’ve actually never tried anything other than log based tools (AWStats, Analog, etc.), WordPress Stats and Google Analytics. So when I got to see a screenshot of Clicky the first time I was sold. But why try something new? Google Analytics is good!
- Google Analytics is pretty boring. Especially because they do not provide statistics in real time, therefore you cannot see directly how many visitors are on your site right now.
- The GUI is a bit too advanced. Eg I have many times tried to find “what times of day are the people on my site”. And the information is there somewhere but it is really hard to find. find.
- Google has a “monopoly” on this. Many complain that Microsoft has a monopoly but I must say that Googles monopoly is “more dangerous”. Take away Google Analytics makes the world’s information spread out a tiny bit more.
- If you build websites for customers it’s perhaps not entirely comfortable giving them a Google account to check their statistics. Clicky has a feature to White Label the product so that it looks like you made it yourself.
- Analytics has no good mobile interface. Of course, you must check the statistics when you are out and drinking beer with your friends. GA and the others doesn’t even have real-time statistics so it wouldn’t been fun anyway.
Meet my new drug, Clicky!
Statistics are addictive, so if you feel that you have poor self-discipline you should stop reading now and do not check the following screenshots on Clicky.



Check it out for yourself: Clicky
July 14th, 2010 | Posted in Web | 1 Comment
Lately I’ve been reinstalling my Windows servers a couple of time due to some problems. I’m running both PHP (WordPress) and ASP.NET on my server. From my WordPress blog I sometimes connect to MS SQL to get some data and this time i could not get the MSSQL extension in PHP to work. I got this error all the time.
call to undefined function mssql_connect()
When you Google this you mostly get the tip that you should put the file ntwdblib.dll in the /ext folder. I have a vague memory that this helped me the last time i had this problem but this time that didn’t help. I also noticed that MSSQL was not loaded when i run phpinfo().
Finally I found this post on the IIS forum that recommended me to run the command.
php-cgi.exe -v
When I did this I got an error message telling me that “This program cannot start because msvcr71dll is missing from your computer”. I then downloaded this dll file, put it in my C:\Windows\SysWOW64 (/system32 if you are on 32 bit). I also recycled my application on IIS and then everything worked. Hallelulja!
I have no idea if it’s related but i used “Web platform installer” to install PHP.
July 14th, 2010 | Posted in SQL, Wordpress | No Comments
I got this error today when i was trying to upgrade some WordPress plugins. It turned out that my disk was full at my webhost. When i googled the error message i got lots of different answers so i just thought i would try to give some google juice to this solution.
July 7th, 2010 | Posted in Wordpress | No Comments
We have moved one of our servers to a VPS. After crash we had to restore the VPS from a backup and when the server was restored we got a couple of strange errors with our IIS server. The server is a Windows Server 2008 R2 and some of the errors i got where.
Windows Process Activation Service (WAS) is stopping because it encountered an error. The data field contains the error number.
–
The configuration manager for Windows Process Activation Service (WAS) did not initialize. The data field contains the error number.
–
The Windows Process Activation Service failed to generate an application pool config file for application pool ‘*’. The error type is ’0′. To resolve this issue, please ensure that the applicationhost.config file is correct and recommit the last configuration changes made. The data field contains the error number.
–
The Windows Process Activation Service service terminated with the following error:
Transaction support within the specified resource manager is not started or was shut down due to an error.
–
Not awesome errors. Of course i tried to Google for the problem and i found lots of other people with similar errors but most of them had to do with missing or corrupt config files and none of these fixes solved my problem. Then i tried to do a Windows Update and saw that i got an error there to. I googled and those errors and found this thread in one of MS forums. It was a fix for the Window Update error with the Code 80071A91.
How-to reset the File System Resource Manager if you receive error 0x80071A91
1. Click Start, click All Programs, click Accessories, right-click Command Prompt, and select Run as administrator.
2. In the Command Prompt window you will need to type the following, and press ENTER: fsutil resource setautoreset true C:\
3. Note: You will need to replace the C:\ with the drive letter that Windows Vista is installed on.
4. Restart your computer, and then attempt to install the failed update(s).
I did as described above and to my surprise the updates did work after this. And to my even greater surprise i entered the IIS Manager and (YEY!) the sites where up an running again and the Windows Process Activation Service where started and then i lived happily ever after.
June 30th, 2010 | Posted in IIS | No Comments
I just spent two hours trying to hide the submenu for a menu item that is not selected in the new menu system in WordPress 3.0. First i found this post in the WordPress forums where someone had built a “Custom Walker” but it was for a slightly different scenario and it was also a really complicated solution. Then i realized that i can do this super simple with jQuery. All you need is two lines of codes.
$(document).ready(function () {
$(".sub-menu").hide();
$(".current_page_item .sub-menu, .current_page_parent .sub-menu").show();
$(".sub-menu li").after("<li class='sub-menu-seperator'>|</li>");
});
This will hide all sub-menus, and then if a parent happens to have the class .current_page_item we show the sub-menu. My god i love jQuery.
Update:
As sushicodeur suggest you could of course do this only with CSS, it’s basically the same thing.
.sub-menu { display: none; }
.current_page_item .sub-menu, .current_page_parent .sub-menu { display: block; }
June 28th, 2010 | Posted in JQuery, Wordpress | 5 Comments
I have just installed two servers with IIS 7 and IIS 7.5 and i have had all sorts of problems with IIS file uploads.
- Issues with permissions for PHP and WordPress. Apparently with PHP you must give your IIS_IUSRS (What is the diffrence between IIS_IUSRS and IUSR btw?) user permission to both your temp direct (upload_tmp_dir) and your regular upload directory in WordPress (\wp-content\uploads)
- Remember to SAVE YOUR POST AS A DRAFT (or publish it of course) before uploading. I just spent the last ½ hour trying to upload images but all i got was “403 Access Denied”. When i saved the post everything worked perfectly.
Well .. this is the issues i found so far. Will update this post if i find anything else.
Links: WordPress File Uploads With IIS, Issue with image upload .. and more
June 22nd, 2010 | Posted in IIS, Wordpress | 1 Comment
This is another awesome feature in LINQ to SQL that i always forget about. Sometimes you have an array of strings or any other type and want to query the database for all values that have one of the values in the array.
string platform = "windows|linux";
string[] platformList = platform.Split('|');
itemQuery = from m in itemQuery
from p in m.PlattformItemRelations
where platformList.Contains(p.Plattform.Text.ToLower())
select m;
Ain’t that a beauty? I got this tip from Ron Connery so all the kudos to him.
June 1st, 2010 | Posted in C#, LINQ | 2 Comments
For some reason I always forget that you do not do .Join on your actual string array. So i might as well write it down here so i never forget about this again.
string mycommalist = string.Join(",", alternatives.Select(x=>x.Item.Name).ToArray())
April 20th, 2010 | Posted in C# | No Comments
A client called me this Monday morning and told me there where some issues with one of their sites. The problem turned out to be some issues the SMTP server. After about 2-3 hours of debugging i desperately tries to do a search on Twitter for “IIS SMTP” and to my surprise i could actually use Twitter’s real time functionality (an area where Google sucks) to figure out the solution to my problem.
Apparently the update KB976323 (Microsoft Security Bulletin MS10-024) removed all settings on your SMTP-server. How lovely and a big fail for the QA department on Microsoft. I quickly added my own server as a mail relay and everything worked again.
But the worst part of this was not that MS wiped all my settings. The worst part was that it also caused my Application Pool to crash with this fine message.
A process serving application pool ‘MyApplication’ suffered a fatal communication error with the Windows Process Activation Service. The process id was ’388′. The data field contains the error number.
And this actually made my website crash and just give the user a Http 503 error (and made quite a disturbance when i celebrated a friends birthday and started to get alerts that the site was down). Any way .. when i uninstalled KB976323 the error message changed to.
A process serving application pool ‘MyApplication’ terminated unexpectedly. The process id was ’2624′. The process exit code was ’0xe0434f4d’.
Both of these errors went away after i fixed the settings on the SMTP server but FFS Microsoft. Try to do some test on the updates you push. I want to have automatic updates turned on but i don’t know if i dare after this debacle.
April 19th, 2010 | Posted in ASP.NET, IIS, Web | No Comments