2016-04-28 7 views
0

ビルドマシンから実行するアプリケーションファイルをビルドします。私は、ソリューションファイルを開くときに、プロジェクトファイルを開いて同じ視点を得ることが可能かどうか、Visual Studioで解決策を教えてくれるのだろうかと思っていました。Visual Studioで開いたときにcsprojファイルをソリューションエクスプローラに読み込むprojファイルを作成します。

これまでのところ私のContosa.projファイルがあります。現在

<?xml version="1.0" encoding="utf-8"?> 
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
    <PropertyGroup> 
    <Configuration Condition=" '$(Configuration)'=='' ">Debug</Configuration> 
    <RootNamespace>Contosa</RootNamespace> 
    <AssemblyName>Contosa</AssemblyName> 
    </PropertyGroup> 

    <ItemGroup> 
    <Projects Include="C:\Users\localuser\Documents\Perforce\Contosa\Branches\Working23\UI\Desktop\ContosaClient\ContosaClient.csproj" /> 
    </ItemGroup> 

    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 

    <Target Name="Build"> 

    <PropertyGroup> 
     <Contosa>$(MSBuildProjectDirectory)\UI\Desktop\ContosaClient\ContosaClient.csproj</Contosa> 
    </PropertyGroup> 



    <MSBuild Projects="$(Contosa)" 
       Properties="Configuration=QA; 
          VisualStudioVersion=12.0; 
          DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\; 
          SolutionDir=$(MSBuildProjectDirectory)\"/> 
    </Target> 
</Project> 

その関連アプリケーションは、テキスト編集用Contosa.projを開くようVisual Studioに、このファイルをダブルクリックします。 Contosa.slnファイルのように私のContosa.projファイルとVisual Studioを関連付けることができたら本当に嬉しいです。したがって、開発者がVisual Studioで開くと、Contosa.slnから取得したのと同じビューが表示されます。私は、csprojまたはslnファイルのどの部分が、Visual Studioのプロジェクトまたはソリューションとしてそれらを開いているのか理解していません。

UPDATE 1

私は、このユーザーReplace .sln with MSBuild and wrap contained projects into targetsがした何をするのを楽しみにしていますが、私はプロジェクトファイルは、ソリューションファイルなどのユーザーが開いたことができるようにしたいです。私がインクルードするプロジェクトをソリューションエクスプローラにロードしたい。

答えて

0

Visual Studioをインストールすると、.csprojがダブルクリックされたときにVisual Studioを起動するようにエクスプローラが設定されます(How can I set a file association from a custom file type to a program)。あなたのウィンドウと開発者ウィンドウは、.projが何であるかを知らない。したがって、.csprojという名前を変更するか、.projを参照する.slnを配布してください。

関連する問題