Assigning Port Numbers for the Dev Server

by ashic 23. October 2008 19:25

A lot of times, specially when using web services, we want the dev server to use a specific port. Suppose you have a web service and a website which consumes it. You put them in two separate projects. You’d want the web service to always use the same port. One option is to set it up in IIS. But what if you don’t want to use IIS? What if your putting together a simple test and wish to use the dev server? How do we do that?

Well, the process varies between websites and web application projects.

Web Application Projects

Just right click the project in solution explorer and select properties. In the web tab, you’ll get the option to set the port.

WebAppPort

Websites

The procedure is slightly more complex for websites. First, in solution explorer, click the project. Hit F4. This brings up the properties pane. Note, this is NOT the property pages found by right-click>>Property Pages.

WebsitePort_1

Set the “Use dynamic ports” option to False. At this point, you can’t assign the Port number. Run the web server once, by making any request to the project (a simple ctrl+F5 should work). Doing this will allow you to change the Port number.

WebsitePort_2

Note that Port number is no longer grayed out. You can now assign the port number to be used. As an alternative to making one request, you can also set the “Use dynamic ports” to false, close the solution and open it up again.

Share or Bookmark this post…
  • Facebook
  • DotNetKicks
  • Digg
  • LinkedIn
  • Technorati
  • del.icio.us
  • Google
  • Live
  • Tumblr
  • msdn Social
  • Ping.fm
  • Reddit
  • Slashdot
  • StumbleUpon
  • TwitThis
Categories: ASP.NET

JQuery is now 1st Party for Asp.net - Kinda

by ashic 28. September 2008 18:11

Wow...AMAZING…Hurray…I mean, like, WOW man…

In a very welcome turn of events, JQuery is now “officially” going to be part of Asp.net development. MS will provide support, annotated VS versions that’ll give us intellisense, provide us with demonstrations and tutorials on how jquery can work with features like the AJAX Control Toolkit, Asp.Net AJAX, client side templates – and all the time without modifying, forking or otherwise changing jquery. This is surprising, and in a very pleasant way.

When I looked at the Asp.net AJAX Roadmap a while back, I thought that a lot of it was what jquery does (css selectors, anyone?). I actually liked the idea as I use JQuery a lot, and it appeared a lot of the neat features were headed our way. I was grateful cause I do believe community interest in jquery is what put those features in the roadmap. I thought that was the best we could expect…and I thought the only “better” move would be for MS to buy jquery.

Well, MS seems to have done even better with this move. Instead of killing it off, they’ve joined it and are going to make it an even better experience using jquery alongside asp.net. This works so well for the “Dark Empire” persona of MS and integrates so nicely into the ecosystem. Well done, bravo, outstanding…can’t say it enough time really.

Scott Hanselman has put up a tutorial already on how this’ll work with Astoria (ok…ADO.Net data services, but Astoria is such a cool name!) and client templates. I’ve been using asp.net AJAX and jquery together for some time now. And I can say it works exactly like I expected it to work. No need to re-learn MS-specific jquery, no hassle – it just works.

And lastly, MS will provide bug reports, patches, tests etc. to the jquery project and “These will all go through the standard jQuery patch review process.

  • “If you can’t beat ‘em…buy ‘em”.
  • “If you can’t beat ‘em…join ‘em.”
  • “If you can’t beat ‘em…support ‘em and make ‘em even better for your own benefit.”

I never imagined option 3 was even possible for MS. All I can say is I’m jumping for joy!!

Share or Bookmark this post…
  • Facebook
  • DotNetKicks
  • Digg
  • LinkedIn
  • Technorati
  • del.icio.us
  • Google
  • Live
  • Tumblr
  • msdn Social
  • Ping.fm
  • Reddit
  • Slashdot
  • StumbleUpon
  • TwitThis
Categories: AJAX | ASP.NET

FTP Woes and....FireFTP to the Rescue!!

by ashic 5. September 2008 05:50

