I use a custom MSBUILD xml file to build some of my projects so that i can run stuff to compress CSS/JS files and stuff like that. After installing Visual Studio 2010 and playing around a bit with suddenly my builds started to fail.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(132,11):
error MSB4064: The "Retries" parameter is not supported by the "Copy" task. Verify the parameter exists on the task, and it is a settable public instance property.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(130,5):
error MSB4063: The "Copy" task could not be initialized with its input parameters.
After some debugging i realized that Visual Studio 2010 had changed a line in the csproj file of my web application project.
From:
To:
I just had to change this line back to v9.0 to get it to work again. Hopefully this can help someone that has the same problem as me.
Posted
on 07 December 2009, 16:12,
by Ola,
under
Web.
I have always thought it has been a hustle to send e-mail from my localhost. As the spam problem has been more and more serious it has been harder and harder to send mails. But today i found this beautiful little app that act as a fake SMTP server. Just use localhost as your smtp server and all mails sent from your application locally will be displayed in its little UI.

Link: smtp4dev
I like the tool ReSharper but i do not really have the money to pay for it. My own site AlternativeTo has some list of alternatives but it would be great if we could add some more.
Ps. This is more or less a test post to test some new functionality on AlternativeTo.
Posted
on 27 November 2009, 16:13,
by Ola,
under
Web.
I’ve done lot’s of “web 2.0″ stuff lately and i just want to write down to really nice tools i found.
Test and Validate JSON
I have just built an API for AlternativeTo. It use JSON and this tool was really a life saver when it came to debug and test everything.
http://jsonformatter.curiousconcept.com/
Test if you website handles Pingbacks correctly
Right now i am implementing a pingback functionality on AlternativeTo and i found this little website that lets you sent pingbacks without having to create a new Wordpress post each time you want to test if everything works. Great stuff.
http://www.solitude.dk/ping/client.php
Posted
on 17 November 2009, 13:13,
by Ola,
under
SQL.
I always forget this command:
SELECT * FROM YourTable TABLESAMPLE SYSTEM (10 PERCENT)
This gives you some sample data from your database. In this case 10 percent of the content. You could also use TABLESAMPLE SYSTEM (1000 ROWS) to get 1000 sample rows. Great to use if you have a big database and do not want the same data again and again when you debug or something.
Posted
on 07 November 2009, 16:35,
by Ola,
under
C#.
Sometimes you want to convert arrays back and forth. This is to nice extension methods to convert a int array into a string array and vice versa.
public static class ExtensionMethods {
public static string[] ToStringArray(this int[] intArray) {
return Array.ConvertAll<int, string>(intArray, delegate(int intParameter) { return intParameter.ToString(); });
}
public static int[] ToIntArray(this string[] strArray) {
return Array.ConvertAll<string, int>(strArray, delegate(string intParameter) { return int.Parse(intParameter.ToString()); });
}
}
Posted
on 07 November 2009, 16:30,
by Ola,
under
JQuery.
ASP.NET Webforms isn’t the best platform to build web applications. I can’t wait to migrate my apps to ASP.NET MVC but until i have the time to do that i have to coup with some of asp.net strange parts.
Today i wanted to invoke a postback via JQuery wich actually was fairly easy but i wanted to write a small post about it.
The trick was to get the Javascript that asp.net call to do a postback, save it somewhere and then executed via the eval() method. I used a hidden form to store the postback script.
In the asp.net file
hdnSearchPostBack.Value = Page.ClientScript.GetPostBackEventReference(SearchButton, string.Empty);
In the js file
function() { eval($("#ctl00_ctl00_hdnSearchPostBack").val()); }
Simple as that!
Posted
on 10 September 2009, 10:52,
by Ola,
under
SQL.
Microsoft has added a setting to Management Studio to prevent us from re-create tables when we make changes to them. I don’t like this settings and it would have be much better if they said ‘This table will be re-created, are you sure you want to do that?” instead of just stop us from doing it.
There is an option to turn this off if you go to “Tools -> Options -> Designers -> Table and Database Designers” and the uncheck the checkbox “Prevent saving changes that require table re-creation”.

When i debug web applications i like to go with the attach to process instead of pressing F5 when i use IIS as the development web server. It has lot of advantages:
- If you are “deep down” in your application you do not have to start from the beginning again. Attach to process lets you debug the tab/window you already using.
- When you “press play” in VS and have Firefox as the default search engine you Visual Studio opens a new tab each time you start and you end up with X number of tabs with your app.
- Probably more that i can’t think of right now.
Anyway the big disadvantage with this is that it is a pretty tedious process to attach to a process.
- Press ctrl-alt-p to bring up the attach to process dialog.
- Scroll down to w3wp.exe and “attach” it. For some reason it doesn’t work to press “w” here either so you have to scroll down manually.
- Click ok and then you have to confirm that you really have to do it.
I have been doing this for months but today i decided to see if Google had any answer to my problem and surely it did. I found this question on Stackoverflow. The answer to the question was to record a macro in Visual Studio that do this for you.
- Press ctrl-shift-r to start record the Macro.
- Do the steps i described above to attach to the process.
- Press ctrl-shift-r again to stop the recording.
Now you have the attach to process as a temporary macro and can run it with ctrl-shift-p. You will get an error if you try to run it when you already attach to a process and so on but it work. If you want to you can look for the error 0×8971001E and add DTE.Debugger.Stop(True) in the catch part of the macro.
You can also save the macro and add it to your toolbar, attach your own keyboard shortcut to it and so on. Check out this article about macros on “Switch on the code”.