Hello, sorry for bringing this one up again as I know it's been addressed a few times, but I'm having issues getting stylecop.json to be recognized by my project. Here's what I've tried:
<AdditionalItems /> element into its own <ItemGroup />.In all cases I still get a quick action that suggests the fix which is to replace my header which looks like this:
// =======================================================================
// <copyright file="AnalyticsDataProvider.cs" company="LAMA, LLC">
// Copyright 2015 Lama, LLC
// </copyright>
// =======================================================================
To this:
// =======================================================================
// <copyright file="AnalyticsDataProvider.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
// =======================================================================
Here's the contents of my stylecop.json file:
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json"
"settings": {
"documentationRules": {
"companyName": "LAMA, LLC",
"copyrightText": "Copyright 2015 {companyName}. All rights reserved."
}
}
}
I'm using Visual Studio Community 2015, version 4.6.00081 and RC3 of the analyzer. Any ideas are appreciated, thanks!
Can you try AdditionalFiles instead of AdditionalItems?
When you double click on stylecop.json for your project in Solution Explorer, does it open the correct file?
Hello and thanks for the suggestion. Apologies, I meant to say AdditionalFiles in my original post. Here's what I've put in the csproj:
<ItemGroup>
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>
When I double click stylecop.json in the solution explorer, it shows the correct file. It's adjacent to the csproj file. Also, I noticed that AdditionalFiles is not an option I can normally select in the Properties window when the file is selected, although it does appear as an option once the csproj is manually updated to include the <AdditionalFiles/> section.
I figured it out, it's because the "$schema" attribute has a syntax error after its value (missing a comma). Thanks!
@DirtyPiece Thanks for following up. I opened #2029 to help address this for future users. :smile:
This issue still exists in .Net core projects.
@bpraveen4u can you file a new issue for the behavior you are observing?
This issue still exists in .Net core projects.
Issue resolved. It was because of stylecop.json not well formed. missing one flower braces '}'