Publishing Just Your JavaScript Folder With Visual Studio

image.png

Who would have guessed.  With Visual Studio you can right click on any folder in your web project and say publish.  You can see me doing that right here below. For years, I’ve struggled with how to just get certain files to an IIS web site.  The things that I have used (that all have issues) are: Robocopy (only works if you can have a vpn network drive) rsync (causes permissions problems and various other nasties) ftp (has trouble syncing and the root folder is never where you want it Now, I can skip all that assuming I’m using visual studio (which I usually am). I get the nice success window quickly as follows And that is all there is to it. … Continue Reading

In Microsoft’s Visual Studio Editor Search Without Hurting Paste Buffer

I know this seems kind of trivial but I just accidentally discovered a feature in Visual Studio that probably all in all has cost me many many lost seconds of productivity.  I often find myself in visual studio with something in my paste buffer but want to search for something else in code. I know this sounds a little obtuse but if you know what I’m talking about and you don’t do it yourself, this will save you a bunch of time. I’m in  them middle of full speed prep for Silicon Valley Code Camp (which is what this program I am using for the example below is) as well as working on my next Sencha ExtJS 5 upgrade Plurasight video so I have my tools all cranked up. I thought I’d quickly share a video of what I’m talking about. Here you … Continue Reading

Tuples In C#, A Useful Example

Background Last year I worked consulted with a company that had an engineer that used tuples in C# and tried to explain to me how they were useful.  To be honest, I never quite saw the value proposition (until today).  I remember he kept saying they were kind of like key value pairs but could go beyond that.  I remember those words but never internalized that. The Example My example is a simple one.  I’m currently working on providing data to an external application that will provide business intelligence (help with session selection) to the Silicon Valley Code Camp web site.  The data I’m providing is every mark of interest and plan to attend for every session ever given at code camp (that’s 220,000 … Continue Reading

Safely Encoding Strings On ASP.NET MVC Razor Pages (sometimes)

  Background Sometimes, we want to let html tags come through our web pages from user defined content.  If for example, you have a workflow that requires approval before publishing, there are times when you want to let the author put through html, links, etc.  Solution In Visual Studio write a simple HtmlHelper method that allows for a flag you can pass through.  In my case, I have a database table with a boolean column “allowhtml”.  If this is set, then instead of using Html.Raw(…) I can use my own helper method, pass in the allowHtml value and if it is set true, then allow the not encoded Html to flow through. Here is that helper method: namespace WebAPI.Code.Helpers { public static class … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: