Disclaimer: I didn't write/create these exclusions...I copied them off Stackoverflow.com Sadly, I didn't bookmark the link and upon quick search, there were too many svn links for me to filter through.
UPDATE: Jim motivated me to actually spend the extra time to track down the actual links I used. Link1 and Link2
I use AhnkSVN as my visual studio source control plugin. I right click on the solution, select 'subversion', select 'solution properties'. That brings up a box and you will want to click 'add'. From there, select svn.Ignore and copy/paste the below:
Solution Level:
*.csproj.user Bin obj Obj Release debug Debug release
Note: I don't use Reshaper, if you do, there are other exclusions you will want to add
In Tortoisesvn, my exclusion list is :
*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo *.rej *~ #*# .#* .*.swp .DS_Store *.csproj.user Bin obj Obj Release debug Debug release *.suo
When you go into your TortoiseSVN settings, on the 'general' tab, copy/paste that into the 'Global Ignore Pattern:' box.
Amazon has just done something amazing... Amazingness... They are essentially doing a conditional year free of their services. While I am a huge fan of VMWare, what Amazon is offering is something completely unmatched by VCloud or MS Azure. (Please see Craig's comment as this claim has the possibility of being debunked. Thanks Craig!)
So what can I do with this you might ask? Here are some ideas: (I am doing these off the top of my head so feel free to criticize them by suggesting a better ideas)
1. If you have never played with Linux/Ruby or anything else, here is a good/free way to to dabble without the 'will this mess up my system' fear. Microsoft is continuing their adoption of features from these platforms and it can only benefit you to see these ideas they are using from Ruby(gems) or Apache(modularization). The more you know, the more you grow.
2. NOSQL? What is a NOSQL? Want a simple way to learn about NOSQL? Then try out Amazon's simpleDB. They have various demos and such you can run and play with and start trying to see what all the hype is about. Remember fellow fearful DBA's, NOSQL stands for "Not Only SQL" not for No - SQL as in SQL Void.
3. Embrace the awesome of Amazon S3. Ever wonder why Dropbox/JungleDisk and various other companies can give you so much storage for so cheap? Amazon S3 is pretty much the answer to that question. I typically use the cheapest hosting plans possible and S3 as a CDN to smoke/mirror performance.
4. SQL Server testing - Microsoft provides trial software for pretty much all their projects. If you are curious about ... say playing with some feature of replication or maybe wondering about online indexing ... Fire up 1 or more instances of EC2 and actually try it. You no longer have an excuse to put it off.
5. .Net testing or running a service - With shared hosting, I don't have a way of keeping an ongoing on demand service per say... So why not have a micro instance where you can deploy services and such. For example, say you need to add SMS services to your app.... Sign up for Twilio, create a little service, throw it on your free AWS EC2 instance and poll every hour or so. Most shared hosting sites don't really support SQL Server SSIS... so why not have an AWS EC2 instance that fires up at night and starts some SSIS packages?
Now, some of this isn't without a learning curve, but we are in the software development industry... if we can't navigate learning curves or don't even pursue learning to begin with we add more nails to our career coffin as well as start becoming the problem.
I have a great hosting provider - Arvixe and they are on the ball for both my Linux hosting as well as my .NET stuff. So as I started cranking out apps and went to deploy I knew I could count on them to handle the hosting task at hand. So, compile... deploy... and we're erroring out. Oh! I forgot to set my site to integrated pipeline.... fix that, drop some control+f5 and still an issue. So, CustomErrors=OFF, deploy and see that it is an error with the System.Web.MVC assembly. That's odd, well a google searching showed that this is a bit of known error. To fix, you simply click on the properties of that assembly, and set the "copy local" property to true. More information can be found here:
This dudes blog
and from Haacked himself: clickey
MVC ActionLink returns ?Length= - This was a real WTF for me. Turns out that if you specify a htmlattributes overload for ActionLink and don't put in something like null for the route values overload, it will append some stupid length=# string to your href.
<%: Html.ActionLink("Home", "Index", "Home", new { @class = "active" })%>
Generates the following html:
<a class="active" href="/?Length=4">Home</a>
So we throw in null for the routeValues overload:
<%: Html.ActionLink("Home", "Index", "Home", null ,new { @class = "active" })%>
and we get the html we want.
I have tried ASP.NET MVC a couple times and after a couple hours seem to always roll back to webforms because it is "easier" or a time constraint or any number of excuses. However, last night I decided to change all that and really give MVC a fair chance. The more I tinker around in Ruby and iphone development the more I buy into the validity of the MVC approach. Here is a bit of the technology roadmap I want to drive down:
T4 - I hear about it, time to see what the fuss is about. Besides, David Ebbo is the man.
Elmah will be a proof of concept before I roll into Exceptioneer.
S3 - I have already started playing around with this and love it. It will likely be serving the images and public files.
Routing - a vanity name like implementation for users will be my head first dive into routing.
Model - As a DBA, the data layer and ADO are my bread and butter. But it is time to step forward and see what the fuss is about. I will likely be trying out EF and Subsonic.
Charting - I'm a stat nerd, so I will be capturing stats, I hope to be able to throw some of them into the charting control.
NoSQL - I'm not sure how to work it in yet, but at some point, I am planning on having a SimpleDB/RavenDB/MongoDB section just to explore and have knowledge outside of a half dozen tech articles.
Lastly, it is time to branch away from Web services and start playing around with WCF. This will really come into play for the iphone app being done in MonoTouch which really is an exciting piece of work.
Once we are done with ASP.NET MVC, I plan to move to Ruby 3 and try and to build the same apps in that. Should be a great compare and contrast.
So that is it for now, time to see if I can stick to it and see this through... or give up and step back into web forms.
I suppose the subject pulls no punches with what we're going to do. We are going to have simple form with a file upload and a button. Once we hit the button, whatever file was selected is going to ride the magic internet carpet and appear in an Amazon S3 bucket.
WebForm:
<asp:FileUpload ID="FileUpload1" runat="server" /><asp:Button ID="Button1" runat="server" Text="Send it dude" onclick="Button1_Click" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
Code behind:
protected void Button1_Click(object sender, EventArgs e)
{
string result = Program.GetServiceOutput();
Label1.Text = result;
}
Class file for AWSCalls;
using Amazon; // these are part of the AWSSDK.dll that you add to the project
using Amazon.S3;
using Amazon.S3.Model;
....
public static void SendFileToS3(string filename, Stream ImgStream)
{
string accessKey = "Access Key here!";
string secretAccessKey = "Secret Key goes here!";
string bucketName = "Bucket Name goes Here!";
string keyName = filename;
AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKey, secretAccessKey);
PutObjectRequest request = new PutObjectRequest();
request.WithInputStream(ImgStream);
request.WithBucketName(bucketName);
request.WithKey(keyName);
request.StorageClass = S3StorageClass.ReducedRedundancy; //set storage to reduced redundancy
client.PutObject(request);
}
So there you have it! We take a file, throw it into a page.... and that page does a heave-ho to Amazon S3. It also goes the extra step to set it to ReducedRedundancy to save you a pretty penny.
With 'high availability' being a nicely stressed buzzword coupled with issues in the 'cloud', an issue can arise of what to do about your jquery references in the event that where you are hosting it is down? I won't dig into the reasons for using a CDN for jquery but will plug the usual - It will typically be cached by the time your site is hit if you use Google or Microsoft CDN as well as will likely be faster to load in general as a browser will thread out to load it (as opposed to if it is hosted under the current domain). I also have some links at the bottom for further reading on it. So, on to the failover.... and it is quite easy really since 1.4 :
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.js"></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined')
{
document.write(unescape("%3Cscript src='http://ajax.microsoft.com/ajax/jquery/jquery-1.4.4.min.js' type='text/javascript'%3E%3C/script%3E"));
document.write(unescape("%3Cscript src='http://ajax.microsoft.com/ajax/jquery/jqueryui-1.8.4.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>
http://happyworm.com/blog/2010/01/28/a-simple-and-robust-cdn-failover-for-jquery-14-in-one-line/
http://weblogs.asp.net/jgalloway/archive/2010/01/21/using-cdn-hosted-jquery-with-a-local-fall-back-copy.aspx
http://stackoverflow.com/questions/1447184/microsoft-cdn-for-jquery-or-google-cdn
Trust me when I say I'm no stranger to abusing repeat methods in code behinds... however, it does reach a point where something has to give. When you reach that point, your solution is a 'helper' class.
Below is a quick/basic example of how to get started with helper classes.
In my solution, I created a folder called 'Helpers' and added a new class object called 'StringManip'.
Once that was completed, I added a few methods like:
public static string UpperString(string val)
{ return val.ToUpper(); }
In my code behind, I reference the class through a using statement:
using HelperClass.Helpers;
And then I can call the methods:
lbl_aspnet.Text = StringManip.UpperString(lbl_aspnet.Text);
If the above isn't enough to get you rolling.... then download the demo solution by Clicking Here
It seems like every place I go, companies are dropping an incredible amount money on an overpriced Verisign certificate which essentially proves nothing. I am not going to tirade on Verisign's prices, product, or just the general crappy nature of the company... but I will list alternatives:
The current ones I use and it rocks:
For http SSL I use: Start Com
For other services/protocols I tend to use:
CA Cert Org
I don't think cacert is any better/worse than startcom, I just mostly use cacert for internal stuff out of habit and I generally like the group.
Equally excellent CA's that are not free:
Dynadot.com
Rapidssl.com
Geotrust.com
Recently, I got rid of the business line to my house. The downside to this is losing ports 25 and 80. Port 80 isn't a real deal breaker as when I'm coding/debugging I'm just using a local webserver. However, when I am testing email functionality in an application things get a little more interesting. The fix I found for this involves how you specify the SMTP actions in the webconfig.
In your <Configuration> section, you can specify either network delivery or a pickup location:
<system.net> <mailSettings> <!--<smtp deliveryMethod="SpecifiedPickupDirectory"><specifiedPickupDirectory pickupDirectoryLocation="C:\Subversion\Email" /></smtp>--> <smtp deliveryMethod="Network"><network host="datachomp.com" port="25" defaultCredentials="true" userName="Gator@example.com" password="email" /></smtp> </mailSettings></system.net>
At this point you just check the local directory for email when you are testing your application. If you don't have system for production deployments, then don't forget to change to the network delivery when you deploy.
Comments of late