Type of agnostic language for Visual Studio?

I am writing a piece of code that is just a bunch of JavaScript and JSON files - this is a grunt plugin , not a website - and I would like to edit the files and manage the source using Visual Studio.

I am trying to build the project file 'vanilla' msbuild - not C #, not VB, etc., because these files are not valid in this kind of file. I can write a very simple MSBuild file with the extension .msbuildproj, but I can not upload it to VS2013 and I can not find an example anywhere.

Does anyone know how to put together an empty, language-independent project just for managing files?

+4
source share
2 answers

You are basically right:

  • Visual Studio projects (almost all modern types, that is) are MSBuild projects. But Visual Studio only loads projects for which there are extensions. You cannot upload custom MSBuild projects. (Of course, you can always edit the MSBuild file in XML format. If it is already loaded as a project, you must first upload it to edit it.)

  • With some types of projects, you cannot add the desired file type. For example, WiX projects do not allow the addition of T4 template files (.tt). It's a shame. However, you can edit the project to add them, which should not break anything. But it really depends on the author of the project type extension. However, I did not find a file that I cannot add to the C # project and Visual Basic.NET.

SLaks, - .

+1

msbuildproj - . VS. , . . VS2017 MSBuild, .NET Core, .

<Project Sdk="Microsoft.NET.Sdk">
  <ItemGroup>
    <Content Include="*" />
    <!-- Use "**" for all sub-folders -->
    <!--<Content Include="**" />-->
  </ItemGroup>

  <!-- A temporary solution, import C# Visual Studio design time targets in order to be able to load the project in Visual Studio -->
  <PropertyGroup>
    <CSharpDesignTimeTargetsPath Condition="'$(CSharpDesignTimeTargetsPath)'==''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets</CSharpDesignTimeTargetsPath>
  </PropertyGroup>
  <Import Project="$(CSharpDesignTimeTargetsPath)" Condition="'$(CSharpDesignTimeTargetsPath)' != '' and Exists('$(CSharpDesignTimeTargetsPath)')" />
</Project>
0

Source: https://habr.com/ru/post/1529472/


All Articles