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.
Related
In Visual Studio Code my Azure Function project periodically displays a popup asking me to 'restore' the project. It seems to update the libraries and/or connect them to my code. If I click the button restore usually functions to fix the errors.
One of my projects suggests performing a restore, however no popup. How do I manually trigger a restore?
dotnet restore.
Here's microsoft's documentation.
What this command does is to restore any dependencies: nuget packages, project references and tools for your project/solution, based upon your configuration and current directory (running in a directory with a .sln will restore anything referenced in the solution for example)
It's a prerequisite for all other compilation-related commands, such as build, test or publish.
Usually an IDE like Visual Studio will perform this in the background.
A VSCode extension on the other hand, depending on your settings, might always ask before.
I'm facing a problem where I need to build only one web project from a solution with two web projects in Visual Studio Online.
I have not found how to build only one project using a "Visual Studio Build" step.
It would be great if exist such a way to do this with "Visual Studio Build" step.
I also tried to use an "MSBuild" step. Unfortunately I got a problem when restoring the packages with Nuget. I got the error: ##[error]No file format header found, ##[error]Unexpected exit code 1 returned from tool NuGet.exe. Right after run: Nuget.exe restore Myproj.csproj.
Summarizing:
How can I build only one web project from a solution with multiple web projects in visual studio online build definition?
Update
Here is an image of the error when I'm building. Also i'm getting this using "Visual Studio Build" step or "MSBuild" step.
Also
I found a comment from chrisrpatterson in a VSO issue:
https://github.com/Microsoft/vso-agent-tasks/issues/571
Which he says: You can't run nuget restore against anything other than an SLN file. You should uncheck restore nuget packages on that vsbuild task.
But I need the packages, and I don't want to push my packages folder into my repo.
So, how can I restore the packages and run only one web project from my solution in "Visual Studio Build" step?
Instead of choosing the .sln file, you need to select the .proj file.
Firstly, click the ellipsis button next to the Solution field.
Then choose the .proj file you want to build. For example, the screenshot below shows that the build definition is configured to build the ClassLibrary1 project, instead of the whole solution (contains ClassLibrary1 and ClassLibrary4 project)
You can add a new "Azure App Service Deploy" task to your build definition and set the "Package or folder field" to "$(build.artifactstagingdirectory)**\YOURPROJECT.zip"
You may want to create a solution with just the web project that you want to build.
In visual studio you can create a new project, and in that dialog select "other project types\solution".
The new solution can sit right next to the existing one..
I'm using Visual Studio Community Edition 2013. When I select Run All in the Test Explorer, the latest changes I have done to the test code will not be included. I have to remember to right-click on my tests project and choose Build each time, and it is annoying.
How can I fix so that the build is always done automatically, like it is when running an ordinary project?
Solved it: for some reason the active solution configuration in the Configuration Manager (reached by right-clicking the solution in the Solution explorer) was set to not build all projects. I don't know how this came to be, but now it works at least.
I am getting this error when I try to open the solution file of my project. The solution is 2012 file (checked using notepad).
If I click on Ok, The solution opens up except for one csproject which does not load.
I get a migration report in UpgradeLog.htm file, with the following error for the project which failed to load. Could not figure out much from it.
Error:
The application which this project type is based on was not found.
Please try this link for further information:
http://go.microsoft.com/fwlink/?prd=12395&pver=11&sbp=ProjectTypeDeprecated&plcid=0x409&clcid=0x409&ar=MSDN&sar=ProjectCompatibility&o1=82b43b9b-a64c-4715-b499-d71e9ca2bd60
Does the upgrade report mean that it is a project from previous version of Visual studio? It does not open in Visual Studio 2010 either.
The error doesn't say that Visual Studio doesn't support .csproj files at all, it says it doesn't support a specific project type in that particular project file. This means this either isn't your project as you claim, or you are trying to build it on a different machine from the one used to create the project.
Visual Studio uses various elements in a .csproj file to determine its project type. See How do you tell the Visual Studio project type from an existing Visual Studio project and What is the significance of ProjectTypeGuids tag in the visual studio project file. It does this so it knows how to compile your project, what properties tabs to show, what context menu options should be available and so on.
Certain project types can cause this error. Usually they require some kind of SDK to be installed on the machine used to open or build the project.
You should search the web for the GUID mentioned in the error message you show (the value after o1=). You can also open the project file in a text editor and find the <ProjectTypeGuids> elements, which contains comma-separated project type GUIDs.
Then search the web for those GUIDs to find out which SDK or tool you need to install in order to be able to open or build the project.
If you paste the specific GUID from your error message in your favorite web search engine, you'll find Problem solved: Visual Studio / There is a missing project subtype. Subtype: '{82b43b9b-a64c-4715-b499-d71e9ca2bd60}' is unsupported by this installation., where it is mentioned you'll need to install the Visual Studio 2013 SDK. This means that in this case, your project is a Visual Studio 2013 extension.
This is what documentation is for. You should at least put a ReadMe.txt file in your project directory, explaining what the prerequisites for building a project are, especially when it won't open or build with Visual Studio out of the box.
I had this issue when I used Update 5 for VS 2013.
For me I had to click ok and read the next few steps, that popped up. I was initially clicking cancel.
On mine the project was missing Web Tools, so had to reinstall those and once done it was working.
Hope that helps someone.
This issue also appears when trying to import an ASP.Net project into Visual Studio 2015 Express for Desktop, and can be solved by simply downloading and installing Express 2015 for Web - or by using Visual Studio Community/Standard.
I am currently using VS 2017 v 15.7.4. This error came out of no where without any updates on my part. Usually when I have errors like this I just delete the .vs folder in my solution and that clears the problem. In this case that is what I did and the problem was fixed.
Close VS
Delete .vs folder
Load VS
Note: This was for a Xamarin based solution.
I solved this problem by downloading and installing (Microsoft Visual Studio Installer Projects). Close the project then install. After the installation, open your project then reload .csproj file
I had the same issue with VS 2017.
Eventually i solved it by just enable the SSIS in the following way:
1. In VS 2017 - Click on Extensions and Updates in the Tools menu.
Locate the Microsoft Integration Services Projects.
if you can't find it then you will have to install it first.
Click on the Enable button.
Close VS and start it again and SSIS projects are now available.
enter image description here
This (the error that states "Visual studio doesn't support specific csproj file") also occurs when the .vs folder is removed; however, closing and reopening Visual Studio will resolve the error.
I opened my WinRT (I'm using MVVMLight) project in Visual Studio 2013 this morning, and found out that all kind of types even system ones are not recognized saying Cannot resolve symbol 'bool' for example, note that the solution builds, executes and works all fine !
C# :
Even XAML :
I tried many things, closed and reopened the solution, cleared Resharper caches, I even restarted Visual Studio and the PC, but still the same problem, any solution to this problem ?
Update 1 : I tried to Suspend/Resume Resharper from Tools>Options and even delete files from AppData\Local\JetBrains\ReSharper\v8.0\SolutionCaches, and now Visual Studio causes errors too :
Update 2 : I uninstalled/re-installed visual studio, and I still have the same problems
If you have any Xamarin extensions for Visual Studio installed, it is a root of the problem. There are some compatibility problems.
As a possible workaround, you may try a workaround, mentioned in this ticket:
Select 'true' for 'Use msbuild to obtain project references' in
Project Properties (Click on project name in Solution Explorer | Hit
F4) for each project in the solution.
At least, it works for me.
If you can build the solution, but ReSharper marks your code in red - you can write the request here and you will likely get a help.
If you can't build your project then it is not ReSharper's problem. Then we need to find out why your build is broken.
It seems that your project to assembly references are broken.
To understand what's happening here with references during the build, go to Tools -> Options -> Projects and Solutions -> Build/Debug and set the verbosity to diagnostic. Then try to build your project and investigate the output windows in VS (or you can use MSBuild.exe from the command line instead). What you need to find in this large text block is "Resolve Assembly references" or "Expand SDK references" task. These tasks should obtain the valid paths to the assemblies your project depends on. Later on csc.exe should be executed with all these paths as parameters.
You can check whether the paths are correct, do they indicate to the existing binaries or not.
You can also create a new WinRT project template and check if it can build. If it cannot even for the clean project template then it is obviously a system problem, I suppose your platform sdk's are corrupted.
Hope this will help.