Closed doggy8088 closed 6 years ago
Hi - are there any you'd particularly like to see? I'm open to the idea :)
@tintoy Yes, I have tons of ideas for this. 😄
For ASP.NET Core 2.0 apps, there are some common patterns that are very often to add manually.
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
</ItemGroup>
dotnet-watch
tool
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
</ItemGroup>
<PropertyGroup>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup>
For .NET Core & NuGet package
<PropertyGroup>
<Company>$CompanyName$</Company>
<Authors>$Author$</Authors>
<Version>$Version$</Version>
<Description>$Description$</Description>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == '$moniker$'">
<Reference Include="$NuGetPackageName$" />
</ItemGroup>
There are some other frameworks such as Entity Framework Core. There are some tooling support need to change *.csproj
manually.
What do you think? 😃
Those are great ideas!
Would you like to open a PR or would you prefer me to add them? I'm happy to do either 😀
@tintoy Can I just put my snippets into https://github.com/tintoy/msbuild-project-tools-vscode/blob/master/snippets/msbuild-project.json , then you do the following works?
Sure that's fine, I can take it from there.
@tintoy PR https://github.com/tintoy/msbuild-project-tools-vscode/pull/29 have been tested. All works. Please take a look. Thanks. 😄
@doggy8088 - it's good to go:
https://github.com/tintoy/msbuild-project-tools-vscode/releases/tag/v0.2.21
Thanks again for your contribution! Feel free to add any other snippets you come up with :wink:
@tintoy I installed this version. The code snippets looks not working. Do you know why?
Have you changed the language to MSBuild?
Here's what I see:
I opened my *.csproj file, the default language mode is "XML". After I switch language mode to MSBuild. Everything is OK. But why my default is XML? What else I need to configure?
After I set the "files.associations" in my user settings. The default language mode has been changed to msbuild now. Problem solved. 👍
"files.associations": {
"*.csproj": "msbuild"
}
Yeah - the readme shows how to do that, but I was nervous about automatically taking over people's file associations :)
Hi,
Do you have any plan on code snippets for MSBuild project file? Any ideas?