This question already has answers here:
Test Explorer (VS) shows '<Unknown project>'
(5 answers)
Closed 3 years ago.
Background
I have been working on a project and noticed that one of my Specflow Scenarios needed updating.
I updated the Specflow Scenario by splitting it into two different scenarios (one for an invalid test and one for a valid test).
After this I then regenerated the feature.cs file, cleaned and rebuilt the solution.
(I am using Microsoft Visual Studio Enterprise 2019 Version 16.4.1)
Issue
This is when the "unknown project" appeared in my Test Explorer that consists of one test... the one I have changed. It cannot be run, however it cannot be removed either.
Here is what I am seeing:
The only way I have been able to get rid of this, for a brief period at least, is by deleting my entire solution and then pulling it back down again, which is less than ideal.
Here is a list of what I have tried to resolve this;
Updated all Nuget packages within the solution to the latest versions.
Restarted Test Explorer
Restarted Visual Studios
Deleted feature.cs files and regenerated
Cleaned and rebuilt solution
Updated Visual Studios (this seems to have made the situation appear more often)
Deleted the solution and pulled it back down (this works until I have to change an existing test and then restarted Visual Studios)
Has anyone seen this before, or know how to fix this?
So after a day of trying to figure this out with my team we have finally resolved the issue.
The issue was caused by the cached (hidden) .vs file. When deleting this and restarting the solution the unknown project was gone.
Related
I have (fairly large) C# solution in VS 2019, running with ReSharper. Since a few days - and I can't make out the trigger - the following happens:
I change code, add a breakpoint (not required, but makes the issue show nicely), click "Start" (triggering a build and a run) and the application runs, but using old code.
The breakpoint changes to "broken" after the build, which is quick. And the build log is unbelievably short, without any warnings, but also without errors. It lists that the project I made the change in was successfully rebuilt or at least that the build was started.
I thought I may have this issue, but the code executed is the old.
Is this a caching issue? Can I get better logs somewhere?
Is this (full re-install of VS) the only solution?
EDIT: It appears to be getting worse, by now I have to manually/explicitly rebuild my solution before running (almost) every time. And, if this is any hint: while trying to fix the issue, I deleted the hidden .vs folder (where the. suo files lives) - and it has not been re-created. Shouldn't it have been?
EDIT2: The link from dwcanillas below inspired me to search deeper in my solution folder for any nested .vs folders and, indeed, I found a few - not for every project, but for some. I deleted them all and today so far it appears to be better.
CURRENT SOLUTION (another visual studio voodoo recipe):
Clean top-level solution
Close Visual Studio
Delete all ".vs" folders (hidden, in every solution folder)
Open Visual Studio
Rebuild top-level solution
Observed side-effects: Previously unloaded projects will be loaded again. But there's probably more...
You may have to, though try rebuilding it first, and cleaning the solution as well.
When I try to create a new Windows Forms project, I get the " ....csproj cannot be opened because its project type (.csproj) is not supported by this version of the application" error. The .csproj file it is referring to is in AppData\Local\temp\randomname\Applicationname.csproj but that file does not actually get created.
I know that when this error crops up with opening projects created in previous versions, it's usually a missing library that is used by that particular project but for the life of me, I cannot figure out what library I could be missing here as it is a new project.
I have VS 2013 Ultimate installed with all components.
Running on Windows 8.1.
First confirm it is not a add-on or a problem with Visual Studio itself.
Try and start Visual Studio from the command line with devenv.exe /resetskippkgs and also try disable any IDE extensions temporarily to see if one of them might be stepping on something. Do these two things first to see if the problem lies with VS IDE. Of course try creating a project after you have done these two things and see if you get the same results.
I never figured out what the actual problem was but I've installed Update 5 which was only released less than two weeks ago and it's working fine now.
I've hit an issue with some of the projects in our Visual Studio 2010 solution. When I build they are never up to date and always rebuild.
Using this post
http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx
I was able to figure out that some of my projects had headers listed which no longer existed. Removing these references fixed 5 of the projects.
But that leaves 13 which are always being built. The reason I get from the VS2010 log is
devenv.exe Information: 0 : Project 'C:\path\to\project.vcxproj' up to date check disabled because the LastBuildState and/or LastBuildUnsuccessful properties are not set.
When I search google I'm getting hits for this message. But no solutions.
Does anyone know whats going on?
All these projects are NMake based. Kinda suspect that may be the root cause. Do NMake projects set these properties?
A very similar question is answered here
I had to delete all .tlog files from my output.
For years now, across multiple versions of Visual Studio, there has been a bug with the Publish Web command (the one you get when you right-click on a web app and click Publish).
Very intermittently (about 10% of the time), some files that have changed will not be deployed if they already exist in the output directory. This is highly disturbing behaviour as you can never be confident that all your changed files have been copied to the destination correctly. The only workaround I know is to totally clear out the destination directory but this is a big hassle.
Does anyone else experience this issue? What could be the cause? Are there any known workarounds?
I have run into this too. And yes, it is disturbing. Especially since we seem to have to wait 2 years for any Visual Studio updates.
The only workaround I found was to check up some of my changed ASPX files, and verify that they changed, and if not, I select the Delete all files option in Publish to force a complete rebuild (slow and tedious).
I started a new project this morning and, after putting ~3 hours of work into it, I tried to open a file from another project to get some code from it. I got a warning about discarding an unsaved object. After telling it to go ahead, I realized that it was referring to the project I had just been working on and not another file that I had just opened.
Even though I never saved the project, the various files containing my code and dataset had to exist on the hard-drive. Are they still there, perhaps in a temp folder? I'm developing on a box running Server 2008 R2 (don't ask, not my decision :) ).
This may help:
http://blogs.msdn.com/b/saraford/archive/2008/02/14/did-you-know-where-visual-studio-saves-auto-recovered-files-in-the-case-of-an-unexpected-shutdown-151.aspx
Also check C:\Users{Username}\AppData\Local\Temporary Projects
You could try one of those undelete programs and see if it finds anything.
Tools > Options > Projects and Solutions
and check the item
Save new projects when created
Save frequently. :)
Need to give one related input. Who the hell had the idea to implement this feature???
I used Visual Studio until 2003, then came back again to 2010 now.
After 2 days work, saving all the time, as I used to (Ctrl + S), I close the project and decide not to save the solution itself.
Done. All lost. Nothing can be recovered from anywhere in the computer.
How can a developer implement a dumb idea such as dropping all work in an "in memory" project.
You either know about it already or you will get screwed; like thousands found on Google during my desperate search.
Did Microsoft VS team look at it at least?
So frustrating...
It might be worth checking out the folder where AutoRecover files are saved.
You can find the default file location in Visual Studio on the Tools - Options menu. Look in the Projects and Solutions section - expand that and look in General to find the default file locations.
My files were under C:\My Documents\Visual Studio 2008\Backup Files.
I had this happen to me this morning. I worked on a new project yesterday and windows ran an update last night. Despite having debugged my program - the project had not saved - for some reason it didn't occur to me that the project might not be saved. I left the program running on my computer when I went to bed. This morning when I work up, I saw that windows had run an update. A few hours later, I saw that my computer had no trace of my program. I realize this is an old post, but I thought I would shed some light on what I did, since i was able to recover my files.
First I went here: http://windows.microsoft.com/en-us/windows7/recover-lost-or-deleted-files
In Visual Basic 2010 Express, a backup folder is created with your project name. Sure enough, my project backckup folder was there: Documents\Visual Studio 2010\Backup Files\MyProject. But, the folder was empty. I "restored this folder to a previous version" using the steps listed in the link above. After doing that, the folder was still empty, BUT, the temporary folder "C:\Users{Username}\AppData\Local\Temporary Projects" now contained my project's folder and files. Prior to running the "restore to previous version", the temporary projects folder was also empty.
So, I was able to copy the folder out of the Temporary Projects folder and I am as happy as one can be - or close to it.
Hope that helps someone out.
A note to the answers above, I had a mini jumpscare when i could not find my project anywhere, not in the recent projects nor in the visual studio projects folder.
I eventually found the project in the visual studio projects folder of the admin user;
I was looking at:
C:\Users\LocalUser\Documents\Visual Studio 2015\Projects
Whilst the project was saved under:
C:\Users\LocalAdmin\Documents\Visual Studio 2015\Projects
Bottom line is; also check the \documents of the admin user. This likely happend because i was testing an admin only application and visual studio was running with the admin's user profile loaded.