August 2008 - Posts
Via this post.
Following is a quick way to execute code and limiting it within a certain timeout.
Note that the code spawns a new thread.
A better safer code would be using the ThreadPool and wait on the WaitHandle.
Thread t = new Thread(
() =>
{
//Do Stuff Here
});
t.Start();
bool success = t.Join(TimeSpan.FromSeconds(10));
if (success)
{
//Thread completed successfully
}
else
{
throw new TimeoutException();
}
Internet Explorer 6 has problems displaying a PNG image with alpha transparency.
Follow the instructions detailed in this post to solve the issue.
Note that you should apply width & height for every image you apply the style to. (At least from my experience)
I can't believe I wasted 10minutes on something that should be the simplest ever.
You might encounter an exception when trying to host a WCF service in IIS with windows authentication where it would say the IIS isn't configured with windows auth so the service itself can't be configured with windows auth.
I had that exception.
The problem is that the IIS vdir was configured with windows auth! and it still blew up.
After a quick searching, I found this post which did the trick.
So.. if you do encounter this, I hope I saved you some time.
Via this post.
The post discusses the issue of using LINQ-to-SQL with dynamic mappings.
The problem
You have SQL Servers for each of your environments (development, test, pre-prod, production) and in each one, the table names are different. In fact, it’s not the table names that are different but the schema names but since the schema name is part of the table name, it must be specified.
Ex : dev.ZeTable et prod.ZeTable
Easy to solve, right? Just put the schema value in the config file and do a simple concatenation at runtime. Well, it’s not as easy as it seams because the table name is stored in an attribute of the partial class generated by the LINQ to SQL designer and Microsoft didn’t provide a way or method to change it at runtime.
[Table(Name="dev.ZeTable")]
public partial class TheTable
Solution
The solution is to dynamically load at runtime a mapping specific for each environment.
Here’s how to do it:. (Go to the post..)
If you're trying to host a WCF service with a .svc extension and you get a 404 response or get plain text, it means your IIS had not been configured with the .svc extension.
Follow this post instructions.
Via Stefan's post.
Wonderful News! You can enable intellisense in blend
You need to install a plug-in and there's a few gotcha's so do read Stefan's post for all the details.
A great discovery :)