VS2019 XML documentation file will not uncheck - visual-studio-2019

I turned on XML Documentation in an VS2019 ASP.Net Core 3.1 project (Properties > Build > XML documentation file). I want to uncheck the option, but it won't stay unchecked! I have unchecked the box a ton of different ways, including selecting "All Configurations" each time I close and open properties, it is always back on. Then I went searching the project files for where it is referenced and it isn't!
Where is this stored?
how do I disable it?

I was facing the same issue and I was able to solve it by deleting
<GenerateDocumentationFile>true</GenerateDocumentationFile>
from the .csproj file, as mentioned in the documentation.
I wasn't able to understand why Visual Studio wasn't updating that configuration, though.

Related

All the project files showing as Miscellaneous Files. Visual Studio 2017

I moved my Asp.net-mvc project from desktop to F drive and all the files are showing as miscellaneous files.
I've tried running the visual studio installer and modify to make sure that "Nuget targets and build tasks" are ticked.
I've also tried :
excluding the file
add existing member(adding the file again)
but nothing's working.
Same thing happened with my asp.net core web api when I moved it, it's working fine tho, getting data from server.
Hope you will solve your problem
Solution 1:
Create new project then paste all project contents in new created project.Restore Nuget packages then Build it.
Solution 2 :
Go to the file which are Miscellaneous inside Solution Explorer.
Right click those file'(s) and select Exclude from project.
Add Existing Item to project, you just excluded.
Probably your file property configuration is wrong.
Try this:
Right click over the File that has this problem
Click on Properties
Under Advanced -> Build Action, check if other than "Compile" is selected.
If so, change it to "Compile".
Properties Window

Certain Razor views not publishing

Using VS 2017 with MVC 5 Razor views. When I publish my application, a handful of specific views do not get copied over.
I'd discovered several SE questions on this same issue from back in the 2010-2011 timeframe. At the time, the issue was that Build Action in the file's properties was not set to Content due to a bug in some early RC which has since been resolved. Well, all of mine already do day Content for Build Action.
Any reason why only a small number of views are not making it in the publish?
As far as I'm aware, there are only 2 things that can cause this to happen.
As you say in the question, the build action for each view needs to be set to "Content"
The view files need to be included in the project file, so in the .csproj file there should be a line like this:
<Content Include="Views\ControllerName\Index.cshtml" />
Another one would be to set this in your csproje file. This was missing in mine, which caused it to make a precompiledviews.dll in my publish:
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
Set it to false explicitely in order to publish .cshtml files.
Visual Studio -> Right click on "Views" in solution explorer. Click "Publish Views". This will set all the views to Content"
Depending on the version of Visual Studio, excluding and then including partial view or its folder may work or not. The most certain way to do it is to remove it from .csproj file and then include it again.
lets say _LoginPartial is not updated after publishing (especially if you have some razor code).
First open '.csproj' file, and remove
<Content Include="Views\Shared\_LoginPartial.cshtml" />
The build the project, and then add it again to .csproj, and rebuild and publish.
Another Solution From Visual Studio
right-click on the file and "Exclude From Project".
select the Project and click on "Show All Files" from Solution Explore (top horizontal menu bar on Solution Explore)
right-click on the file that Excluded and Click on "Include In Project".
This will automatically modify the .csproj file.

specflow generate step definitions missing from context menu

