Not only a Blazor issue, appears to be a problem with Visual Studio. But I thought I'd repost from previous answers as they are all several years old, and it still happens with Blazor apps.
The answer is to delete the projects 'bin' and/or 'obj' folders and rebuild, similar to the answer here.
Related
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.
I have really tried to find an answer to this.
All of sudden one of my projects are acting really strange. All references to local stuff in the same project are not resolved bu Visual Studio. All other references to .Net Framework and to my other assemblies works fine.
ps. I know platform is spelled with one t :D
And as i said it the title. I do not get any errors or anything when i build the project.
I think this has happened before. Not 100% sure how i fixed it then thou.
I shall also mention that it seems to work on my second machine with the exact same code.
I can't remember anything in particular that i did when i noticed it.
What i've tried
Restart both computer and VS.
Removed /obj and /bin folders
Tried to fix all warnings and stuff that Visual Studio.
So how does this "design time" resolving works? What files does it use? Is there any log or anything? Anyone have any good ideas on how to solve it?
I just unloaded, edited the .csproj file and it worked right away. Thanks Carcigenicate!
I have an odd scenario that I can't figure out, and would appreciate any advice offered.
I'm running VisualStudio 2010 pro.
I have a web application solution with 6 projects.
On one occasion I opened up some files from a number of backup solutions to look at some historic code. I viewed them and closed the files. I did this with my current project open.
I may have rebuilt the solution with them open but I'm not sure.
I recently did a 'find', searching the whole solution, and noticed that the files from the backups are referenced as being part of the solution.
How do I remove them?
I found the answer.
The solution was to publish the website rather than build it.
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'm very new to VS2010, so this is more a question about using Visual Studio 2010 than T4MVC.
Anyway, I wanted to remove T4MVC from my solution, so I deleted the two files from my root directory. However, when I rebuild and debug my solution, I still see compilation warnings associated with T4MVC.tt. What step am I missing here? Thanks in advance!
You need to make sure that you delete the two files from Visual Studio and not from the explorer (maybe that's what you;re doing already?). This way, it not only deletes t4mvc.tt, but also all the generated files that are under it.
That should be all it takes to remove T4MVC. If that doesn't do it, can you update your question with more details about the specific warnings you're seeing? Also, do you see this issue on a brand new project, or only on some more complex project?