Update wcf sample
This commit is contained in:
Родитель
2f9f5db72d
Коммит
56959e7198
|
@ -1,10 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Web;
|
||||
using System.Text;
|
||||
|
||||
namespace WcfUnityService
|
||||
{
|
||||
|
|
|
@ -1 +1 @@
|
|||
<%@ ServiceHost Language="C#" Debug="true" Service="WcfUnityService.Service1" CodeBehind="Service1.svc.cs" %>
|
||||
<%@ ServiceHost Language="C#" Debug="true" Service="WcfUnityService.Service1" CodeBehind="Service1.svc.cs" Factory="WcfUnityService.WcfServiceFactory" %>
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Web;
|
||||
using System.Text;
|
||||
using System;
|
||||
|
||||
namespace WcfUnityService
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WcfUnityService</RootNamespace>
|
||||
<AssemblyName>WcfUnityService</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
|
||||
<WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
|
@ -22,6 +22,7 @@
|
|||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -41,24 +42,12 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Entity" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceModel.Web" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<PackageReference Include="Unity.Wcf" Version="5.9.*" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Service1.svc" />
|
||||
|
@ -70,6 +59,7 @@
|
|||
</Compile>
|
||||
<Compile Include="IService1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WcfServiceFactory.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
|
@ -107,7 +97,7 @@
|
|||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
using Unity;
|
||||
using Unity.Wcf;
|
||||
|
||||
namespace WcfUnityService
|
||||
{
|
||||
public class WcfServiceFactory : UnityServiceHostFactory {
|
||||
protected override void ConfigureContainer(IUnityContainer container) {
|
||||
// configure container
|
||||
container
|
||||
.RegisterType<IService1, Service1>();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
|
||||
<appSettings>
|
||||
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
|
||||
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/>
|
||||
</appSettings>
|
||||
<!--
|
||||
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
|
||||
|
||||
The following attributes can be set on the <httpRuntime> tag.
|
||||
<system.Web>
|
||||
<httpRuntime targetFramework="4.6.1" />
|
||||
</system.Web>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.7.2" />
|
||||
<httpRuntime targetFramework="4.7.2"/>
|
||||
<compilation debug="true" targetFramework="4.7.1"/>
|
||||
<httpRuntime targetFramework="4.7.1"/>
|
||||
</system.web>
|
||||
<system.serviceModel>
|
||||
<behaviors>
|
||||
|
@ -20,9 +27,9 @@
|
|||
</serviceBehaviors>
|
||||
</behaviors>
|
||||
<protocolMapping>
|
||||
<add binding="basicHttpsBinding" scheme="https" />
|
||||
</protocolMapping>
|
||||
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
|
||||
<add binding="basicHttpsBinding" scheme="https"/>
|
||||
</protocolMapping>
|
||||
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
|
||||
</system.serviceModel>
|
||||
<system.webServer>
|
||||
<modules runAllManagedModulesForAllRequests="true"/>
|
||||
|
@ -32,5 +39,4 @@
|
|||
-->
|
||||
<directoryBrowse enabled="true"/>
|
||||
</system.webServer>
|
||||
|
||||
</configuration>
|
||||
|
|
Загрузка…
Ссылка в новой задаче