05/05/2010 – update for IE9 Platform Review: in fact, new IE.
Download it here, the release notes (incl. What’s new) – here.
1. Open an URL with IE9 use menu Page –> Open:
2. Use built-in developer tool:
3. Switch to different IE modes:
Enjoy!
Problems, solutions and workarounds: all about using, developing and implementing software across Microsoft technologies...and BTW: yes, I work for Microsoft!
It went too good: starting with free-of-charge Microsoft (c) Virtual PC/Microsoft (c) Virtual Server each serious developer for Microsoft (c) Windows had similar workstation configuration: - client OS (WinXP/Vista/Win7) - development environment (VS05/08/10) - Virtual PC or Virtual Server - set of VHD's presenting virtual machines for development and developer tests
Especially "Undo Disks" did the usage of virtualization software so sweet: just drop the changes of the last session and start over without any needs to reinstall experimental machine.
This was very suitable for server software development since until incl. Windows Server 2008 there was always a 32-bit (x86) version of the server OS. Thus, everybody could emulate a server on his developer machine.
Starting with Windows Server 2008 R2 there are no more 32-bit versions of the server OS from Microsoft: x64 and IA64 only. Even more: on Apr. 4th Microsoft announced end of support for IA64 architecture(i.e. Itanium processor family) and encourages the current IA64 customers to move towards x64.
That means, the only hardware platform any Windows server software developer has to care about is x64.
Looks good, but... neither Virtual PC nor Virtual Server do support 64-bit guests OS. The only way is to use virtual machines with OS instances to develop is to use virtualization software supporting 64-bit (x64) guests OS. For example, Hyper-V - known since Windows Server 2008.
Fine, let us move from Virtual PC to Hyper-V. Not so quickly: there's actually no Hyper-V for client OS: neither Vista nor Win7. The only virtualization software from Microsoft for Win7 is Windows XP mode - AKA Virtual PC. With the same limitation as before: no 64-bit guests OS.
Finally, the developer should now (until the situation changes) select one of possible configurations:
-Box1: Client OS (WinXp/Vista/Win7) + development environment
-Box2: Windows Sever 2008 R2 + Hyper-V + VHDs as virtual machines for development.
Until no Microsoft virtualization software supporting 64-bit guests OS are in place, we have to accept the constraints...
Enjoy!
Hard work over last three days using laptop, today I’ve copied the project files onto the developer box, loaded the project in VS and tried to test. The test project failed with following message:
The location of the file or directory [<here comes the project path/project coniuration file>.config] is not trusted.
The problem is, the config file for the project is copied from other computer.
To solve the problem:
1. Go to the folder containing the config file and view the file properties:
2. Click “Unblock” and review the properties:
3. Restart the project – and enjoy!
(This post is published with Windows Live Writer)
We have a list of WCF services hosted in IIS, implemented in numerous assemblies.
Testing all the services after each deployment we encounter from time to time the error:
The type [ ] provided as the Service attribute value in the ServiceHost directive could not be found.
Unfortunately, there's no much more info, why the referenced type cannot be found. First, we wrote some test code (actually console application to scan the assemblies and implemented service types). This solution has its limits: starting with differences in security context etc.
Surfing the Web, we found following approach to investigate the problem.
Slightly extending the idea, we created the ASPX page, helping us to test deployed assemblies and implemented as services types.
The page collects on start information about all installed in the virtual directory assemblies (optionally - recursively or just the /bin folder) and lists automatically all implemented types after one assembly is selected.
Here's the screenshot for succeeded call:
... and this one - on failure:
The page source:
------------------START
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Runtime.Remoting" %>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
if (!IsPostBack)
{
initializeAssemblyList();
}
base.OnLoad(e);
}
private void initializeAssemblyList()
{
string[] files;
DropDownListAssembly.Items.Clear();
if (!CheckBoxBinFolderOnly.Checked)
{
files = System.IO.Directory.GetFiles(Server.MapPath(""), "*.dll", System.IO.SearchOption.AllDirectories);
}
else
{
files = System.IO.Directory.GetFiles(Server.MapPath("bin"), "*.dll");
}
foreach (string file in files)
{
DropDownListAssembly.Items.Add(file);
}
initializeTypeList("");
}
private void initializeTypeList(string assemblyFullName)
{
DropDownListType.Items.Clear();
if (!string.IsNullOrEmpty(assemblyFullName))
{
foreach (Type type in System.Reflection.Assembly.LoadFile(assemblyFullName).GetTypes())
{
DropDownListType.Items.Add(type.FullName);
}
}
}
protected void ButtonTest_Click(object sender, EventArgs e)
{
try
{
TextBoxResult.Text = "";
ObjectHandle objHandle = Activator.CreateInstance(
TextBoxAssembly.Text,
TextBoxType.Text
);
TextBoxResult.Text =
string.Format("Successfully loaded {0} from {1}.",
objHandle.Unwrap(),
TextBoxAssembly.Text);
}
catch (Exception ex)
{
TextBoxResult.Text = ex.Message + "\r\n" + ex.StackTrace;
}
}
protected void DropDownListAssembly_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
TextBoxResult.Text = "";
string assemblyFullName = DropDownListAssembly.SelectedValue;
string[] chunks = assemblyFullName.Split('\\');
string assemblyName = chunks[chunks.Length - 1];
assemblyName = assemblyName.Replace(".dll", "");
TextBoxAssembly.Text = assemblyName;
TextBoxType.Text = "";
initializeTypeList(assemblyFullName);
}
catch (Exception ex)
{
TextBoxResult.Text = ex.Message + "\r\n" + ex.StackTrace;
}
}
protected void DropDownListType_SelectedIndexChanged(object sender, EventArgs e)
{
TextBoxResult.Text = "";
string typeName = DropDownListType.SelectedValue;
TextBoxType.Text = typeName;
}
protected void CheckBoxBinFolderOnly_CheckedChanged(object sender, EventArgs e)
{
try
{
initializeAssemblyList();
}
catch (Exception ex)
{
TextBoxResult.Text = ex.Message + "\r\n" + ex.StackTrace;
}
}
</script>
<% %>
<html>
<head>
<style type="text/css" media="screen">
body {font-family: @Arial Unicode MS; font-size: x-small; background-color:silver;}
span {font-family: @Arial Unicode MS; font-size:x-small}
.button {font-family: @Arial Unicode MS; font-size: x-small;}
.textbox { width: 700 px;font-family: @Arial Unicode MS; font-size: x-small;}
.dropdown { width: 700 px; font-family: @Arial Unicode MS; font-size: x-small;}
.textboxmulti { width: 700 px; height: 400 px;font-family: @Arial Unicode MS; font-size: x-small }
.validator { width: 700 px;font-family: @Arial Unicode MS; font-size: x-small; color: Red;}
</style>
</head>
<form id="form1" runat="server">
<div><asp:Label ID="LabelAssembly" AssociatedControlID="TextBoxAssembly" runat="server" Text="Enter Assembly Name:"></asp:Label></div>
<div>
<asp:requiredfieldvalidator runat="server"
errormessage="Assembly name missing!" ControlToValidate="TextBoxAssembly"
Display="Dynamic" SetFocusOnError="True" CssClass="validator"></asp:requiredfieldvalidator></div>
<div><asp:TextBox ID="TextBoxAssembly" runat="server" CssClass="textbox"></asp:TextBox></div>
<div><asp:Label ID="LabelSelectAssembly" AssociatedControlID="DropDownListAssembly" runat="server" Text="...or select from list:"></asp:Label></div>
<div><asp:checkbox ID="CheckBoxBinFolderOnly" Text="'bin' folder only"
runat="server" AutoPostBack="True"
oncheckedchanged="CheckBoxBinFolderOnly_CheckedChanged"></asp:checkbox>
</div>
<div>
<asp:dropdownlist runat="server" ID="DropDownListAssembly"
onselectedindexchanged="DropDownListAssembly_SelectedIndexChanged"
AutoPostBack="True" CssClass="dropdown">
</asp:dropdownlist>
</div>
<div><asp:Label ID="LabelType" AssociatedControlID="TextBoxType" runat="server" Text="Enter Fulltypename:"></asp:Label></div>
<div>
<asp:requiredfieldvalidator runat="server"
errormessage="Type name missing!" ControlToValidate="TextBoxType"
Display="Dynamic" SetFocusOnError="True" CssClass="validator"></asp:requiredfieldvalidator></div>
<asp:TextBox ID="TextBoxType" runat="server" CssClass="textbox"></asp:TextBox></div>
<div><asp:Label ID="LabelSelectType" AssociatedControlID="DropDownListType" runat="server" Text="...or select from list:"></asp:Label></div>
<div>
<asp:dropdownlist runat="server" ID="DropDownListType"
onselectedindexchanged="DropDownListType_SelectedIndexChanged"
AutoPostBack="True" CssClass="dropdown">
</asp:dropdownlist>
</div>
<div><asp:Button ID="ButtonTest" runat="server" Text="Test load type" onclick="ButtonTest_Click" /></div>
<div><asp:Label ID="LabelResult" AssociatedControlID="TextBoxResult" runat="server" Text="Result:"></asp:Label></div>
<div>
<asp:TextBox ID="TextBoxResult" runat="server" ReadOnly="True"
TextMode="MultiLine" CssClass="textboxmulti"></asp:TextBox>
</div>
</form>
</html>
------------------END
1. Copy the text.
2. Save in an ASPX file (for example, TestService.aspx).
3. Put the file in Virtual Directory hosting your Services. ![]()
4. Call the page to ensure, the assemblies and the servicing types can be loaded.
Enjoy!
(This post is created with Windows Live Writer)


public Timer(2. Use Change method to Stop/Restart the timer:
TimerCallback callback, // create a private void method with only stateInfo
// argument (the method signature is essential)
Object state, // can be null if you do not plan to use a sync object
int dueTime, // delay before first timer event gets fired
int period // timer event interval - what else
)
public bool Change(3. Do not forget to Dispose() the timer when it is no more required
int dueTime, // set Timeout.Infinite to stop the timer or smth else to continue
int period // see above
)