0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

cscの作法 その600

Posted at

概要

cscの作法、調べてみた。
https://github.com/sta/
websocket-sharp,見つけたので、msbuildしてみた。

参考にしたページ

ビルド手順

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B357BAC7-529E-4D81-A0D2-71041B19C8DE}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>WebSocketSharp</RootNamespace>
    <AssemblyName>websocket-sharp</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <SignAssembly>false</SignAssembly>
    <AssemblyOriginatorKeyFile>websocket-sharp.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug</OutputPath>
    <DefineConstants>DEBUG</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Release</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug_Ubuntu|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug_Ubuntu</OutputPath>
    <DefineConstants>DEBUG</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_Ubuntu|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Release_Ubuntu</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <ConsolePause>false</ConsolePause>
    <GenerateDocumentation>true</GenerateDocumentation>
    <CustomCommands>
      <CustomCommands>
        <Command type="AfterBuild" command="doc/doc.sh" workingdir="doc/" externalConsole="True" />
      </CustomCommands>
    </CustomCommands>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.ServiceModel" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="AssemblyInfo.cs" />
    <Compile Include="Ext.cs" />
    <Compile Include="MessageEventArgs.cs" />
    <Compile Include="CloseEventArgs.cs" />
    <Compile Include="ByteOrder.cs" />
    <Compile Include="ErrorEventArgs.cs" />
    <Compile Include="WebSocket.cs" />
    <Compile Include="Server\WebSocketServer.cs" />
    <Compile Include="Net\AuthenticationSchemes.cs" />
    <Compile Include="Net\ChunkStream.cs" />
    <Compile Include="Net\Cookie.cs" />
    <Compile Include="Net\CookieCollection.cs" />
    <Compile Include="Net\CookieException.cs" />
    <Compile Include="Net\EndPointListener.cs" />
    <Compile Include="Net\EndPointManager.cs" />
    <Compile Include="Net\HttpConnection.cs" />
    <Compile Include="Net\HttpListener.cs" />
    <Compile Include="Net\HttpListenerContext.cs" />
    <Compile Include="Net\HttpListenerException.cs" />
    <Compile Include="Net\HttpListenerPrefixCollection.cs" />
    <Compile Include="Net\HttpListenerRequest.cs" />
    <Compile Include="Net\HttpListenerResponse.cs" />
    <Compile Include="Net\HttpStreamAsyncResult.cs" />
    <Compile Include="Net\HttpUtility.cs" />
    <Compile Include="Net\RequestStream.cs" />
    <Compile Include="Net\ResponseStream.cs" />
    <Compile Include="Net\WebHeaderCollection.cs" />
    <Compile Include="Server\HttpServer.cs" />
    <Compile Include="Net\HttpVersion.cs" />
    <Compile Include="Net\HttpStatusCode.cs" />
    <Compile Include="Server\WebSocketServiceHost.cs" />
    <Compile Include="CloseStatusCode.cs" />
    <Compile Include="Fin.cs" />
    <Compile Include="Mask.cs" />
    <Compile Include="Opcode.cs" />
    <Compile Include="PayloadData.cs" />
    <Compile Include="Rsv.cs" />
    <Compile Include="Net\WebSockets\HttpListenerWebSocketContext.cs" />
    <Compile Include="Net\WebSockets\TcpListenerWebSocketContext.cs" />
    <Compile Include="Net\WebSockets\WebSocketContext.cs" />
    <Compile Include="Server\HttpRequestEventArgs.cs" />
    <Compile Include="Net\HttpHeaderType.cs" />
    <Compile Include="Net\HttpHeaderInfo.cs" />
    <Compile Include="CompressionMethod.cs" />
    <Compile Include="WebSocketException.cs" />
    <Compile Include="LogData.cs" />
    <Compile Include="LogLevel.cs" />
    <Compile Include="Logger.cs" />
    <Compile Include="WebSocketState.cs" />
    <Compile Include="Server\IWebSocketSession.cs" />
    <Compile Include="Server\WebSocketSessionManager.cs" />
    <Compile Include="Server\ServerState.cs" />
    <Compile Include="Net\HttpBasicIdentity.cs" />
    <Compile Include="Net\HttpDigestIdentity.cs" />
    <Compile Include="Net\NetworkCredential.cs" />
    <Compile Include="Server\WebSocketServiceManager.cs" />
    <Compile Include="Net\InputState.cs" />
    <Compile Include="Net\LineState.cs" />
    <Compile Include="Net\ReadBufferState.cs" />
    <Compile Include="Net\Chunk.cs" />
    <Compile Include="Net\InputChunkState.cs" />
    <Compile Include="Net\ChunkedRequestStream.cs" />
    <Compile Include="Net\QueryStringCollection.cs" />
    <Compile Include="WebSocketFrame.cs" />
    <Compile Include="Net\AuthenticationChallenge.cs" />
    <Compile Include="Net\AuthenticationResponse.cs" />
    <Compile Include="HttpBase.cs" />
    <Compile Include="HttpRequest.cs" />
    <Compile Include="HttpResponse.cs" />
    <Compile Include="Server\WebSocketBehavior.cs" />
    <Compile Include="Net\HttpListenerPrefix.cs" />
    <Compile Include="Net\ClientSslConfiguration.cs" />
    <Compile Include="Net\ServerSslConfiguration.cs" />
    <Compile Include="Net\HttpListenerAsyncResult.cs" />
    <Compile Include="Net\HttpRequestHeader.cs" />
    <Compile Include="Net\HttpResponseHeader.cs" />
    <Compile Include="Server\WebSocketServiceHost`1.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <ItemGroup>
    <Folder Include="Server\" />
    <Folder Include="Net\" />
    <Folder Include="Net\WebSockets\" />
  </ItemGroup>
