Debug not found - c#

I started editing a c# console app on my laptop in vs and pushed to a git repo. I cloned the repo to my desktop through visual studio and opened the solution, however when I try to run, it says the debug.exe cannot be found? I was under the impression solutions cloned from github should run?

Related

Sudden "Failed to load hostfxr.dll"

I'm working in a solution that has several .net core (as well as standard and framework) projects.
Up until this morning, when I debugged a .net core project it would launch fine. This morning, that broke. I get an error stating
The library hostfxr.dll was found , but loading it from XXX failed
When I build the project, and try running the EXE, the same thing
happens.
When I add a new project to the solution, it works fine.
When running the built debug version on another machine (with the
.net core SDKs), I get the same issue
When I change the project to
run in Release, it works fine.
When I change the project to run in Debug, and 32bit, it works fine
When I build the project via cli/dotnet build -c Debug, it works.
When I build the project via Visual Studio, in Debug, in 32bit it works.
When I build the project via Visual Studio, in Debug, in 64bit it doesn't work.
I've cleaned/rebuild the project.
I've restarted
I've updated my Visual Studio
I've removed and reinstalled the .net core SDK
Any suggestions on what happened and how I can fix it?
Im running Windows 10 and Visual Studio 2019
UPDATE
After performing my Windows updates overnight, it no longer works when I use dotnet build.
So it turns out that a clean/rebuild doesnt completely clean the solution.
After I deleted the obj and bin folders, and restarted VS, the problem was resolved.
In our case (with a build server on Windows Server 2019), it was a case of user rights.
The user that executed the build process (Jenkins), did have access to the folder where hostfxr.dll was located, but required to be an administrator on the build server.
Test the process running under the name of an admin, before re-installing frameworks or installing any Windows Updates.

"C# 2017 compiler could not be created" error message while opening project

I've Visual Studio 2017 community edition. I have a C# project created using Visual Studio 2015. When I try to open the project in VS 2017 I get an error message prompt:
--------------------- Microsoft Visual Studio
Project 'dataStructureInCSharp' could not be opened because the Visual C# 2017 compiler could not be created.
Please re-install Visual Studio.
--------------------------- OK
I'm trying to obtain help if anyone else has faced similar issue. I feel going the uninstall and then reinstall route is very costly for me and would try that option last if I've got no other resort.
What I've done so far :
Tried starting visual studio with administrative privileges
But problem remained same.
I tried creating a new console project solution from scratch but in that case I get very same error and an additional error error also shown below:
System Environment: Windows 7 Ultimate Service Pack 1
You can try to close all VS 2017 instances and delete the folder %localappdata%\Microsoft\VisualStudio\15.0_xxxx\ComponentModelCache, then open VS to create a new Console project.
Or
please re-run the VS 2017 installer as administrator, click the icon beside ‘Launch’ button and choose ‘Repair’ to repair as shown below:
Just to brief the history of my problem, I had first installed Visual Studio(VS) 2017 community when it was in RC stage. This was first time when I saw the workload based UI of visual studio installation. Initially I simply chose .Net desktop development workload to get started as I was interested in creating only console applications to get my hands dirty.
Initially it was all working well. One fine day I added all other workloads I was interested in namely Universal Windows Platform Development, Azure Development, ASP.NET and web development,Node.js development, and Mobile development with .Net. I'm not sure if there any of the specific workloads to be blamed for the issue I've posted.
Just to avoid the case if RC and RTM release builds might not have messed up my entire environment, I simply uninstalled the entire stuff, rebooted my machine and installed it again from scratch from latest RTM release for Visual Studio Community.
I would strongly recommend that you first try possible solutions suggested by #Sara-MSFT before doing clean reinstall just in case if it works. It can save you couple of hours required in whole reinstallation process if it works.

How to run asp.net project on localhost:xxxx without Visual studio?

I recently installed DevExpress on my machine, when running it's demos
I found that the it was able to run the project on http://localhost:xxxx.
My question is:
What DevExpress is doing behind the scenes to run a project on localhost without Visual studio?
I found this question, however it only clarifies how can the project "run" manually without Visual Studio. DevExpress is programmatically running the demo project without my manual help.
Any idea? Kind folks?
Consider running the below command
iisexpress /path:c:\myapp\ /port:9090

Program does not run after switching from VS2013 to VS2015

I have a solution which contains 5 C# projecst, 2 wix projects and a C project (2010). We have been developing this in VS2013 Ultimate and all has been fine. I've just tried opening the solution in VS2015, I have no errors, and no warnings. When I press the start button (F5), nothing happens. I don't even hit the first line of the Program.cs file. All it seems to do is build the project. Any ideas?
EDIT
The same project was open in both VS2013 and VS2015 at the same time as I was comparing config etc.
When I closed down VS2013, the program ran!
Not entirely sure why this occurred...
Yes the problem is indeed with running the same project in both Visual Studio 2013 and 2015 at the same time.
When you start the program, only the version of VS which was opened first will be able to run the program. This is because the first opened VS attaches the vshost.exe process to the project and denies any access to that exe, which is why the last opened version fails to attach its own vshost.exe. Thus it stops after building the solution.
The same project was open in both VS2013 and VS2015 at the same time as I was comparing config etc.
When I closed down VS2013, the program ran!
Not entirely sure why this occurred...

Git not publishing all files in a c# Project of VS2012

I'm new at using Git, and I have a problem while publishing a VS Project into GitHub.
Well, what I did was, first creating a GitHub account, then I installed Update 3 to VS 2012, and then installed Visual Studio Tools for Git so I can integrate Git with VS.
Then after that, I created a project in VS, it was a solution with 3 class libraries projects and one wpf project, everything in C#. After that I right clicked on my solution and chose commit, and then published it into a repository I created on my GitHub account.
It was supposedly published at GitHub, but when I decided to clone it locally to another computer, and after entering the project, it showed up a message saying that 2 projects of the solution couldn't been loaded.
Then I made another test, but instead of making it in C# I choose VB, I did the same steps, but this time it was published correctly into GitHub.
Why is it giving me problems only with C#?

Categories