X Blogs

who you gonna call?

Dev Web Server for Azure Web Roles

clock January 27, 2011 22:17 by author Rok Bermež

Windows Azure uses 64 bit architecture so all dlls deployed to it must also be 64 bit. This poses significat development problem since 'Visual Studio Development Server'  and IIS Express run in 32 bit process. You can always use complete IIS, but it would be better if there was something more lightweight. It turns out there is. There is a nice project on codeplex called "CassiniDev - Cassini 3.5/4.0 Developers Edition" available here. Its binaries are also 32 bit so be sure to get the source and change Build platform target to either 'Any CPU' or 'x64'

  

and rebuild solution. After that just replace contents of 'C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0' folder with your new freshly build 64 bit capable dev server

 



... azure looks back at you

clock January 8, 2011 23:22 by author Rok Bermež

It’s been a month since Azure SKD 1.3 has been released with a lot of new features. Let’s take a look at the ability to user Remote Desktop Connection to your roles first.

In order to enable this feature we must configure our deployments to support it. The easiest way to do so is to right click on cloud service project in visual studio and choose deploys. There you can click on 'Configure Remote Desktop connections'.

Here you can enable RDP connections for all roles and you must set the required security credentials. So let’s create a security certificate first.

Then we set user credentials for our RDP account and set its expiration date.

After that, we export the security certificate so we can upload it to the cloud (you can click on view to open it directly).

We also export private key

And then we upload exported file through the Windows Azure Management portal to our chosen hosted service.

If we take a closer look at what our Visual Studio Wizard did, we can open ServiceDefinition.csdef and ServiceConfiguration.cscfg and see xml additions.


Now we can deploy our solution anyway we like.

Once the deployment is complete and our role is in 'ready' state we can download or open .rdp file through Azure Management portal.

Now we can finally connect to our instance

... and azure looks back at you

NOTE: Changes made to instance will NOT be persisted. This was meant for easier debugging. If you want to take full advantage of IIS configuration you will need to use ‘Full IIS’ feature, which will be covered in my next post.



Bulletproof Cross-Browser CSS Techniques

clock October 13, 2010 18:44 by author Klemen Slavič

I've written up a summary of all tehniques and tricks for cross-browser CSS coding I've learned over the years in a guest post on Script Junkie. It's meant to be a starting and reference point for anyone from beginner to advanced levels.

Have a look.



Changing the default browser in Visual Studio

clock October 5, 2009 23:41 by author Klemen Slavič

If you've gotten used to using a particular browser when browsing (as opposed to debugging in Visual Studio), you can set your system default to something other than IE and still use the aforementioned browser as the one launched when debugging and running web apps.

To change the browser launched by Visual Studio, open any aspx file in Visual Studio. Then choose File -> Browse With... and choose Internet Explorer from the list. Click Set as Default to make it the default browser in Visual Studio and click Cancel.

Now you can use your preferred browser and change the system's default without it affecting the browser choice in Visual Studio.



Adding new WorkitemType to the existing Team Foundation (2008) Project

clock September 16, 2009 17:22 by author Rok Bermež

Recently a friend of mine had to add a new work item type to the template in the existing (and supposedly large project) so... here we go:

  1. Lets take a look at the existing work item types (MS agile template)


     
  2. Next we export process template used in the project (menu:Team| Team Foundation Server Settings| Process Template Manager)


     
  3. Now we have the current definitions so we can pick the closest one and modify it to suit our new needs


     
  4. After its ready we can use a nice command line utility named witimport.exe that is located on the client computer in c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ (use the /v switch to verify first)


     
  5. And ta-ta-ra-ta the fruit of our work is available for use


     


Method can not be reflected && 'date' is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types.

clock September 4, 2009 23:21 by author Rok Bermež

Annoying bug described in https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254967 can be easily fixed by removing DataType="date" from SoapElementAttribute attribute.

When you see:

[System.Xml.Serialization.SoapElementAttribute(DataType="date", IsNullable=true)]  
public System.Nullable<System.DateTime> BlaBLa

just replace with:

[System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]  
public System.Nullable<System.DateTime> BlaBla



A really simple Silverlight 2 PostIt application

clock June 16, 2009 22:45 by author Klemen Slavič