</Project>

実行結果

>msbuild websocket-sharp.csproj
Microsoft (R) Build Engine バージョン 4.8.9032.0
[Microsoft .NET Framework、バージョン 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

2025/07/17 6:13:46 にビルドを開始しました。
ノード 1 上のプロジェクト "C:\Users\ore\csc\websocket-sharp-master\websocket-sharp\websocket-sharp.csproj" (既定のターゲット)。
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: フレームワーク ".NETFramework,
Version=v4.0" の参照アセンブリが見つかりませんでした。これを解決するには、このフレームワーク バージョンの SDK または Targeting Pack をインストールするか、SDK または Targeting Pack を
インストールしているフレームワークのバージョンにアプリケーションを再ターゲットしてください。アセンブリはグローバル アセンブリ キャッシュ (GAC) から解決され、参照アセンブリの代わりに使用されるため、アセンブリが目的のフレームワーク
に正しくターゲットされない場合もあります。 [C:\Users\ore\csc\websocket-sharp-master\websocket-sharp\websocket-sharp.csproj]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: 構築されているプロジェクトのプロセッサ アー
キテクチャ "MSIL" と、参照 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" のプロセッサ アーキテクチャ "x86" の間には不一致がありました。この不一致
は、ランタイム エラーを発生させる可能性があります。プロジェクトと参照の間でプロセッサ アーキテクチャが一致するように、構成マネージャーを使用してターゲットとするプロジェクトのプロセッサ アーキテクチャを変更するか、ターゲットとするプロジ
ェクトのプロセッサ アーキテクチャに一致するプロジェクト アーキテクチャとの依存関係を参照で設定することを検討してください。 [C:\Users\ore\csc\websocket-sharp-master\websocket-sharp
\websocket-sharp.csproj]
GenerateTargetFrameworkMonikerAttribute:
すべての出力ファイルが入力ファイルに対して最新なので、ターゲット "GenerateTargetFrameworkMonikerAttribute" を省略します。
CoreCompile:
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /war
  n:4 /define:DEBUG /highentropyva- /reference:C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll /reference:C:
  \WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll /reference:C:\WIN
  DOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll /reference:C:\WINDOWS\Microsoft
  .Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll /debug+ /debug:full
   /optimize- /out:obj\Debug\websocket-sharp.dll /target:library /utf8output AssemblyInfo.cs Ext.cs MessageEventArgs.cs
   CloseEventArgs.cs ByteOrder.cs ErrorEventArgs.cs WebSocket.cs Server\WebSocketServer.cs Net\AuthenticationSchemes.cs
   Net\ChunkStream.cs Net\Cookie.cs Net\CookieCollection.cs Net\CookieException.cs Net\EndPointListener.cs Net\EndPoint
  Manager.cs Net\HttpConnection.cs Net\HttpListener.cs Net\HttpListenerContext.cs Net\HttpListenerException.cs Net\Http
  ListenerPrefixCollection.cs Net\HttpListenerRequest.cs Net\HttpListenerResponse.cs Net\HttpStreamAsyncResult.cs Net\H
  ttpUtility.cs Net\RequestStream.cs Net\ResponseStream.cs Net\WebHeaderCollection.cs Server\HttpServer.cs Net\HttpVers
  ion.cs Net\HttpStatusCode.cs Server\WebSocketServiceHost.cs CloseStatusCode.cs Fin.cs Mask.cs Opcode.cs PayloadData.c
  s Rsv.cs Net\WebSockets\HttpListenerWebSocketContext.cs Net\WebSockets\TcpListenerWebSocketContext.cs Net\WebSockets\
  WebSocketContext.cs Server\HttpRequestEventArgs.cs Net\HttpHeaderType.cs Net\HttpHeaderInfo.cs CompressionMethod.cs W
  ebSocketException.cs LogData.cs LogLevel.cs Logger.cs WebSocketState.cs Server\IWebSocketSession.cs Server\WebSocketS
  essionManager.cs Server\ServerState.cs Net\HttpBasicIdentity.cs Net\HttpDigestIdentity.cs Net\NetworkCredential.cs Se
  rver\WebSocketServiceManager.cs Net\InputState.cs Net\LineState.cs Net\ReadBufferState.cs Net\Chunk.cs Net\InputChunk
  State.cs Net\ChunkedRequestStream.cs Net\QueryStringCollection.cs WebSocketFrame.cs Net\AuthenticationChallenge.cs Ne
  t\AuthenticationResponse.cs HttpBase.cs HttpRequest.cs HttpResponse.cs Server\WebSocketBehavior.cs Net\HttpListenerPr
  efix.cs Net\ClientSslConfiguration.cs Net\ServerSslConfiguration.cs Net\HttpListenerAsyncResult.cs Net\HttpRequestHea
  der.cs Net\HttpResponseHeader.cs "Server\WebSocketServiceHost`1.cs" "C:\Users\ore\AppData\Local\Temp\.NETFramework,Ve
  rsion=v4.0.AssemblyAttributes.cs"
_CopyFilesMarkedCopyLocal:
  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" から "bin\Debug\mscorlib.dll" へファイルをコピーしています。
  ディレクトリ "bin\Debug\ja" を作成しています。
  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\ja\mscorlib.resources.dll" から "bin\Debug\ja\mscorlib.resources.dll" へフ
  ァイルをコピーしています。
  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normidna.nlp" から "bin\Debug\normidna.nlp" へファイルをコピーしています。
  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normnfc.nlp" から "bin\Debug\normnfc.nlp" へファイルをコピーしています。
  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normnfd.nlp" から "bin\Debug\normnfd.nlp" へファイルをコピーしています。
  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normnfkc.nlp" から "bin\Debug\normnfkc.nlp" へファイルをコピーしています。
  "C:\Windows\Microsoft.NET\Framework\v4.0.30319\normnfkd.nlp" から "bin\Debug\normnfkd.nlp" へファイルをコピーしています。
CopyFilesToOutputDirectory:
  "obj\Debug\websocket-sharp.dll" から "bin\Debug\websocket-sharp.dll" へファイルをコピーしています。
  websocket-sharp -> C:\Users\ore\csc\websocket-sharp-master\websocket-sharp\bin\Debug\websocket-sharp.dll
  "obj\Debug\websocket-sharp.pdb" から "bin\Debug\websocket-sharp.pdb" へファイルをコピーしています。
プロジェクト "C:\Users\ore\csc\websocket-sharp-master\websocket-sharp\websocket-sharp.csproj" (既定のターゲット) のビルドが完了しました。


ビルドに成功しました。

"C:\Users\ore\csc\websocket-sharp-master\websocket-sharp\websocket-sharp.csproj" (既定のターゲット) (1) ->
(GetReferenceAssemblyPaths ターゲット) ->
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: フレームワーク ".NETFramewor
k,Version=v4.0" の参照アセンブリが見つかりませんでした。これを解決するには、このフレームワーク バージョンの SDK または Targeting Pack をインストールするか、SDK または Targeting Pack
 をインストールしているフレームワークのバージョンにアプリケーションを再ターゲットしてください。アセンブリはグローバル アセンブリ キャッシュ (GAC) から解決され、参照アセンブリの代わりに使用されるため、アセンブリが目的のフレームワ
ークに正しくターゲットされない場合もあります。 [C:\Users\ore\csc\websocket-sharp-master\websocket-sharp\websocket-sharp.csproj]


"C:\Users\ore\csc\websocket-sharp-master\websocket-sharp\websocket-sharp.csproj" (既定のターゲット) (1) ->
(ResolveAssemblyReferences ターゲット) ->
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: 構築されているプロジェクトのプロセッサ
アーキテクチャ "MSIL" と、参照 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" のプロセッサ アーキテクチャ "x86" の間には不一致がありました。この不
一致は、ランタイム エラーを発生させる可能性があります。プロジェクトと参照の間でプロセッサ アーキテクチャが一致するように、構成マネージャーを使用してターゲットとするプロジェクトのプロセッサ アーキテクチャを変更するか、ターゲットとするプ
ロジェクトのプロセッサ アーキテクチャに一致するプロジェクト アーキテクチャとの依存関係を参照で設定することを検討してください。 [C:\Users\ore\csc\websocket-sharp-master\websocket-sha
rp\websocket-sharp.csproj]

    2 個の警告
    0 エラー

経過時間 00:00:03.66

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?