Posts tagged Visual Studio
5 Steps to Deploy on WP7 device
Nov 27th
So I wanted to develop for the Windows Phone 7 device. I started humble, reading and understanding any source of information. I've studied a lot of MIX conferences, blogs, webcasts and attended Microsoft workshops. After some time I got the opportunity of having a device. Naturally, I wanted to deploy my applications on the device, having a proof that they work as they were supposed to. But this wasn’t so easy!
This is my experience about registering on the Marketplace.
1. Register: Given the fact that Microsoft offers free access for students to the Marketplace, I registered myself as developer with my LiveId. But this is not enough to publish applications. You must first get authenticated that you are who you claim to be. This is not done by Microsoft, but by a 3rd party company which specializes in authentication – GeoTrust. And if this sounds familiar to you, might be because they also sell SSL certificates. More >
C# .Net using Post with HTTPWebRequest
Aug 8th
Just a reminder for posterity : posting with .Net its so easy! Check out the Cocoa touch framework to realize the difference!
public string Post(string url, string data) {
string strReturn = null;
try
{
//Encoding the post vars
byte[] buffer = Encoding.ASCII.GetBytes(data);
//Initialisation with provided url
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(url);
//Set method to post, otherwise postvars will not be used
WebReq.Method = "POST";
WebReq.ContentType = "application/x-www-form-urlencoded";
WebReq.ContentLength = buffer.Length;
Stream PostData = WebReq.GetRequestStream();
PostData.Write(buffer, 0, buffer.Length);
//Closing is always important
PostData.Close();
//Get the response handle, we have no true response yet
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
//information about the response
HTTPStatusCode status = WebResp.StatusCode;
string server = WebResp.Server;
//read the response
Stream WebResponse = WebResp.GetResponseStream();
StreamReader _response = new StreamReader(WebResponse);
strReturn = _response.ReadToEnd();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return strReturn.Trim();
}
Enjoy!
MIX09 Scott Hanselman’s FILE|New Project …
Mar 22nd
Scott Hanselman had a presentation at Mix 09 conference – File | New Company: Creating NerdDinner.com with Microsoft ASP.NET MVC. This was in its unique style – fun, rich in content, tricks, advices but most of all was fun.
This year he managed to create a new type of presentation – without the actual presentation! No more constrained to some slides, just him, Visual Studio and the audience. Yes, the audience – who seemed to absorb any words spoken there, helping Scott with few advices in some key points.
Create GUID in Visual Studio 2005
Dec 21st
From time to time you need to create a GUID (Global Unique IDentifier) in order to mark your dlls. Looking in my Visual Studio 2005 I saw that this command wasn’t available in any tools menu, nor in the Customize toolbars one as a shortcut to a command.
After a quick digging on MSDN site I found this. It is written in Microsoft style – a lot of information, but no solution. It just mentioned something like ”hey, we have something that you want, but guess what – we don’t have it any more”:
-
On the Tools menu, click Create GUID. The Create GUID tool appears with a GUID in the Result box.
So I started creating my own Create GUID command.
Happily, the Microsoft team provided the tool in the <visual studio install>\Common7\Tools\ directory. Usually, the <visual studio install> dir is C:\Program Files\Microsoft Visual Studio 8.
Actually, there are 2 tools for creation of GUIDs:
- GUI interface: <visual studio install>\Common7\Tools\guidgen.exe
- Console line tool: <visual studio install>\Common7\Tools\uuidgen.exe
At first look, uuidgen seemed the winner. Running uuidgen in command line revealed the needed parameters:
I proceeded to setup the Create GUID command. From Visual Studio 2005 menu > Tools > External tools you can add and setup a new command to an external tool. The setup window is straight forward for experts, but new guys can be impressed by it.
Clicking on Add button will create a new element in the list, called [New tool 1]. This name will be overridden by whatever you write in the Title text box. Next, the command text box will be filled with exact path to the tool. Clicking the ellipsis button, you’ll be sent straight to Tools dir, where you can easily find the tool required. As arguments I put the ‘c’ value which means that the output will be upper case UUID (as you can see in the previous image).
And when clicking OK, the corresponding name, as in my case Create GUID appears in the Tools menu, just above the External Tools menu.
But surprise, when I clicked the menu button, the command prompt flashed and nothing happened.
After a brief investigation, I figured out that the tool worked, but it’s output was retained in the command prompt window. This closes immediately after the tool runes successfully, outputting the GUID.
What to do ? I switched to the next tool, Guidgen. This was simply accomplished by changing the command to the corresponding tool name and removing the argument.
So after clicking on Visual Studio 2005 menu > Tools > Create GUID I got this window, in which I checked, as you can see, Registry format and then click on Copy button. Then clicking on Exit you dismiss the tool. By pasting the Clipboard content into a class, you will get this :
{949213E9-0658-4546-B3D1-F41C0475E805}
Good luck with the implementation!
PDC 2008 – Developing Applications Using Data Services
Dec 1st
This presentation, is done by Mike Flasko, Program Manager at Microsoft Corporation. Smart, well prepared and having good oratorical skills, he is one of the best presenters that I have listen to. He has several other blogs, interesting to see is also this one. He leads the Astoria team which has an interesting blog here.
For all of us who didn’t had the pleasure to go to the actual event, the link is on Channel 9 PDC area. Maybe next year we’ll shake hands with Mr. Mike Flasko.
Here are some of the things presented (this listing is just a teaser, you should discover the rest) :
- New models for communication