• vs2015-Azure Mobile Service


    /App_Data

    /App_Start/

    WebApiConfig.cs

    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Data.Entity;
    using System.Web.Http;
    using WebApp2.DataObjects;
    using WebApp2.Models;
    using Microsoft.WindowsAzure.Mobile.Service;
    
    namespace WebApp2
    {
        public static class WebApiConfig
        {
            public static void Register()
            {
                // Use this class to set configuration options for your mobile service
                ConfigOptions options = new ConfigOptions();
    
                // Use this class to set WebAPI configuration options
                HttpConfiguration config = ServiceConfig.Initialize(new ConfigBuilder(options));
    
                // To display errors in the browser during development, uncomment the following
                // line. Comment it out again when you deploy your service for production use.
                // config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
    
                Database.SetInitializer(new MobileServiceInitializer());
            }
        }
    
        public class MobileServiceInitializer : DropCreateDatabaseIfModelChanges<MobileServiceContext>
        {
            protected override void Seed(MobileServiceContext context)
            {
                List<TodoItem> todoItems = new List<TodoItem>
                {
                    new TodoItem { Id = Guid.NewGuid().ToString(), Text = "First item", Complete = false },
                    new TodoItem { Id = Guid.NewGuid().ToString(), Text = "Second item", Complete = false },
                };
    
                foreach (TodoItem todoItem in todoItems)
                {
                    context.Set<TodoItem>().Add(todoItem);
                }
    
                base.Seed(context);
            }
        }
    }
    View Code

    /Controller

    TodoItemController.cs

    using System.Linq;
    using System.Threading.Tasks;
    using System.Web.Http;
    using System.Web.Http.Controllers;
    using System.Web.Http.OData;
    using Microsoft.WindowsAzure.Mobile.Service;
    using WebApp2.DataObjects;
    using WebApp2.Models;
    
    namespace WebApp2.Controllers
    {
        public class TodoItemController : TableController<TodoItem>
        {
            protected override void Initialize(HttpControllerContext controllerContext)
            {
                base.Initialize(controllerContext);
                MobileServiceContext context = new MobileServiceContext();
                DomainManager = new EntityDomainManager<TodoItem>(context, Request, Services);
            }
    
            // GET tables/TodoItem
            public IQueryable<TodoItem> GetAllTodoItems()
            {
                return Query();
            }
    
            // GET tables/TodoItem/48D68C86-6EA6-4C25-AA33-223FC9A27959
            public SingleResult<TodoItem> GetTodoItem(string id)
            {
                return Lookup(id);
            }
    
            // PATCH tables/TodoItem/48D68C86-6EA6-4C25-AA33-223FC9A27959
            public Task<TodoItem> PatchTodoItem(string id, Delta<TodoItem> patch)
            {
                return UpdateAsync(id, patch);
            }
    
            // POST tables/TodoItem
            public async Task<IHttpActionResult> PostTodoItem(TodoItem item)
            {
                TodoItem current = await InsertAsync(item);
                return CreatedAtRoute("Tables", new { id = current.Id }, current);
            }
    
            // DELETE tables/TodoItem/48D68C86-6EA6-4C25-AA33-223FC9A27959
            public Task DeleteTodoItem(string id)
            {
                return DeleteAsync(id);
            }
        }
    }
    View Code

    /DataObjects

    TodoItem.cs

    using Microsoft.WindowsAzure.Mobile.Service;
    
    namespace WebApp2.DataObjects
    {
        public class TodoItem : EntityData
        {
            public string Text { get; set; }
    
            public bool Complete { get; set; }
        }
    }
    View Code

    /Models

    MobileServiceContext.cs

    using System.Data.Entity;
    using System.Data.Entity.ModelConfiguration.Conventions;
    using System.Linq;
    using Microsoft.WindowsAzure.Mobile.Service;
    using Microsoft.WindowsAzure.Mobile.Service.Tables;
    using WebApp2.DataObjects;
    
    namespace WebApp2.Models
    {
    
        public class MobileServiceContext : DbContext
        {
            // You can add custom code to this file. Changes will not be overwritten.
            // 
            // If you want Entity Framework to alter your database
            // automatically whenever you change your model schema, please use data migrations.
            // For more information refer to the documentation:
            // http://msdn.microsoft.com/en-us/data/jj591621.aspx
            //
            // To enable Entity Framework migrations in the cloud, please ensure that the 
            // service name, set by the 'MS_MobileServiceName' AppSettings in the local 
            // Web.config, is the same as the service name when hosted in Azure.
    
            private const string connectionStringName = "Name=MS_TableConnectionString";
    
            public MobileServiceContext() : base(connectionStringName)
            {
            }
    
            public DbSet<TodoItem> TodoItems { get; set; }
    
            protected override void OnModelCreating(DbModelBuilder modelBuilder)
            {
                string schema = ServiceSettingsDictionary.GetSchemaName();
                if (!string.IsNullOrEmpty(schema))
                {
                    modelBuilder.HasDefaultSchema(schema);
                }
    
                modelBuilder.Conventions.Add(
                    new AttributeToColumnAnnotationConvention<TableColumnAttribute, string>(
                        "ServiceTableColumn", (property, attributes) => attributes.Single().ColumnType.ToString()));
            }
        }
    
    }
    View Code

    /Performance

    Microsoft.ServiceBus.MessagingPerformanceCounters.man

    <?xml version="1.0" encoding="UTF-16"?>
    <instrumentationManifest xsi:schemaLocation="http://schemas.microsoft.com/win/2004/08/events eventman.xsd" xmlns="http://schemas.microsoft.com/win/2004/08/events" xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:trace="http://schemas.microsoft.com/win/2004/08/events/trace">
      <instrumentation>
        <counters schemaVersion="1.1" xmlns:auto-ns1="http://schemas.microsoft.com/win/2004/08/events" xmlns="http://schemas.microsoft.com/win/2005/12/counters">
          <provider providerName="Microsoft.ServiceBus.Client" symbol="Microsoft_ServiceBus_Client" providerGuid="{F3B69C52-E054-40DB-B0A9-AE5D4A5A1D7B}" applicationIdentity="Microsoft.ServiceBus.dll" providerType="userMode" callback="custom">
            <counterSet name="Service Bus Messaging Client" symbol="ServiceBus_Message_Client" guid="{0BA5DC8D-1637-4906-BDEA-458155C39CC6}" uri="Microsoft.ServiceBus.Messaging.Client" description="ServiceBus Messaging Client performance counters for the Namespace" instances="multiple">
              <counter name="SendMessage Success Count" symbol="ServiceBus_Message_Client_SendMessageSuccessCount" uri="Microsoft.ServiceBus.Messaging.Client.SendMessageSuccessCount" description="Number of messages sent"
                       id="0" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="SendMessage Success/sec" symbol="ServiceBus_Message_Client_SendMessageSuccessPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.SendMessageSuccessPerSecond" description="Rate at which messages are sent"
                       id="1" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
                  <counter name="SendMessage Failure Count" symbol="ServiceBus_Message_Client_SendMessageFailureCount" uri="Microsoft.ServiceBus.Messaging.Client.SendMessageFailureCount" description="Number of failed attempts to send a message"
                       id="2" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="SendMessage Failures/sec" symbol="ServiceBus_Message_Client_SendMessageFailuresPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.SendMessageFailuresPerSecond" description="Rate at which send operations are failing"
                       id="3" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="SendMessage Latency Base" symbol="ServiceBus_Message_Client_SendMessageLatencyBase" uri="Microsoft.ServiceBus.Messaging.Client.SendMessageLatencyBase" description="Microsoft.ServiceBus.Messaging.Client.SendMessageLatencyBase"
                       id="4" type="perf_average_base" detailLevel="standard" aggregate="undefined">
                <counterAttributes>
                  <counterAttribute name="noDisplay">
                  </counterAttribute>
                </counterAttributes>
              </counter>
              <counter name="SendMessage Latency" symbol="ServiceBus_Message_Client_SendMessageLatency" uri="Microsoft.ServiceBus.Messaging.Client.SendMessageLatency" description="Average latency of a message send operation"
                       id="5" baseID="4" defaultScale="0" type="perf_average_timer" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="ReceiveMessage Success Count" symbol="ServiceBus_Message_Client_ReceiveMessageSuccessCount" uri="Microsoft.ServiceBus.Messaging.Client.ReceiveMessageSuccessCount" description="Number of messages received"
                       id="6" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="ReceiveMessage Success/sec" symbol="ServiceBus_Message_Client_ReceiveMessageSuccessPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.ReceiveMessageSuccessPerSecond" description="Rate at which messages are received"
                       id="7" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
                  <counter name="ReceiveMessage Failure Count" symbol="ServiceBus_Message_Client_ReceiveMessageFailureCount" uri="Microsoft.ServiceBus.Messaging.Client.ReceiveMessageFailureCount" description="Number of failed attempts to receive a message"
                       id="8" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="ReceiveMessage Failures/sec" symbol="ServiceBus_Message_Client_ReceiveMessageFailuresPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.ReceiveMessageFailuresPerSecond" description="Rate at which receive operations are failing"
                       id="9" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="ReceiveMessage Latency Base" symbol="ServiceBus_Message_Client_ReceiveMessageLatencyBase" uri="Microsoft.ServiceBus.Messaging.Client.ReceiveMessageLatencyBase" description="Microsoft.ServiceBus.Messaging.Client.ReceiveMessageLatencyBase"
                       id="10" type="perf_average_base" detailLevel="standard" aggregate="undefined">
                <counterAttributes>
                  <counterAttribute name="noDisplay">
                  </counterAttribute>
                </counterAttributes>
              </counter>
              <counter name="ReceiveMessage Latency" symbol="ServiceBus_Message_Client_ReceiveMessageLatency" uri="Microsoft.ServiceBus.Messaging.Client.ReceiveMessageLatency" description="Average latency of a message receive operation"
                       id="11" baseID="10" defaultScale="0" type="perf_average_timer" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="CompleteMessage Success Count" symbol="ServiceBus_Message_Client_CompleteMessageSuccessCount" uri="Microsoft.ServiceBus.Messaging.Client.CompleteMessageSuccessCount" description="Number of messages completed"
                       id="12" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="CompleteMessage Success/sec" symbol="ServiceBus_Message_Client_CompleteMessageSuccessPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.CompleteMessageSuccessPerSecond" description="Rate at which messages are completed"
                       id="13" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
                  <counter name="CompleteMessage Failure Count" symbol="ServiceBus_Message_Client_CompleteMessageFailureCount" uri="Microsoft.ServiceBus.Messaging.Client.CompleteMessageFailureCount" description="Number of failed attempts to complete a message"
                       id="14" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="CompleteMessage Failures/sec" symbol="ServiceBus_Message_Client_CompleteMessageFailuresPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.CompleteMessageFailuresPerSecond" description="Rate at which complete operations are failing"
                       id="15" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="CompleteMessage Latency Base" symbol="ServiceBus_Message_Client_CompleteMessageLatencyBase" uri="Microsoft.ServiceBus.Messaging.Client.CompleteMessageLatencyBase" description="Microsoft.ServiceBus.Messaging.Client.CompleteMessageLatencyBase"
                       id="16" type="perf_average_base" detailLevel="standard" aggregate="undefined">
                <counterAttributes>
                  <counterAttribute name="noDisplay">
                  </counterAttribute>
                </counterAttributes>
              </counter>
              <counter name="CompleteMessage Latency" symbol="ServiceBus_Message_Client_CompleteMessageLatency" uri="Microsoft.ServiceBus.Messaging.Client.CompleteMessageLatency" description="Average latency of a message complete operation"
                       id="17" baseID="16" defaultScale="0" type="perf_average_timer" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="AcceptMessageSessionByNamespace Completed Count" symbol="ServiceBus_Message_Client_AcceptMessageSessionByNamespaceCompletedCount" uri="Microsoft.ServiceBus.Messaging.Client.AcceptMessageSessionByNamespaceCompletedCount" description="Number of successful scaled receive AcceptMessageSession operations"
                       id="18" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="AcceptMessageSessionByNamespace Completed/sec" symbol="ServiceBus_Message_Client_AcceptMessageSessionByNamespaceCompletedPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.AcceptMessageSessionByNamespaceCompletedPerSecond" description="Rate at which scaled receive AcceptMessageSession operations complete successfully"
                       id="19" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="AcceptMessageSessionByNamespace Failure Count" symbol="ServiceBus_Message_Client_AcceptMessageSessionByNamespaceFailureCount" uri="Microsoft.ServiceBus.Messaging.Client.AcceptMessageSessionByNamespaceFailureCount" description="Number of failed scaled receive AcceptMessageSession operations"
                       id="20" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="AcceptMessageSessionByNamespace Failures/sec" symbol="ServiceBus_Message_Client_AcceptMessageSessionByNamespaceFailuresPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.AcceptMessageSessionByNamespaceFailuresPerSecond" description="Rate at which scaled receive AcceptMessageSession operations failed"
                       id="21" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="AcceptMessageSessionByNamespace Latency Base" symbol="ServiceBus_Message_Client_AcceptMessageSessionByNamespaceLatencyBase" uri="Microsoft.ServiceBus.Messaging.Client.AcceptMessageSessionByNamespaceLatencyBase" description="Microsoft.ServiceBus.Messaging.Client.AcceptMessageSessionByNamespaceLatencyBase"
                       id="22" type="perf_average_base" detailLevel="standard" aggregate="undefined">
                <counterAttributes>
                  <counterAttribute name="noDisplay">
                  </counterAttribute>
                </counterAttributes>
              </counter>
              <counter name="AcceptMessageSessionByNamespace Latency" symbol="ServiceBus_Message_Client_AcceptMessageSessionByNamespaceLatency" uri="Microsoft.ServiceBus.Messaging.Client.AcceptMessageSessionByNamespaceLatency" description="Average latency of a scaled receive AcceptMessageSession operations"
                       id="23" baseID="22" defaultScale="0" type="perf_average_timer" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="Exceptions Count" symbol="ServiceBus_Message_Client_ExceptionsCount" uri="Microsoft.ServiceBus.Messaging.Client.ExceptionsCount" description="Number of exceptions received"
                       id="24" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="Exceptions/sec" symbol="ServiceBus_Message_Client_ExceptionsPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.ExceptionsPerSecond" description="Rate at which exceptions are received"
                       id="25" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="MessagingExceptions/sec" symbol="ServiceBus_Message_Client_MessagingExceptionsPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.MessagingExceptionsPerSecond" description="Rate at which MessagingExceptions are received"
                       id="26" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="MessagingCommunicationExceptions/sec" symbol="ServiceBus_Message_Client_MessagingCommunicationExceptionsPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.MessagingCommunicationExceptionsPerSecond" description="Rate at which MessagingCommunicationExceptions are received"
                       id="27" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="ServerBusyExceptions/sec" symbol="ServiceBus_Message_Client_ServerBusyExceptionsPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.ServerBusyExceptionsPerSecond" description="Rate at which ServerBusyExceptions are received"
                       id="28" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="MessagingFactory Count" symbol="ServiceBus_Message_Client_MessagingFactoryCount" uri="Microsoft.ServiceBus.Messaging.Client.MessagingFactoryCount" description="Number of instantiated MessagingFactories"
                       id="29" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="TokensAcquired/sec" symbol="ServiceBus_Message_Client_TokensAcquiredPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.TokensAcquiredPerSecond" description="Rate at which tokes are aquired"
                       id="30" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="TokenAcquisitionFailures/sec" symbol="ServiceBus_Message_Client_TokenAcquisitionFailuresPerSecond" uri="Microsoft.ServiceBus.Messaging.Client.TokenAcquisitionFailuresPerSecond" description="Rate at which token acquisitions fail"
                       id="31" type="perf_counter_counter" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="Token Acquisition Latency Base" symbol="ServiceBus_Message_Client_TokenAcquisitionLatencyBase" uri="Microsoft.ServiceBus.Messaging.Client.TokenAcquisitionLatencyBase" description="Microsoft.ServiceBus.Messaging.Client.TokenAcquisitionLatencyBase"
                       id="32" type="perf_average_base" detailLevel="standard" aggregate="undefined">
                <counterAttributes>
                  <counterAttribute name="noDisplay">
                  </counterAttribute>
                </counterAttributes>
              </counter>
              <counter name="Token Acquisition Latency" symbol="ServiceBus_Message_Client_TokensAcquisitionLatency" uri="Microsoft.ServiceBus.Messaging.Client.TokensAcquisitionLatency" description="Average latency of a token acquisition operation"
                       id="33" baseID="32" defaultScale="0" type="perf_average_timer" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="Pending ReceiveMessage Count" symbol="ServiceBus_Message_Client_PendingReceiveMessageCount" uri="Microsoft.ServiceBus.Messaging.Client.PendingReceiveMessageCountt" description="Number of pending receive operations"
                       id="34" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="Pending AcceptMessageSession Count" symbol="ServiceBus_Message_Client_PendingAcceptMessageSessionCount" uri="Microsoft.ServiceBus.Messaging.Client.PendingAcceptMessageSessionCount" description="Number of pending AcceptMessageSession operations"
                       id="35" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
              <counter name="Pending AcceptMessageSessionByNamespace Count" symbol="ServiceBus_Message_Client_PendingAcceptMessageSessionByNamespaceCount" uri="Microsoft.ServiceBus.Messaging.Client.PendingAcceptMessageSessionByNamespaceCount" description="Number of pending scaled receive AcceptMessageSession operations"
                       id="36" type="perf_counter_large_rawcount" detailLevel="standard" aggregate="undefined">
              </counter>
            </counterSet>
          </provider>
        </counters>
      </instrumentation>
    </instrumentationManifest>
    View Code

    /ScheduledJobs

    SampleJobs.cs

    using System.Threading.Tasks;
    using System.Web.Http;
    using Microsoft.WindowsAzure.Mobile.Service;
    
    namespace WebApp2.ScheduledJobs
    {
        // A simple scheduled job which can be invoked manually by submitting an HTTP
        // POST request to the path "/jobs/sample".
    
        public class SampleJob : ScheduledJob
        {
            public override Task ExecuteAsync()
            {
                Services.Log.Info("Hello from scheduled job!");
                return Task.FromResult(true);
            }
        }
    }using System.Threading.Tasks;
    using System.Web.Http;
    using Microsoft.WindowsAzure.Mobile.Service;
    
    namespace WebApp2.ScheduledJobs
    {
        // A simple scheduled job which can be invoked manually by submitting an HTTP
        // POST request to the path "/jobs/sample".
    
        public class SampleJob : ScheduledJob
        {
            public override Task ExecuteAsync()
            {
                Services.Log.Info("Hello from scheduled job!");
                return Task.FromResult(true);
            }
        }
    }
    View Code

    /scripts

    ai.0.22.9-build00167.js

    ai.0.22.9-build00167.min.js

    /ApplicationInsights.config

    /Global.asax

    using System.Web.Http;
    using System.Web.Routing;
    
    namespace WebApp2
    {
        public class WebApiApplication : System.Web.HttpApplication
        {
            protected void Application_Start()
            {
                WebApiConfig.Register();
            }
        }
    }

    /packages.config

    <?xml version="1.0" encoding="utf-8"?>
    <packages>
      <package id="Autofac" version="3.5.2" targetFramework="net452" />
      <package id="AutoMapper" version="3.2.1" targetFramework="net452" />
      <package id="EntityFramework" version="6.1.1" targetFramework="net452" />
      <package id="Microsoft.ApplicationInsights" version="2.0.0" targetFramework="net452" />
      <package id="Microsoft.ApplicationInsights.Agent.Intercept" version="1.2.1" targetFramework="net452" />
      <package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.0.0" targetFramework="net452" />
      <package id="Microsoft.ApplicationInsights.JavaScript" version="0.22.9-build00167" targetFramework="net452" />
      <package id="Microsoft.ApplicationInsights.PerfCounterCollector" version="2.0.0" targetFramework="net452" />
      <package id="Microsoft.ApplicationInsights.Web" version="2.0.0" targetFramework="net452" />
      <package id="Microsoft.ApplicationInsights.WindowsServer" version="2.0.0" targetFramework="net452" />
      <package id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.0.0" targetFramework="net452" />
      <package id="Microsoft.AspNet.Cors" version="5.2.2" targetFramework="net452" />
      <package id="Microsoft.AspNet.Identity.Core" version="2.0.1" targetFramework="net452" />
      <package id="Microsoft.AspNet.Identity.Owin" version="2.0.1" targetFramework="net452" />
      <package id="Microsoft.AspNet.Razor" version="3.2.2" targetFramework="net452" />
      <package id="Microsoft.AspNet.WebApi.Client" version="5.2.2" targetFramework="net452" />
      <package id="Microsoft.AspNet.WebApi.Core" version="5.2.2" targetFramework="net452" />
      <package id="Microsoft.AspNet.WebApi.Cors" version="5.2.2" targetFramework="net452" />
      <package id="Microsoft.AspNet.WebApi.OData" version="5.2.2" targetFramework="net452" />
      <package id="Microsoft.AspNet.WebApi.Owin" version="5.2.2" targetFramework="net452" />
      <package id="Microsoft.AspNet.WebApi.Tracing" version="5.2.2" targetFramework="net452" />
      <package id="Microsoft.Data.Edm" version="5.6.2" targetFramework="net452" />
      <package id="Microsoft.Data.OData" version="5.6.2" targetFramework="net452" />
      <package id="Microsoft.Owin" version="3.0.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Host.SystemWeb" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Security" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Security.ActiveDirectory" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Security.Cookies" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Security.Facebook" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Security.Google" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Security.Jwt" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Security.MicrosoftAccount" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Security.OAuth" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.Owin.Security.Twitter" version="2.1.0" targetFramework="net452" />
      <package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net452" />
      <package id="Newtonsoft.Json" version="6.0.4" targetFramework="net452" />
      <package id="Owin" version="1.0" targetFramework="net452" />
      <package id="RazorEngine" version="3.4.1" targetFramework="net452" />
      <package id="System.IdentityModel.Tokens.Jwt" version="3.0.2" targetFramework="net452" />
      <package id="System.Spatial" version="5.6.2" targetFramework="net452" />
      <package id="WindowsAzure.MobileServices.Backend" version="1.0.390" targetFramework="net452" />
      <package id="WindowsAzure.MobileServices.Backend.Entity" version="1.0.390" targetFramework="net452" />
      <package id="WindowsAzure.MobileServices.Backend.Tables" version="1.0.390" targetFramework="net452" />
      <package id="WindowsAzure.ServiceBus" version="2.3.4.0" targetFramework="net452" />
    </packages>
    View Code

    /Web.config

    <?xml version="1.0" encoding="utf-8"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
      <configSections>
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
      <connectionStrings>
        <add name="MS_TableConnectionString" connectionString="Data Source=(localdb)MSSQLLocalDB;AttachDbFilename=|DataDirectory|aspnet-WebApp2-20160709105105.mdf;Initial Catalog=aspnet-WebApp2-20160709105105;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
      </connectionStrings>
      <appSettings>
        <!-- Service Bus specific app setings for messaging connections --><add key="PreserveLoginUrl" value="true" />
        <!-- Use these settings for local development. After publishing to 
        Mobile Services, these settings will be overridden by the values specified
        in the portal. -->
        <add key="MS_MobileServiceName" value="WebApp2" />
        <add key="MS_MasterKey" value="Overridden by portal settings" />
        <add key="MS_ApplicationKey" value="Overridden by portal settings" />
        <add key="MS_MicrosoftClientID" value="Overridden by portal settings" />
        <add key="MS_MicrosoftClientSecret" value="Overridden by portal settings" />
        <add key="MS_FacebookAppID" value="Overridden by portal settings" />
        <add key="MS_FacebookAppSecret" value="Overridden by portal settings" />
        <add key="MS_GoogleClientID" value="Overridden by portal settings" />
        <add key="MS_GoogleClientSecret" value="Overridden by portal settings" />
        <add key="MS_TwitterConsumerKey" value="Overridden by portal settings" />
        <add key="MS_TwitterConsumerSecret" value="Overridden by portal settings" />
        <add key="MS_AadClientID" value="Overridden by portal settings" />
        <add key="MS_AadTenants" value="Overridden by portal settings" />
        <!-- When using this setting, be sure to add matching Notification Hubs connection
        string in the connectionStrings section with the name "MS_NotificationHubConnectionString". -->
        <add key="MS_NotificationHubName" value="Overridden by portal settings" />
      <add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedSecretIssuer=owner;SharedSecretValue=[your secret]" /></appSettings>
      <system.web>
        <httpRuntime targetFramework="4.5.2" />
        <compilation debug="true" targetFramework="4.5.2" />
        <httpModules>
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
        </httpModules>
      </system.web>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <modules runAllManagedModulesForAllRequests="true">
          <remove name="ApplicationInsightsWebTracking" />
          <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
        </modules>
        <handlers>
          <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
          <remove name="OPTIONSVerbHandler" />
          <remove name="TRACEVerbHandler" />
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers>
      </system.webServer>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:bcl="urn:schemas-microsoft-com:bcl">
          <dependentAssembly>
            <assemblyIdentity name="System.IdentityModel.Tokens.Jwt" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.2.2.0" newVersion="5.2.2.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.6.2.0" newVersion="5.6.2.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.6.2.0" newVersion="5.6.2.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-5.6.2.0" newVersion="5.6.2.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
        <providers>
          <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
      </entityFramework>
    <system.serviceModel>
        <extensions>
          <!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. -->
          <behaviorExtensions>
            <add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
          </behaviorExtensions>
          <bindingElementExtensions>
            <add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
          </bindingElementExtensions>
          <bindingExtensions>
            <add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
          </bindingExtensions>
        </extensions>
      </system.serviceModel></configuration>
    View Code
  • 相关阅读:
    docker命令
    IntelliJ IDEA设置JVM运行参数
    SpringResourceBundleMessageSource示例(转)
    通过ApplicationContextAware加载Spring上下文环境(转)
    @ControllerAdvice + @ExceptionHandler 全局处理 Controller 层异常(转)
    SpringBoot学习(十一)创建自己的自动配置和Kotlin支持
    SpringBoot学习(十)Spring集成、会话、(监视和管理JMX)、WebSockets和web服务
    BindingResult不能获取错误对象
    SpringBoot学习(九)使用JTA的分布式事务、Hazelcast、Quartz调度器和任务执行和调度
    Maven项目中pom文件分析
  • 原文地址:https://www.cnblogs.com/ylbtech/p/5655770.html
Copyright © 2020-2023  润新知