Introduction to Visual Studio App Center

Hello Everyone, in this article, we are covering Visual Studio App Center services with complete guidelines of installation for Xamain iOS.

What is Visual Studio App Center?

Visual Studio App Center is the one-stop solution for all the different services like HockeyApp, Xamarin Test Cloud, Xamarin Insight, Azure Mobile Engagement, Azure App Service, Code Push etc, all of them seamlessly integrated to make the development and shipping of application much easier.

Platform Support:

  1. Android
  2. iOS
  3. UWP
  4. macOS (preview)

Framework Support:

  1.  JAVA
  2.  Objective C/ Swift
  3.  Xamarin
  4. React Native

Visual Studio App Center

Continue reading “Introduction to Visual Studio App Center”

Firebase Complete Guide for Xamarin

Firebase

Firebase is part of a growing trend known as “Back end as a service”. Traditionally configuration of a server would require you to fetch data via some API you have written in order to retrieve data from your server.  When using SQL, you would have to write code that stores objects and properties that can be accessed in your code.

A cloud-hosted NoSQL database. Data is stored as JSON, synced across connected devices in milliseconds, and available when your app goes offline. Intuitive and easy-to-use API. Remains responsive regardless of network latency or Internet connectivity so apps works offline.

What is amazing about Firebase, is that essentially with one line of code, you are ready to begin writing to your database instantly. This gets stored as JSON (JavaScript Object Notation) and can be read and used in your application nearly as easily.

Firebase expedites the storing and retrieving of data via a third party service and comes with its own API so you don’t have to write one.

firebase

Continue reading “Firebase Complete Guide for Xamarin”

Enabling SSL with IIS Express in Visual Studio Express

Enabling SSL with IIS Express in Visual Studio 2015

  • Select the startup project and press F4 (the function key) this will open the property window.
  • To enable the SSL with in IIS Express, you have to just set “SSL Enabled = true” in the project properties.
  • Once you change the value, Visual Studio set in automatic the SSL URL, e.g., https://localhost:44301/.
  • Copy SSL URL. Go to the Advance properties by pressing Alt+Enter, select the Web tab and set the Project URL with the same value of SSL URL, e.g., https://localhost:44301/.
  • Now you have configured the default URL of the web application, we can run the site (F5 or CTRL + F5).PS: The first time you set the secure protocol on IIS Express, you will be prompted to install the certificate for SSL.

    Enabling SSL
    Note:  

    If you are getting “IIS Error: cannot add duplicate collection entry of type ‘mimeMap’ with unique key attribute ‘fileExtension

    Please refer this .

Hope this will help !!

Store data in WCF Operation Context.Is ThreadStatic safe?

ASP Net MVC

WCF infrastructure allows you to store context sensitive data in InstanceContext of the service instance similarly like we do in HttpContext of MVC. For that you should implement from IExtension and plug that class into WCF’s infrastructure.

public class WcfOperationContext : IExtension<OperationContext>
{
    private readonly IDictionary<string, object> items;

    private WcfOperationContext()
    {
        items = new Dictionary<string, object>();
    }

    public IDictionary<string, object> Items
    {
        get { return items; }
    }

    public static WcfOperationContext Current
    {
        get
        {
            WcfOperationContext context = OperationContext.Current.Extensions.Find<WcfOperationContext>();
            if (context == null)
            {
                context = new WcfOperationContext();
                OperationContext.Current.Extensions.Add(context);
            }
            return context;
        }
    }

    public void Attach(OperationContext owner) { }
    public void Detach(OperationContext owner) { }
}

Which you could use like that:
WcfOperationContext.Current.Items["data"] = "My Data";
string user = WcfOperationContext.Current.Items["data"] as string;

 Continue reading "Store data in WCF Operation Context.Is ThreadStatic safe?" 

Basic Fundamentals of AngularJS

In this article we will understand the basic fundamentals of AngularJS.

What is AngularJS?

  • Angular is JavaScript library.
  • It is a MV* framework, where MV * means:

M- Model : where you store data and state of application.

V- View   :  which actually renders to user the information they want to see.

* : Controller /Presenter/View-model

Features of AngularJS 

  • It is an open source library.
  • It is comprehensive which means it handles AJAX communication with your server so that you can send and receive data from back-end.This data is stored as plain JavaScript object.
  • It supports two way binding, which  means that the user input from fields is instantly updated in angular models.
  • AngularJS also employees technique called Dirty Checking which means that you don’t have to put data in special structures and call getter and setter methods to read and write to your data . You can simply put data in plain old JavaScript object and Angular will respond  whenever your data changes and update your view.
  • AngularJS is built on Dependency Injection.This lets you encapsulate pieces of your application better and also improves test ability.
  • AngularJS also handles routing for moving from one view to another .This is the key piece in building Single Page Application or SPA.
  • AngularJS not only supports unit test but also integrates end to end testing.