I followed the getting started instructions and the "generate step definitions" is missing from context menu.
I tried adding the additional specflow packages from nuget for mstest and still nothing.
I had the same problem. I was looking for this option in contextual menu of the feature file, but this option exists in the contextual menu of the content of the feature file. So, try open the feature file (*.feature) in the Visual Studio text editor and click right button of the mouse inside text editor. Example of the file:
Scenario: Add two numbers
Given I have entered 50 into the calculator
And I have entered 70 into the calculator
When I press add
Then the result should be 120 on the screen
Assuming you are bringing up the correct context menu by right clicking in the .feature file as opposed to anywhere else then you may find that the issue is actually caused by the TechTalk.SpecFlow.dll not being referenced in your project.
To add the reference manually (NuGet didn't do it for me) right-click on the References folder of your project and find the TechTalk.SpecFlow.dll which will likely be in '[project]/packages/SpecFlow.X.X.X/lib/netXX/' (X's are version numbers).
Here is the context menu when I don't have the correct reference in place:
And here it is once I do:
This was SpecFlow.2.1.0 and VS2010 which led me to another issue with incompatible .Net versions so I ended up using SpecFlow.1.9.0.
Try to install SpecRun.SpecFlow from the Nuget Packages, after installation completes you'll get the "Generate Step Definitions" on the context menu.
It worked for me.
Install specflow from Extensions and updates and then restart the visual studio, clean and rebuild the solution
I had the same problem. maybe it was related with fresh IDE installation or maybe it was something new... here is just short note about this issue and possible solution:
At the beginning of IDE/project configuration check or install packages for SpecFlow in the NuGet manager.
Check twice what exactly you will use in the project Xunit or Nunit and then install the related package Xunit or Nunit. In my case, I was working with Xunit and install it.
After installation, you will see new items in the References
and pop about re-generation feature files
After that Generation steps will be available
This is because you may not have the simply installing the Extension for SpecFlow at Solution level is not enough.
SpecRun.SpecFlow is an evaluation version unless you are prepared to play for a license key.
I added the NuGet package SpecFlow.xUnit to the Unit test Project within my solution where I held my feature files. This resolved the issue, I now see Generate step definitions.
This is achieved by Right-clicking on your feature file in the code editor and select Generate Step Definitions from the popup menu. A dialogue is then displayed.
This happened to me when I migrated an existing project to a new PC.
Turns out I need to do: Visual Studio 2019 > Extensions > Manage Extensions > select 'Online' in the left hand nav > then search for 'Specflow' in the search box > then download it and close Visual Studio. It auto installs then.
Finally reopen VS and it should work.
In Visual studio 2022 the context menu item "generate step definitions" renamed to "Define steps" as per below specflow documentation.
https://docs.specflow.org/projects/specflow/en/latest/visualstudio/Generating-Skeleton-Code.html

Excluded files from tfs still being checked in

I'm currently working on a WiX project and I need to include some files in my project but exclude them from tfs. I need to do this because these files are auto-generated at compile time but they have to be part of the project to be compiled. I thought that I could exclude them from source control by going to File->Source Control->Advanced->Exclude <file> From Source Control but it still seems to be including it in TFS.
Below is a picture of my project and it appears that visual studio is trying to exclude them from tfs judging by the little red icon next to the files I'm excluding. However when I compile it errors out because the excluded files are read only and I can clearly see them checked in by looking at the source control explorer window.
Is this an issue in visual studio or am I doing something wrong here?
I resolved this by closing out my solution and deleting the files in source control explorer. Before when I was deleting them from source control explorer I had my solution open and it was actually removing them from the project file. Seems like when you exclude them from source control via the method described above it should remove them from source control but it doesn't.

.csproj files not getting checked in to TFS

My problem is that in my scenario, I have a project with two parallel project files for different build targets. I have a ProjectName.WP8.csproj and ProjectName.WinRT.csproj, which essentially include the same files.
I am trying to check-in this solution (SolutionName.WinRT.sln) to TFS and I get no errors. All the code changes to the code in the project goes through, but when I check the actual state of TFS, the (newer) PorjectName.WinRT.csproj files are not checked in.
This is quite peculiar since it worked perfectly for the WP8 version. How can I support this kind of scenario?
(If it's not possible, how do I easily migrate my parallel project to another TFS project?)
Just had this come up myself. I had been working on a project for a few days before checking the solution in. During the initial check in for the project, only the most recent file edits were seen by source control. I was able to highlight all the files in the Solution Explorer and select Add to Source Control from the right click menu, but the csproj files themselves did not check in. To do this, I had to go into the Source Control Explorer and open the project directory. From within the directory, right click and select Add Items to Folder. Then you can select the csproj files and you're good to go.

Resources