Visual Studio Esproj - Debug only launching esproj - c#

I've a solution with 2 projects, .net7 api and a vue esproj
When I set the startup project as the .net 7 api, Visual Studio changes to the .esproj and launches it instead of the api.
Any ideas why is this happening?

There may be a project in the solution that depends on another project, and you set the startup project of the dependent project. This means that when you start a dependent project, Visual Studio automatically starts the dependent project as well.
Apparently you have some wrong settings in your user settings.
So the fix for this issue is to remove the user settings from the solution and run again.

Related

Unable to debug and publish Azure Function from Visual Studio 2017

I used to debug and publish my Azure Function Project using Visual Studio 2017.
However suddenly everything stopped working.
When i tried to debug the project i got the error "A project with an Output Type of Class Library cannot be started directly.".
When i tried to publish the project, the option to publish to Azure disappeared and i'm only offered to publish to a folder.
When trying to create a profile i can also only choose the Folder Profile type.
I saw a similar behavior once in a Web Project when the "Project Sdk" Attribute in the .csproj file was wrong but i doublechecked it with a newly created Azure Function Project and it was the same.
When i create a new function project, i can publish to Azure as i could before.
I'm using the following packages:
along with .NET Framework 4.7.1.
Also i'm referencing some other projects from my solution containing Business Logic.
I ended up creating a new function project, copying everything there and now it's working again as expected.
Does anybody know how this could happen and how to fix it without creating everything from scratch?
In my case I was able to fix it by ensuring the NuGet package for Azure Functions was referenced:
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.14" />
I just had this same thing happen to me. I added a new Azure Function project to an existing solution, and it wouldn't let me debug it. I added an additional Azure Function project just to test it, and it worked fine. Compared the .csproj files, they were both correct.
I restarted Visual Studio and I was able to debug both Function projects, though I don't know if that will always fix the problem.
I had the same problem. I went in to the Visual Studio Installer and (re?) installed the "Azure development" workload. That fixed it for me.
Azure Functions tooling for Visual Studio is not always as stable as one would wish - but it's getting better for every release.
I had a similar problem after updating to Visual Studio 2017 v15.3 and then again when updating to v15.5. Both problems disappeared after updating or reinstalling the Azure Functions plugin.
But if you already have opened (and saved) to solution with a non-working VS setup then VS seems to 'destroy' the project sometimes.
You could look in your non-working project to see if your .csproj-file(s) contain:
<ProjectGuid>{0EC16A67-C60A-4950-A533-07D8783C88B0}</ProjectGuid>
...which is the guid for Azure Functions projects.
If your ProjectGuid is different then you could try changing it to the above and it should(might?) work.
It could be because the wrong project is set as startup project. In the solution explorer, you'll notice that the startup project is in bold. If it is not the right project, try right clicking on the correct one and click Set as startup project.
Solved it for me.

setup project created in VS2017 15.3 no longer supported in VS2017 15.5?

Discovered to my horror, that after updating all my Visual Studio 2017 instances to version 15.5 (from version 15.3), none of the setup projects will load and I get a message saying they are not supported. I've tried several Desktop applications, all developed in VS2017 and these setup projects won't load.
Is there any workaround to this (without creating all new Setup projects - some are quite complex)?
Ah, the issue turned out to be that the Installer Projects extension was corrupted, so I renamed my setup project, then re-downloaded/re-installed the "Microsoft Visual Studio 2017 Installer Projects" extension, closed Visual Studio, renamed my Setup project to what it was, opened the solution again & added the Setup project back to the solution.
NOTE - the other PC running VS2017 never had the Installer Projects integrated w/VS in the first place (it was more for web development), the reason why they wouldn't open.
Worked like a charm!

Solution doesnt run/build/rebuild in Visual Studio

When trying to run Build / Rebuild in Visual Studio on a solution, nothing happens.
I can run the build from the command prompt using MSbuild.exe, and this gives me the output i would expect (Build succeeded) - But when trying to run it from visual studio, nothing happens. Theres no debug output or build output either.
The project is a MVC project, with some references to other projects.
I can create a new MVC project, and it runs just fine!
Any idea what might trigger this behavior?
Using Visual Studio 2015.
I Have tried the following:
Restarting VS
Comparing the solution file to a new solution file
Triggering build manually from MSBuild (OK)
Switching Debug / Release configuration
Building projects individually
Updated NuGet
Build Configuration is OK (Everything checked for Build)
That beeing said, the solution is inside a git repository, and the other person working on this project has entered at a later stage with Visual Studio 2013 - But i dont know if this has anything to do with the issue.
Go to your configuration Manager and make sure build checkbox is selected for your project.
other thing you can try is:
Go to tools > Options>> A window will pop up> Under Project and Solutions > select Build and Run
Make sure Before building is set to Save all changes
So what seemed to happen was that there was some kind of dependency on a separate git repository (bootstrap), in our private repo that i hadnt been getting access too - so instead of giving me an error about it it just silently failed.
Adding access to the repository to my account, suddenly made the project run again.
Try this:
Go to Tools -> Options -> Projects and Solutions -> Web Package Management
Under that UNCHECK option "$(VSINSTALLDIR)\Web\External".
After UNCHECKING the "$(VSINSTALLDIR)\Web\External" option, Restart Visual Studio and try to rebuild project.
Check whether any NuGet packages are missing, that was the problem with me. Go to
Tools -> NuGet Package Manager -> Package Manager Console
If any packages are missing, Visual Studio will show you a message and a "Restore" button to fix the problem. After that the application should build.

One or more project was not loaded properly

After copying the project to another laptop/ PC, when I want to open the solution, VS2010 shows the error "One or more project was not loaded properly". I have tried running visual studio in admin mode but that did not solve the problem.
This is usually a result of an inconsistency in your solution or projects. Open the solution file in an external editor (such as notepad) and check that the path it has to the projects is available and did not change. There shouldn't be any absolute paths in the solution file.
Maybe because the project from where you copied was configured with IIS configurations and you are trying to run the project in visual studio's default environment.
you have to right click on your project and set as a start up project after that you have run your project,
I seem to have found unloaded project, after noticing there's one missing by manually counting and comparing it to the number of projects the solution explorer reported. It was deep inside another folder in the solution explorer that I never used and assumed that had nothing worthwhile.
It's a familiar issue. Looks like the project you are trying to open was created in higher version than what you have. If the project is in MVC, make sure you have installed MVC OR Make sure you have appropriate version of .NET installed in your system.
I work with NopCommerce and a couple of times I downloaded new version and got same error message. It goes away once I install the dependencies.
Because you tagged it ASP.NET make sure you have all the ASP.NET components installed. Those are not part of .net framework but might be necessary in your project.

Visual Studio 2010 wants to start project as class library

sometimes i have problems with the debug.
I have a solution with some projects (1 WPF application, 1 console application and some libraries - the console application host some services and the wpf application is the client).
If i want debug the client (or the host) visual studio means it can not be started because it is a class library. But after some tries and restarts of Visual Studio i can debug one of the projects without problems!
Is there a solution for this problem?
Mfg
edit#1: i have already set a startup project. If i want to debug the client, the host will be the startup project. If i want to debug the host, the client will be the startup project.
When using Visual Studio 2010 (probably even before that ;)), you can specify multiple startup projects. Just right click on the solution, click Set Startup Projects and choose radio button item Multiple startup projects. You can now set the Action property to Start (with or without debugging) for all projects you like.
If you are just hitting debug and haven't set a default debug start project, then it will try and debug the current project, which may well be a class library.
Set the default project by right cliking on a project in SOlutions Explorer and Set As StartUp Project.

Categories