Showing posts with the label Asp.Net

Working Dotnet 2.0 with Ubuntu 16.04

  One of the bugs I ran into on my journey was not using the published version of my aspnet application but moving from 1.x to 2.0 of dotnet. I was already setup to use https but I don't think my nginx configs were the issue but instead the app not building a published build of the app. just use the publish command and everything worked as planned. - - aspnet core inside a linux system Conclusion I'm very happy with my solution, I haven't found a lot of issue except the some of the issue that were related to version differences with 1.x/2.0. I believe I've found a way to simplify the tutorial provided in the Microsoft by using docker. Running docker no whatever port you need and then from there write the configs to nginx.

Research on Certbot for IIS

   If you don't know the days of paying for security is over! Certbot solves the age old program for being SSL compatible for all your sites. Since I've move out of the cloud, things haven't gotten easier but for securing my websites its a snap so I couldn't recommend certbot enough. However for my personal work with employers IIS is a must and that's where things get tricky.  Since I don't have the time I wanted to bring anyone wondering about this topic up to speed. Here's the forms and ticket issues related that I'm aware of, and hopefully get finish. - - -

Aspnet MVC Cheatsheet

Probably the best place to start with this cheatsheet is with this blog itself. I have tons of articles under my tags "aspnet" and "aspnet-mvc" on this blog. Since aspnet is where I started in my career its probably the most important cheatsheet I should have ready. This article will always be on going... Assigning and Setting Bound models some of my notes here include javascript because so much of my code is, but you need to be aware how it ties in with the backend. Accessing Your Model's Data from a Controller Microsoft Workers Worry Most About Re-Org - Dice News Use View Models instead of FormCollection - Jaco Pretorius Assign Model property value from JavaScript value MVC 3 form post and persisting model data Setting property on the model object? (javascript) Controller without a form? Sending JSON to an ASP.NET MVC Action Method Argument JSON.stringify not converting array.object correctly (javascript) associative array to JSON (javascri

Gcloud Vs. Azure Comparison With Aspnet Core

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

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 browsers Filter based on webkit Chrome conditional comments Is there any equivalent to IE conditional comment for chrome and safari? IE10 CSS Hacks load webfonts through the offline storage cache manifest After 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

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

Avoid Mixing Server Side and Client Side Code

Some Background      This article is from a time when I used primarily 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 w

Aspnet: legacyHMACWarning

    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  HMAC 1 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." T he 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 + MVC Routes with Partial Views

     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 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/' +; }, 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 wil

Just a Thought with 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 pr

CMS Integration with Existing Sites in IIS

    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. Example of URL