Visual studio start debugging pop up select json schema windows - visual-studio-2019

All.
When i open appsettings.json then start debug, VS will popup a window to select json schema.
I try to pick one in the drop-down list or set the schema in my appsettings.json like:
{
"$schema": "https://json.schemastore.org/appsettings",
"AppSetting": {...}
}
All of them Can't solve it.
Any idea ?
Thanks for reply,
First of all i'm using console app.
My project is a socket client connect to other server,so i set my server connection in the appsettings.json.
I need to test my code to connect with different servers,so i keep open appsettings.json.
And here's the most troubling part: when i start debug VS popup select json schema window and cover up my app window totally !
After i start VS in safe mode, didn't popup again, but i'm not sure the problem has been resolved.

So strange and we did not face such issue before. Try something like these:
1) disable any third party extensions under Extensions--> Manage Extensions-->Installed to check if there is an extension caused that.
2) try to reset vs settings under Tools->Import and Export Settings-->Reset vs settings, and you can also make a backup of your settings.
3) close VS, delete .vs hidden folder under the solution folder, bin and obj folder, then restart VS to test again.
4) use devenv /safemode under Developer Command Prompt for VS to start a pure VS to test it.
5) create a new project to test whether the issue happens again.
6) repair vs or update it if there is a new release version.
Besides, if those do not help, you should describe your issue in detail to share a small sample with us to help us troubleshoot it.

Related

Create new publish profile: "One or more errors occurred"

