概要
cscの作法、調べてみた。
runcat見つけたので、やってみた。
参考にしたページ
手順
ダウンロード
runcat.csprojを書き換える。
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{148B00E2-DAFD-4AA6-BDBA-3A365047DD9B}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>RunCat</RootNamespace>
<AssemblyName>RunCat</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>appIcon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<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>
<DesignTime>True</DesignTime>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="*.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="appIcon.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="resources\*.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
msbuild
>msbuild
Microsoft (R) Build Engine バージョン 4.8.9037.0
[Microsoft .NET Framework、バージョン 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
2026/09/04 10:20:00 にビルドを開始しました。
ノード 1 上のプロジェクト "C:\Users\ohisa\csc\runcat4\RunCat\RunCat.csproj" (既定のターゲット)。
プロジェクト ファイルに ToolsVersion="15.0" が含まれています。このツールセットが不明であるか、存在しない可能性があります。その場合は、適切なバージョンの MSBuild をインストールして解決するか、ビルドがポリシー
上の理由により特定の ToolsVersion を使用するよう強制されている可能性があります。プロジェクトを ToolsVersion="4.0" として扱います。詳細については、http://go.microsoft.com/fwlin
k/?LinkId=291333 を参照してください。
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: フレームワーク ".NETFramework,
Version=v4.8" の参照アセンブリが見つかりませんでした。これを解決するには、このフレームワーク バージョンの SDK または Targeting Pack をインストールするか、SDK または Targeting Pack を
インストールしているフレームワークのバージョンにアプリケーションを再ターゲットしてください。アセンブリはグローバル アセ ンブリ キャッシュ (GAC) から解決され、参照アセンブリの代わりに使用されるため、アセンブリが目的のフレームワーク
に正しくターゲットされない場合もあります。 [C:\Users\ohisa\csc\runcat4\RunCat\RunCat.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\ohisa\csc\runcat4\RunCat\RunCat.csproj]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: 構築されているプロジェ クトのプロセッサ アー
キテクチャ "MSIL" と、参照 "System.Data" のプロセッサ アーキテクチャ "AMD64" の間には不一致がありました。この不一致は、 ランタイム エラーを発生させる可能性があります。プロジェクトと参照の間でプロセッサ ア
ーキテクチャが一致するように、構成マネージャーを使用してターゲットとするプロジェクトのプロセッサ アーキテクチャを変更す るか、ターゲットとするプロジェクトのプロセッサ アーキテクチャに一致するプロジェクト アーキテクチャとの依存関係を参照
で設定することを検討してください。 [C:\Users\ohisa\csc\runcat4\RunCat\RunCat.csproj]
CoreResGen:
古いリソースは、それらのソース ファイルに対して存在しません。リソース生成を省略します。
GenerateTargetFrameworkMonikerAttribute:
すべての出力ファイルが入力ファイルに対して最新なので、ターゲット "GenerateTargetFrameworkMonikerAttribute" を省略します 。
CoreCompile:
すべての出力ファイルが入力ファイルに対して最新なので、ターゲット "CoreCompile" を省略します。
_CopyOutOfDateSourceItemsToOutputDirectory:
すべての出力ファイルが入力ファイルに対して最新なので、ターゲット "_CopyOutOfDateSourceItemsToOutputDirectory" を省略します。
_CopyAppConfigFile:
すべての出力ファイルが入力ファイルに対して最新なので、ターゲット "_CopyAppConfigFile" を省略します。
CopyFilesToOutputDirectory:
RunCat -> C:\Users\ohisa\csc\runcat4\RunCat\bin\Debug\RunCat.exe
プロジェクト "C:\Users\ohisa\csc\runcat4\RunCat\RunCat.csproj" (既定のターゲット) のビルドが完了しました。
ビルドに成功しました。
"C:\Users\ohisa\csc\runcat4\RunCat\RunCat.csproj" (既定のターゲット) (1) ->
(GetReferenceAssemblyPaths ターゲット) ->
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: フレームワーク ".NETFramewor
k,Version=v4.8" の参照アセンブリが見つかりませんでした。これを解決するには、このフレームワーク バージョンの SDK または Targeting Pack をインストールするか、SDK または Targeting Pack
をインストールしているフレームワークのバージョンにアプリケーションを再ターゲットしてください。アセンブリはグローバル アセンブリ キャッシュ (GAC) から解決され、参照アセンブリの代わりに使用されるため、アセンブリが目的のフレームワ
ークに正しくターゲットされない場合もあります。 [C:\Users\ohisa\csc\runcat4\RunCat\RunCat.csproj]
"C:\Users\ohisa\csc\runcat4\RunCat\RunCat.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\ohisa\csc\runcat4\RunCat\RunCat.csproj]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: 構築されているプロジ ェクトのプロセッサ
アーキテクチャ "MSIL" と、参照 "System.Data" のプロセッサ アーキテクチャ "AMD64" の間には不一致がありました。この不一致 は、ランタイム エラーを発生させる可能性があります。プロジェクトと参照の間でプロセッサ
アーキテクチャが一致するように、構成マネージャーを使用してターゲットとするプロジェクトのプロセッサ アーキテクチャを変更するか、ターゲットとするプロジェクトのプロセッサ アーキテクチャに一致するプロジェクト アーキテクチャとの依存関係を
参照で設定することを検討してください。 [C:\Users\ohisa\csc\runcat4\RunCat\RunCat.csproj]
3 個の警告
0 エラー
経過時間 00:00:02.06
実行結果
以上。
