Skip to content

Commit

Permalink
升级到.Net 4.6.1,编译通过
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Sep 23, 2018
1 parent 46ffd3c commit c43a8dc
Show file tree
Hide file tree
Showing 18 changed files with 161 additions and 183 deletions.
8 changes: 6 additions & 2 deletions HttpFilter/HttpFilter.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -15,9 +15,11 @@
<SccProvider>SAK</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -27,6 +29,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -35,6 +38,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
10 changes: 0 additions & 10 deletions HttpFilter/HttpFilter.csproj.vspscc

This file was deleted.

10 changes: 4 additions & 6 deletions XP/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.ServiceProcess;
using System.Collections;
using XLog;
using System.Diagnostics;
using System.IO;
using System.ServiceProcess;
using System.Windows.Forms;
using NewLife.Log;

namespace XP
{
Expand All @@ -30,7 +28,7 @@ static void Main()
}
catch (Exception ex)
{
XLog.Trace.WriteLine(ex.ToString());
XTrace.WriteLine(ex.ToString());
Console.WriteLine(ex.ToString());
}
return;
Expand Down
10 changes: 5 additions & 5 deletions XP/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions XP/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 17 additions & 12 deletions XP/XP.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -16,9 +16,11 @@
<ApplicationIcon>leaf.ico</ApplicationIcon>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -28,6 +30,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -36,8 +39,12 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="NewLife.Core, Version=7.3.6839.35284, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NewLife.Core.7.3.6839.35284\lib\net45\NewLife.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Data" />
Expand All @@ -47,10 +54,6 @@
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="XLog, Version=1.0.2928.39134, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\生成\XLog.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="FrmMain.cs">
Expand Down Expand Up @@ -87,18 +90,20 @@
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
Expand Down
10 changes: 0 additions & 10 deletions XP/XP.csproj.vspscc

This file was deleted.

17 changes: 9 additions & 8 deletions XP/XProxySvc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.IO;
using XProxy;
using XProxy.Base;
using NewLife.Log;

namespace XP
{
Expand All @@ -27,7 +28,7 @@ public WriteLogDelegate WriteLogEvent
{
get
{
if (_WriteLogEvent == null) return new WriteLogDelegate(XLog.Trace.WriteLine);
if (_WriteLogEvent == null) return new WriteLogDelegate(XTrace.WriteLine);
return _WriteLogEvent;
}
set { _WriteLogEvent = value; }
Expand All @@ -36,15 +37,15 @@ public WriteLogDelegate WriteLogEvent
protected override void OnStart(string[] args)
{
// TODO: 在此处添加代码以启动服务。
XLog.Trace.WriteLine("服务启动!");
XTrace.WriteLine("服务启动!");

StartService();
}

protected override void OnStop()
{
// TODO: 在此处添加代码以执行停止服务所需的关闭操作。
XLog.Trace.WriteLine("服务停止!");
XTrace.WriteLine("服务停止!");

StopService();
}
Expand All @@ -62,7 +63,7 @@ public void StartService()
ProxyConfig config = LoadConfig();
if (config == null)
{
XLog.Trace.WriteLine("无法找到配置文件!");
XTrace.WriteLine("无法找到配置文件!");
return;
}

Expand All @@ -79,7 +80,7 @@ public void StartService()
}
catch (Exception ex)
{
XLog.Trace.WriteLine("启动[" + lc.Name + "]时出错!" + ex.ToString());
XTrace.WriteLine("启动[" + lc.Name + "]时出错!" + ex.ToString());
}
}
}
Expand All @@ -100,7 +101,7 @@ public void StopService()
}
catch (Exception ex)
{
XLog.Trace.WriteLine(ex.ToString());
XTrace.WriteLine(ex.ToString());
}
}
}
Expand Down Expand Up @@ -133,7 +134,7 @@ ProxyConfig LoadConfig()
watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName;
watcher.Changed += new FileSystemEventHandler(watcher_Changed);
watcher.EnableRaisingEvents = true;
//XLog.Trace.WriteLine("建立监视器!");
//XTrace.WriteLine("建立监视器!");
}
return config;
}
Expand All @@ -145,7 +146,7 @@ ProxyConfig LoadConfig()
/// <param name="e"></param>
void watcher_Changed(object sender, FileSystemEventArgs e)
{
XLog.Trace.WriteLine("配置文件被修改!重新加载配置!");
XTrace.WriteLine("配置文件被修改!重新加载配置!");
StopService();
StartService();
}
Expand Down
3 changes: 3 additions & 0 deletions XP/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
4 changes: 4 additions & 0 deletions XP/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NewLife.Core" version="7.3.6839.35284" targetFramework="net461" />
</packages>
24 changes: 7 additions & 17 deletions XProxy.sln
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XProxy", "XProxy\XProxy.csproj", "{E2BA9F2D-AE8E-40AD-A18D-CB99AF3EE765}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XP", "XP\XP.csproj", "{4D7D2273-F63B-498C-BD82-A4CB929A461B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpFilter", "HttpFilter\HttpFilter.csproj", "{33BA8DD2-E0E7-4605-A074-109222C39FD9}"
EndProject
Global
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 4
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = https://tfs02.codeplex.com/
SccLocalPath0 = .
SccProjectUniqueName1 = HttpFilter\\HttpFilter.csproj
SccProjectName1 = HttpFilter
SccLocalPath1 = HttpFilter
SccProjectUniqueName2 = XP\\XP.csproj
SccProjectName2 = XP
SccLocalPath2 = XP
SccProjectUniqueName3 = XProxy\\XProxy.csproj
SccProjectName3 = XProxy
SccLocalPath3 = XProxy
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Expand All @@ -44,4 +31,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EF0B8BE3-C688-4539-99F3-3BCD7360ED9C}
EndGlobalSection
EndGlobal
10 changes: 0 additions & 10 deletions XProxy.vssscc

This file was deleted.

Loading

0 comments on commit c43a8dc

Please sign in to comment.