In a .NET project, select Build -> Publish -> and see the default "No profiles created, select a method" screen. Choose Folder and complete the wizard. Click Finish. Receive the following Microsoftian error:
"One or more errors occured"
With no other information.
Having already solved this, I'm posting to share the answer and publicly shame Microsoft for these lame error messages. Visual Studio is a program only used by developers: we can handle a little more information, and in fact need it to solve these minor, job-derailing errors in a timely way and hold onto some sanity while the rest of the program is locking up and spewing errors all day.
Navigate to [Your project's directory] -> Properties -> Publish Profiles and delete the contents (or move to another location if you might want these back later). Then, in VS, click Finish in the publish profile wizard again.
It didn't work for me with removing Properties.
On this link, Microsoft explains, that they have made a fix and advices instaling preview-version of Visual Studio 2019. Didn't work for me either.
I created a brand new MVC-project and tried to import publish profile, and it worked, so it looks like I have a problem in my original project.
Then I copied [Properties]>[PublishProfile] from new- to original project and th profile now works in original project.
After this copy, I then tried to make a new import in my original project, and that works too.
Not pretty at all, but I'm up and running again.

Is it possible to run a project from a solution in VS 2017 without it being assigned as the start project?

I have a MVC 5 solution in VS 2017 with 2 projects. Sometimes, when I'm working in one, I need to enter new information in the database using the other one. The only way I know of doing this is to stop debugging, assign the other project as the startup, run it, enter the info and then reverse the process again. Is there a way that I can access the project (which is light, not too complex) without stopping the current assigned startup project ?
Yes. Right click on the project and select Debug > Start New Instance from the menu
If you right click on the solution name in the solution explorer, there's an option for Set Startup Projects. You can then select what you want to start when you run the application.
It's also under the Project menu.

Why is TFS not updating my project?

We have an ASP.Net MVC Core project solution in TFS.
And there is an error icon at the top of the solution explorer that says "Package restore failed".
And if I open up the project.json I see the red sqigglies:
"The dependency ... could not be resolved" for several dependencies.
The developer who created this error has since fixed it. And all the other developers on the team get latest and the error goes away.
But it won't go away for me.
I get latest and the error icon at the top of the solution explorer and the errors within the project.json are still there.
I blew away the folder, got latest from Team Explorer, and the errors are still there while gone for the other errors.
Anyone know why this is happening?
I'm stumped. I don't understand what is happening.
First, you could try to do a force update for the specific error fixed changeset.
To force a update, use the "Get Specific Version" command with the
"Overwrite all... " option checked.
You could also clear TFS and VS cache, delete old workspace(back up changes first), create a new one, then do a fresh getting latest files from TFS source control. Which should do the trick.
If the issue still exist, you will have to check your local environment if you are missing some thing. Do a simply compare of the environment with other developers on the team.
It turns out this was a combination of the way .Net Core stores nugget packages and of being in a government environment.
We log into our computer with one account that does not have admin priveledges and this is the one I develop with in order to connect to TFS. But there seems to be a lock on the users folder for this account. So when I start up the solution and project.json tries to resolve all the packages, if one is missing it can't download it and put it in that folder. I then have to start Visual Studio as an Admin and open the project. Then the missing package is downloaded to the nugget package folder under my Admin user's folder. Then I read the resolution failure output at the top of the solution explorer next the the red circle with the X in it to see which package is missing and copy it over. It may be more than one so you have to close VS open back up as the non admin account and look for the next one that fails.

visual studio 2013 hangs on right click

After I install Visual Studio 2013 update 2, I notice that right click on any kind of project file (aspx, cshtml) causes about 45 seconds of hang in Visual Studio. It eventually opens context menu, but every single time this happens.
If I right click on Solution Explorer, Class View etc.. there is no issue at all, just in files editor.
I am using intel i7 processor and 16gb ram (hardware is not an issue) and Windows 8.1 Pro.
I also cannot connect tfs online for last 2 days so I am using my solution with disconnect from tfs. This causes hangs on start up because it tries to connect remote server. But I am not sure it will cause issue on right click of the files.
What I did up to this moment;
1- Installed last update again
2- Restarted Visual Studio several times
3- Restarted PC
4- Cleared TFS cache files
Is there any idea what is causing this issue?
Update: I created an empty MVC project without TFS binding and there is not issue. Looks like it is totally related to TFS dis-connectivity, I will investigate more and will post answer if find out.
ReSharper can cause this problem. You can suspend it (temporarily) to see if the problem is solved. If it is indeed solved, you should clear ReSharper's cache before you enable it again. Go to %LOCALAPPDATA%\JetBrains\ReSharper and delete the SolutionCaches folder for whatever version of ReSharper you are using.
I just had the same issue and in my case wasn't Resharper the culprit. What worked for me was, inside VS, right clicking the SOLUTION, open Nuget Package Manager and at the top was a message telling "There are missing packages". I clicked to restore them and immediately after that the problem was solved.
Just sharing as I had a different cause, so this may help some one else. My visual studio (2015) was locking up for 10-20 seconds on the right click context menu on the solution.
It turned out to be a faulty extension. Go to 'tools' > 'Extensions and updates', and try disabling all your extensions. If that solves it, try enabling a few at a time, until you narrow it down to a particular extension.
In my case, it happened to be the 'ImageOptimizer' extension, that comes part of Madz 'web extention pack': Github issue on 'ImageOptimizer'
Recently had this issue in Visual Studio 2015
For me it was because I had silently been disconnected from the TFS server
When you right click in a source-controlled file, part of the context menu consists of TFS commands (check out for edit, history, annotate). I presume that VS was spinning waiting for a TFS connection that would never come.
Getting reconnected to TFS solved the issue.

MIcrosoft Test Manager and Code Coverage

I have been using MTM for a time and, so far, so good. I am trying to get Code Coverage over the tests I am executing. I have set my controller with 2 machines: 1 webclient and 1 webserver. For the webserver rule, i have configured code coverage. Of couse the webserver machine is the one that has my application running on IIS.
When I fire my automated tests (that btw were not created using visual studio, it was created using Ranorex) I can see that its generated an .coverage file.
But when I open this file, it is empty and I get this message from Visual Studio:
Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see http://go.microsoft.com/fwlink/?LinkID=253731
Of course I have read
http://go.microsoft.com/fwlink/?LinkID=253731
http://msdn.microsoft.com/en-us/library/vstudio/hh698492.aspx
http://msdn.microsoft.com/library/jj159523.aspx
But I have found nothing wrong in my scenario.
Does anyone have any idea what could be happening?
Go and check if you find one of the following files in your solution: Local.testsettings or TraceAndTestImpact.testsettings and double click them in VS. A new window will open, there you need to select Data and Diagnostics. There you'll see a point Code Coverage, double click it and then select all the assemblies that you want to be code coveraged.
If that does not work, check if your PDB files are present next to your DLL files.
Well. It turned out to be a problem with the permissions of the user I was using to run the test agent on the web server.
After changing the user to another one who has more permissions everything worked fine.

Resources