During the Silverlight 2.0 introductory course I held last week, we've chosen to implement a simple collaborative app as a summary of the entire curriculum.

The application contains an interface to display and manage PostIts on a collaborative message board. It is currently capable of consuming an input XML which displays PostIts and already has two-way binding implemented for the purposes of communicating with a Web Service to enable collaboration. The solution does not contain a Web Service provider nor does it currently try to send updates to the Web Service, but that will be upgraded in due time. ;)

This is the draft version of the application, which we've built during the course as an interactive demonstration. Comments are practically nonexistent, but will be added in future iterations, along with upgrades. It's a nice refresher/starter for anyone giving Silverlight 2 a go. Just unzip in a convenient location and open the solution file in Visual Studio 2008.

Note: You should have the Silverlight Tools 2.0 for Visual Studio 2008 installed prior to opening this solution. Read the Get Started Building Silverlight 2 Applications from Silverlight.net to prepare your Visual Studio 2008 to support Silverlight 2.

MyPostItApp.zip (1.40 mb)



Paste XML as XElement

clock May 22, 2009 20:17 by author Rok Bermež

Generating XML in c# can be a time consuming task. 'Paste XML as XElement' Visual Studio extension can save you a lot of time. You can find this extension in Visual Studios samples directory:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Samples\1033\CSharpSamples.zip

Extract PasteXmlAsLinq project and compile it.

Add PasteXmlAsLinq.AddIn and PasteXmlAsLinq.dll to one of the Visual Studios AddIn folder (you can see or add them in Tools|Options|Environment|AddIns)

Restart the Visual Studio

Now you have extra menu item


and you can directly paste XML like

<?xml version="1.0" encoding="utf-8" ?>
<rootElement>
  <element id="1">
    <podatek>aaa</podatek>
  </element>
  <element id="2">
    <podatek>bbb</podatek>
  </element>
</rootElement>

to

XElement xml = new XElement("rootElement",
    new XElement("element",
    new XAttribute("id", "1"),
    new XElement("podatek", "aaa")
    ),
    new XElement("element",
    new XAttribute("id", "2"),
    new XElement("podatek", "bbb")
    )
);



ASP.NET Profile in Visual Studio 2008 Web Application Project

clock May 19, 2009 00:35 by author Rok Bermež

I like and use Web Application Project way more than 'Web site' type project. The only problem with it is, that  ASP.NET Profiles are not supported out of the box. Workaround for this is ASP.NET WebProfile Generator, which you can find and download here on codeplex.



How to convince VSTS Team Build to create a setup project.

clock May 13, 2009 22:08 by author Rok Bermež

Recently I had to configure companies Team Foundation Server to produce installers for the applications we are working on. Task seemed pretty straightforward at first, but then I realized that build definition for VSTS Team build won’t build a solutions setup project. Sometime later, however it was still possible to convince him to do so. Here is a quick walkthrough:

  1. 1. In solution properties enable build checkbox for the Release configuration for the setup

  2. 2. Create a build definition as you normally would.
  3. 3. Open the build definition project file (TFSBuild.proj) from source control and put following directive just before the end tag:
    <Target Name="AfterCompile">
    <Exec Command="&quot;$(ProgramFiles)\Microsoft Visual Studio 9.0\
    Common7\IDE\devenv&quot;
    &quot;$(SolutionRoot)\Setup\Main\Corres\CorresSetup\CorresSetup.vdproj
    &quot; /Build
    &quot;RELEASE|Any CPU&quot;"
    /> <Copy SourceFiles="$(SolutionRoot)\Setup\Main\Corres\CorresSetup\
    Release\CorresSetup.msi ;
    $(SolutionRoot)\Setup\Main\Corres\CorresSetup\Release\setup.exe"

    DestinationFolder="$(OutDir)" /> </Target>
  4. 4. Check in the changes

 



About the author

Rok Bermež is Slovenian Windows Azure MVP, he works as a Software Engineer and Microsoft Certified Trainer at Kompas Xnet. His primary interests include cloud computing and web development. With extensive experience in development and architecture he participated in many projects and since the CTP release of Windows Azure much of those projects are based on Windows Azure platform. Rok has been delivering courses, writing code and speaking at conferences and community events on Microsoft technologies for the last couple of years. You can also find him on Twitter (@Rok_B).

Month List

Sign In