Directives :

AngularJS extends HTML by providing its own elements and properties called Directives.These are used to interact with your HTML DOM. It teaches your HTML new tricks.It is an extended HTML vocabulary.

Angular Components:

Everything starts with controller, it is a central player.screenshot-from-2016-09-17-011954

Continue reading “Basic Fundamentals of AngularJS”

How to use String.Format to get multiple value from radio button?

For getting more than one value let us say “ID” and “Contact” from single radio button on change event you have to write code like :

<input type=”radio” class=”radio” name=”RadioButton” value=’@String.Format(“{0}|{1}”,ID,Contact />

Now for getting these value using jquery :

<script>

$(“input[name=RadioButton]:radio”).change(function () {

var arm = $(this).val();

var arr = arm.split(‘|’);

var ID = arr[0];

var Contact = arr[1];

})

</script>

Happy Coding!!.

 

The located assembly’s manifest definition does not match the assembly reference

Looking for the solution. Yes you are at the right place. Once I also faced the same issue when I was working on a MVC project, I got the error states that “The located assembly’s manifest definition does not match the assembly reference” .

reference

When I ran the solution I saw the YSD (yellow screen of death) that simply gave me the assembly name which is causing the issue.

Could not load file or assembly ‘System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. HRESULT: 0x80131040

In my case I have several MVC projects referring to “System.Web.Optimization” , but I’m getting this issue only in newly added project. When I investigated the issue I found that the project referring to the higher version of “System.Web.Optimization”. This is because the dll has been included using nuget and nuget always downloads the latest version of dll.

FYI:  The Microsoft.Web.Optimization package is now obsolete. With ASP.NET (MVC) 4 and higher you should install the Microsoft ASP.NET Web Optimization Framework.

Continue reading “The located assembly’s manifest definition does not match the assembly reference”

MVC HTML Helpers Methods

In this article we will learn what are HTML helper Methods that comes within MVC framework!!!!…

So What are HTML Helper Methods ???

Html Helpers methods are equivalent to ASP.Net web form controls, enables you to render HTML content, modify the HTML output .

  • HTML Helpers are more light  weight.
  • It does not have event model and viewstate.

HTML Links

The easiest way to render HTML link is to use HTML.ActionLink() helper . With MVC , the HTML.ActionLink() does not link to view rather it creates a link to controller.

Syntax:

HTML.ActionLink(“LinkText”,”ActionName”,”ControllerName”)

HTML Helpers

Continue reading “MVC HTML Helpers Methods”

Data Entry Form using Simple HTML Helper In MVC

HTML Helper in MVC

In this article we will learn how to code for entering data form using simple HTML Helpers.

  • Create New ASP.NET MVC4 Web Application.
  • Select Razor As View Engine.
  • Right click on Model ->Add new Class ->Customer Class.HELPersModel
  • Right click on controller and -> Add new item-> CustomerController

ControllerHelper

Continue reading “Data Entry Form using Simple HTML Helper In MVC”

Render Pdf bytes array within browser in MVC

Render Pdf within browser

There are different ways to render Pdf in a browser. In this I’m explaining to render Pdf by fileContent/byte array. In a below example I’m using Index Action which returns the FileContentResult.

public ActionResult Index()
{
Response.Clear();
Response.AddHeader(“Content-Disposition”,“inline; filename=sample.pdf”);
Response.AddHeader(“Content-Type”,“application/pdf”);
Response.ClearHeaders();
Response.AddHeader(“Content-Length”, byteArray.Length.ToString());
FileContentResult result = new FileContentResult(byteArray, “application/pdf”);
return result;
}

That’s it from controller side. Now you have to call you Action to get it rendered on your HTML. You can use different HTML5 tags like :

<iframe>
<iframe src = @Url.Action(“Index”, “Home”)#zoom=150′ width = “100%” height=”525″ id=”iFramePdf” #zoom=”200″ frameBorder=”1″></iframe>

<embed>
<embed src=’@Url.Action(“Index”, “Home”)#zoom=150′ width = “100%” height=”525″ id=”iFramePdf” #zoom=”200″ frameBorder=”1″ type=”application/pdf”/>

<object>
<object data=’@Url.Action(“Index”, “Home”)#zoom=150′ width = “100%” height=”525″ id=”iFramePdf” #zoom=”200″ frameBorder=”1″ type=”application/pdf”>
</object>

Hope this article will help you.