Posts

Showing posts with the label Asp.Net

Gcloud Vs. Azure Comparison With Aspnet Core

Image
Since I no longer use both cloud services I thought I would write down out my experiences. This is going to be really quick because its mostly just what I saw with my company site as far as costs and development on each platforms. This note isn't the be all comparison, just a few statements on what I saw and experiences so do your own research and experimenting on each platforms.
Tools (Visual Studio 2015) Without a doubt azure is the better choice but I was really surprised how much there was for glcoud. In fact there is even a plugin for to deploy your app. Gcloud even making docker support easy, the only differences  with visual studio was how you deployed to each platform. Which I like that they were not the same but it did take a long time when I deployed to gcloud. The time was about 10-15 mins sometimes and I'm sure the team is working on it but azure is the winner for this.
Logs - Glcoud Checking your logs in gcloud is surprisingly easier if you are not using app insigh…

User-Agent Styled Web Applications

This idea came from awhile back when I was working on my project rustkickers. The purpose of the site is to provide documentation on all things motor related. While working on a demo for the site used a old car manual to create some of the designs. That goes me thinking why not make multiple site designs around different car manufactures. Then even further down the rabbit I landed here, which is what this article. Another thought but a cool one I think and yes I know you can't trust the user-agent but it doesn't matter its just the style not the content. 

Intial Solution
Optimizing content for different browsersFilter based on webkitChrome conditional commentsIs there any equivalent to IE conditional comment for chrome and safari?IE10 CSS Hacksload webfonts through the offline storage cache manifestAfter playing around with this idea for awhile I figured handling this is the frontend at all was not worth it because of performance. Unless your looking at it with a single css a…

Separate or Combined Frontend & Middle Tier Solution

Agnostic code that you can pick and choice or reuse from the browser to the server is the ideal situation to be. I believe there is only two way to get there. By a nodejs server environment or a transpilers like typescript. JavaScript isn't going anywhere and probably will be transformed as a lower level language in future generations. Which a lot of JavaScript frameworks seem to completely do.

Background
    So now some bit of my background on what I've done in the past and how I got to this way of thinking. Initial I started out with aspnet nvm and keep running into the concern of mvvm which is constant problem if your models done match. In aspnet mvc front-end is usually included in with the middle-tier. I have nested nodejs inside aspnet application and this was before aspnet core so it seemed like the right move. After my third job I wanted to completely move toward nodejs to solve this mvvm problem. However security and usability were major concerns my employer had so…

Avoid Mixing Server Side and Client Side Code

Some Background      This article is from a time when I used primarily Asp.net 4 with razor syntax which was a love and hate relationship. I started out as a front-end developer but was limited by my peers on the technologies I could use as well as my skills. Even though I was peer reviewed much of my code was "acceptable" I however felt it lacked something.
Currently      I avoid mixing MT (middle-tier) and FE (front-end) code; it goes in hand with my philosophy on how to design web applications. I strongly recommend going the extra mile. Ask yourself how will others use the code; not how will they reuse it, that's another concern. Also how will you debug it if something goes wrong? There are many reasons why I avoid doing this. Mainly cause I like to take the approach of SOC (separation of concerns).After years of frustration trying to debug finally I made this rule for myself. Not only with my code but in my process of thought during developing. Which was be a big task a…

Aspnet: legacyHMACWarning

Image
Stumbled across this bad boy in the webconfig in an old project and was curious what it's purpose was. Since the comments didn't really help and I spent some time on to uncover its secrets.
"This prevents the Windows Event Log from logging the HMAC1 that is being used (when 
the other party needs it).When targeting ASP.NET MVC 3, this assemblyBinding makes MVC 1 and 2 references relink to MVC 3 so libraries such as DotNetOpenAuth that compile against MVC1." The comments don't really help, in fact only rises more quesitions. Why is the DontNetOpenAuth ever compiling against MVC1?


DotNetOpenAuth with MVC 4.0 - "Yes, DNOA is built against MVC 1.0, and this is by design so that it works against all versions of MVC (given the appropriate redirects). This is purely an MVC version thing -- not a .NET 4.0 thing"

Resources
HMACSHA512 Class (System.Security.Cryptography)

Angularjs + Asp.net MVC Routes with Partial Views

Image
Recently I've had the great opportunity to create something pretty awesome and I think it helped me seperate or clear up any confusion I had on project where I used two MVC frameworks on top of each other. Those two frameworks are usually AngularJs and Asp.net MVC. It can be a little hairy especially if you're new to Angularjs but when you use them right web developing is be a snap.

Client Side
$routeProvider.when('/', { templateUrl: 'home/_home', controller: 'AppCtrl' }).when('/product/:id', { templateUrl: function(params) { return 'home/_product/' + params.id; }, controller: 'AppCtrl' }).otherwise({ redirectTo: '/' });
  What's really important here is the route for product and the parameter (look where it takes id). The id can hookup to any middle tier and from there it can handed to a model bound partial view. You can even mix in angular html attributes since the page will be pu…

Just a Thought with Asp.net MVC and Portability

Since the release of Vnext this idea has become less of a concern for me but a majority of my "professional" projects have been in MVC and with Vnext offering larger amount of support this article doesn't really reflect any of my current solutions. Instead it is just a thought on allowing me to continue with the frameworks that I currently use in my career with frameworks that are available to me in my personal projects.       It is very important to me, to create fast, low cost, and high processing application. As I like build with large number of tools in order to increase my productivity since I have less time at home. Working in familiar frameworks between work and home isn't a must but just something I think that works in my favor. If all else fails, I can just pick things up. I go along. Plus there's always the bonus of my javascript skills.      My original thoughts for this approach show below was to move all my controllers into an angular project a…

CMS Integration with Existing Sites in IIS

Image
For this setup you will need IIS 8.0 or higher because of the URL rewrites module. In my process of figuring this out I ran into some pretty funny infinite loops so watch out those if you're site is taking a long time to load. Most of this process is just using the URL rewrites, and what we are trying to do is make our application the homepage and have the CMS rest in the back making all links needed point to it. We could easily reverse this setup and make the CMS the homepage, or we could pull data from the CMS into our web application. Making some kind of widget built based on the CMS, which is easy to do if your CMS has an API  service already built out.    In this example I make the CMS seat behind my web application and routed the CMS's to a subdomain. There is also a legacy site which will seat next to the CMS on its own sub subdomain. If the url's within each application are relative then there is no need to modify them for this setup.

To better explain this se…