I'm running Vista x64 sp1. I've had IE 7 and then IE 8 (b2) installed. I tried uploading via ftp from a)Windows Explorer, b)Visual Studio ftp, c)FireZilla, d)SmartFTP. Small files uploaded perfectly but even 150KB files kept timing out and retrying. Active/passive didn't help. Nothing helped. I tried for 28 hours to upload a 340KB file. It was infuriating. I tried from another ISP's connection. I tried from XP. Nothing worked. God knows why. I contacted tech support, they said it was a problem on my ISP and that my connection was poor. While I agree a 100kbps upload isn't good at all, I do expect to upload 100KB in a few minutes and not failing for hours. I can't be too sure about their response as people using my ISP DO upload via ftp. I sent my files to a friend in the US and he graciously uploaded for me. He mentioned it was slow. And then I needed changes on my site. Enter frustration.

 Well...just now I found a brilliant solution that's just plain mind boggling. I learned of FireFTP, an ftp plugin for FireFox. Now, (this may surprise a lot of folks), I don't like FireFox much. On my dev machine, it's painfully slow loading pages from the VS dev server compared to IE7 / IE8 / Chrome. But this is one thing I'll always be using for ftp from now on. You see, FireFTP is slick, fast and it uploaded my 350KB file in 25 seconds flat(!) - something the bigger players failed to do.

 I'm guessing this is coz of some OS configuration or firewall or whatever. I tried turing off vista auto tuning. Nothing helped. I faced the same problem from XP though. I wonder if it's my good buddy Kaspersky that's causing me the pain. I did try turning off the firewall, but that didn't help either.

Anyhow, I'm glad I found fireftp. I noticed some people on the forums were complaining about slow ftp too. I hope fireftp can help them too.

 

 

EDIT: As Josh points out...I really should have posted this link here:

http://fireftp.mozdev.org/

FireFTP: The BEST and SIMPLEST FTP software I've EVER used - and one that just "works".

There you go :D

Share or Bookmark this post…
  • Facebook
  • DotNetKicks
  • Digg
  • LinkedIn
  • Technorati
  • del.icio.us
  • Google
  • Live
  • Tumblr
  • msdn Social
  • Ping.fm
  • Reddit
  • Slashdot
  • StumbleUpon
  • TwitThis

HTML Comments, Other Comments and Some VS Tips

by ashic 1. September 2008 21:50

 

I just found out something really weird about HTML comments. Apparently, according to standards, you can't do this:

<!--  comment ------------------------ -->

That is, you can't put two or more ‘-‘s inside a comment. It works as expected in IE7, but it breaks down horribly in FireFox. FireFox simply renders the comment to the user, which is pretty useless as that's not what comment are for!!. The standards "recommend" developers to not put two or more consecutive ‘-‘s inside an html comment. Now, that's weird. If there are specific delimeters like <!-- and  -->, then I should be able to use any part of those delims (but not the whole) inside a comment, shouldn't I?

Since, we're in the vicinity of comments, let's look at some for reference:

HTML: <!-comment -->

C#: //single line comment

/* multiline comment */

VB.NET: ‘single line comment

SQL: /* multiline comment */

-- single line comment

Asp.Net markup (aspx): <%-- comment --%>

 

Now here's a neat trick regarding commenting and uncommenting code in Visual Studio and Visual Web Developer. In any code editor, highlighting a bit of code (be it VB.Net, C# or aspx markup), if you press ctrl+(k, c) [That is, press k and then c while holding down control), it'll automagically comment out that part using the comments that apply to the selected code (so, // in C# and ‘ in VB.Net etc). To uncomment, highlight and hit ctrl+(k,u). One thing to keep note is that the uncomment will work if you select any part of the beginning of a line for VB.Net and C#. For aspx markup though, you must select from <% to the closing %> for the ctrl+(k,u) uncommenting to work.

Also, asp.net <%-- --%> comments work server side. So, nothing in them are visible to the compiler. HTML comments work client side. So, if you put anything inside <!-- -->, it'll be visible to the compiler. Hence, if you're trying to comment out some part of markup that fails to compile, you must use the server side <%-- --%> comments.

 

One last trick for today is the auto formatting of code. In a code editor in Visual Studio or Visual Web Developer, you can select some code and hit ctrl+(k,f). This'll auto format that part of the code. This is immensely helpful for formatting aspx markup really quickly. Keep in ind though, that your code must be valid and error-free. If the ctrl+(k,f) trick doesn't work, it's a sign that there's a problem with code/markup.

Hope that helps.

Share or Bookmark this post…
  • Facebook
  • DotNetKicks
  • Digg
  • LinkedIn
  • Technorati
  • del.icio.us
  • Google
  • Live
  • Tumblr
  • msdn Social
  • Ping.fm
  • Reddit
  • Slashdot
  • StumbleUpon
  • TwitThis
Categories: ASP.NET

.Net 3.5 SP1...finally

by ashic 12. August 2008 04:47

Fate has a weird sense of humour. I held out from installing .net 3.5 sp1 all through the CTPs, then beta 1 and beta 2. This is also the first time I restrained myself from installing new stuff (coz simply put, having to uninstall a bunch of betas and patches and what not was getting to me). Well, I couldn't hold out any longer. I downloaded the entire thing. My internet is pretty crap, so I had to download the packages individually, then run a command line switch to download the final files. After that, was a quite long install. It failed. I removed silverlight tools. Tried again. Worked perfectly. I played around for a few hours. Made a few apps. Liked the new stuff quite a bit. And then, at 4 am, I went to bed.

I wake up, and what do I see? Damn you Microsoft...you just released the final .net 3.5 sp1 bits while I was asleep. Couldn't you have done it ONE day earlier or a month later? It HAD to be today, right? Why God, WHY?!?!?!

Ah well...guess I'll be downloading it all over again. And I gues I can forgive MS as the sp1 is actually available as an ISO. That is SO much more convenient to me. Thanks guys.

You can download .net 3.5 sp1 from bootstrapper here. You can download the FULL .net 3.5 sp1 from here. You can download the Visual Studio 2008 sp1 bootstrapper here. And you can download the FULL VS 2008 sp1 from here. Please note that the VS 2008 sp1s contain .net 3.5 sp1. Also note that the bootsrappers will require internet connectivity during installation, while the full versions will not.

Share or Bookmark this post…
  • Facebook
  • DotNetKicks
  • Digg
  • LinkedIn
  • Technorati
  • del.icio.us
  • Google
  • Live
  • Tumblr
  • msdn Social
  • Ping.fm
  • Reddit
  • Slashdot
  • StumbleUpon
  • TwitThis
Categories: .NET

Hey Kaspersky, Stop Slowing Down My VS

by ashic 13. July 2008 23:39

I'm finally starting off this blog about a month after Joe gave it to me...yay, awesome, yahoo (or should that be MS yahoo?).

One thing that has always frustrated me was that whenever I install Vista (or XP), everything is zippy and fast. Gradually, things become really sluggish. Then, it becomes so unbearable that I have to reinstall the darned thing. The thing that slowed down the most (or at least, is a frontline contender for slowing down) seemed to be VS - the one thing I needed the most (well, maybe after IE). This really was getting on my nerves, and I blamed it on my hardware. So imagine my surprise when, after a recent upgrade, it seemed even zippier than before, but the sluggishness "somehow" returned. Now don't get me wrong - when I say "upgrade", I mean a total renovation - a quad core Q6600, 4GB of DDR2-800MHz (5-5-5 timings to boot), 2 10Krpm Western Digital Raptors in RAID 0, HD 3870 and a Thermaltake PSU that broke my back as well as my bank - some of the best things I could buy back in last September (the HD3870 was bought later). And then I found the culprit.

I've always loved Kaspersky, awesome little thing. But, like any other antivirus, it likes to check every opened file and make sure it's safe. This is all fine and good, but I don't think there's anything lurking inside my .cs files just waiting to pounce on my system. So, I go ahead and add VS to my trusted stuff, give it full permissions, and tell Kaspersky to not even monitor files opened by VS or any of VS's activity. And guess what, it's been months now, and VS is still as zippy as when I first installed Vista. I went ahead and put some other obviously-not-virus-carrier programs into my safe zone, and they work like a dream, too.

I always thought that turning the antivirus off for VS wouldn't give me "that" much of a boost since I had some kick-ass hardware. Boy was I pleased to be proven wrong. I installed Vista x64 in February, and not a single frustrating moment since then.

I use Kaspersky, but the principal should hold for all other virus guards if they have a trusted apps feature or something.

Hope that helps.

Share or Bookmark this post…
  • Facebook
  • DotNetKicks
  • Digg
  • LinkedIn
  • Technorati
  • del.icio.us
  • Google
  • Live
  • Tumblr
  • msdn Social
  • Ping.fm
  • Reddit
  • Slashdot
  • StumbleUpon
  • TwitThis

Powered by BlogEngine.NET 1.6.1.0
Theme by Ashic Mahtab

Need an expert?

Ashic Mahtab
ashic@live.com
(+44) 07879927393

Stats

Featured Ads

 

Donations

I maintain this site and create all content entirely in my own time just to help you guys out. If you find the stuff helpful, or cool or just like what you see, I'd appreciate you chipping in to help out with the hosting costs. It's easy to do so - just click the button below - no amount is too low :)