Visual Studio database project no longer deploys on build actions - visual-studio

I recently had a PC failure and reinstalled the Windows OS and all my development software. After re-installation, my Visual Studio 2012 Database Projects seems to work differently and I cannot figure it out. My database projects no longer "automatically deploys" to the LocalDB when I press F5 or CTRL+F5. I am using VS2012 Professional version with the default installation settings.
On my old installation, if I changed a column name in the project and pressed F5, the table in LocalDB would be updated immediately without any sort of publishing actions or anything. The Visual Studio output window would also indicate that changes are being applied. This "automatic deployment" is no longer happening, I have to resort to right clicking on the project & clicking publish, which works, but is inconvenient.
What can I do to re-enable this "auto deployment" feature?
So far, I tried:
I looked thru every database related setting in Tools > Options.
I confirmed the Configuration Manager is set to both "Build" and "Deploy" for my database projects.
I confirmed that the LocalDB is installed and working.
I applied all Windows updates & updated VS2012 to the latest version, 2012v4.
I tried all combinations of Clean, Build and Rebuild at the project & solution level.
I checked "Always Re-create Database", and even this doesn't work.
I suspect that this feature might be dependent upon other software or patches that I had on my old installation.

I figured this one out myself.
There is an option that controls how dependent projects are built under the "Projects and Solutions > Build and Run" section. I overlooked this option at first, but eventually came back around to it when I was testing each setting one at a time.
The description of the check box might be incomplete or perhaps I'm just misunderstanding it. This setting appears that it does not affect the build action of the database project, but it does affect the deploy action. When this is checked, my database project, which is not the startup project builds but does not deploy on Run/Debug. When this is unchecked, my database project builds and deploys as I expect with no additional steps required.

I found two alternatives from the accepted answer:
Right-click the solution, select "Startup Project", "Multiple startup projects", and make the database project one of them.
Right-click the solution, select "Project Dependencies", and make the database project a dependency on one of the other projects that will be built.

Related

Build process template always empty - VS2012 & MS TFS repository

I'm trying to define a new build on TFS using VS2012. When I go to New Build Definition -> Processes I'm seeing "Build process template" and an empty drop down.
I click on the "New..." button selects the default template from
$/<My Project Name>/BuildProcessTemplates/DefaultTemplate.11.1.xaml
and click OK but then I'm getting the error:
TF277000: A build process template for '$/<My Project Name>/BuildProcessTemplates/DefaultTemplate.11.1.xaml' already exists for team project <Project Name>. You cannot create another build process template for the same file. Use the existing one instead.
the drop down always stay empty. I tried to clean cache(AppData\Local\Microsoft\Team Foundation\4.0) and other sort brilliant tricks like close and open but nothing helped - the drop down stays empty.
I would really appreciate aמy help.
I had a similar issue crop up recently.
Background: TFS 2012 Project with multiple solutions under 1 Project Collection project. The 'BuildProcessTemplates' folder did exist in the Project collection project and did contain the standard templates. The solution was created in TFS 2012 and being coded using VS 2012 ultimate.
Symptoms: Any attempts to create a Build Definition failed due to a lack of Templates.
Actions - unsuccessful: I created a copy of the default template and used that for a template. I wasn't able to create a Build Definition since even with that, the dropdown was still empty. Also tried creating a custom template with the same lack of success.
Actions - successful: I separated the solutions into their own Project Collections projects. That put the solution at the same level as the 'BuildProcessTemplates' folder. Once that was accomplished, I was able to create a Build Definition for those solutions.
Comments: I'm not sure if this is a bug in TFS 2012 or not. I would like to think if it is a bug in TFS 2012, it is corrected in TFS 2013.
Your thoughts?
Robert
I recently ran into the same problem with not being able to see build process templates when trying to add a new build definition. We are in TFS 2012. This team project also appeared not to have any build definitions. That was expected though because we had not yet used the TFS builds on this team project.
The problem was caused by someone with admin rights setting the "View build definition" and the "View Builds" access rights to Deny for everyone.
By just setting that back to allow on the TFS group, we suddenly could see the build definitions and also were able to select build process templates.
It was really strange that it let us add new build process templates, but we couldn't select them.

Build->Deploy doesn't work for database projects

I have a database project in Visual Studio 2012. When selecting "Deploy MyDBProj" on the Build menu nothing happens.
When I hit F5 to debug however, the database project is deployed, using the settings in the debug section of the database project properties. This is enabled in by checking the "deploy" checkbox in the solution's configuration manager.
I would like to be able to do a deploy, without starting a debug session. How do I do that?
Note: This is not publishing, which is something else. I want to know how to manually initiate the deploy that is part of the build process. Since the deploy is already done automatically it should be possible to initiate it manually too.
I got an answer from Microsoft at MS Connect:
There was a bug in the version of SSDT that shipped in Visual Studio
2012 in wuich the Deploy menu command appears but is a no-op. This has
since been fixed and is available in the latest version of SSDT:
http://msdn.microsoft.com/en-us/data/hh297027
The only way I can think of doing it (though I haven't tested it) would be to use the command line to do it as outlined at http://msdn.microsoft.com/en-us/library/dd193258(v=vs.100).aspx.
Though once you have your manifest, you can run:
VSDBCMD /a:Deploy /dd:+ /manifest:manifestFileName.dbmanifest
from a command line to deploy your database.
The manifest will contain your target database name, connection string, and so on but you can also specify those as part of the command line instead.

Visual Studio 2010 F5 Debugging C++ is not Rebuilding

I have a Visual Studio 2010 Ultimate C++ project (not managed or .NET). When I press F5 (i.e., start debugging), I want it to save all the files, rebuild those that changed, link the whole thing, and then run. Instead, it appears to use the last build. Thus, when I try to step into a function or something, I get the following error:
Based on my research, I have verified these options, the first three of which are in the Options dialog (can be reached under "Debug->Options and Settings"):
"Projects and Solutions->Build and Run->Only build startup projects and dependencies on Run" is checked. Some research indicated that it should be unchecked, but in my case I actually do only want it to rebuild the startup project. For what it's worth, I've tried unchecking it, with no effect.
"Projects and Solutions->Build and Run->On Run, when projects are out of date:" is set to "Always build".
"Debugging->Edit and Continue->Enable Edit and Continue" is checked, though it's greyed out.
In the Configuration Manager ("Build->Configuration Manager"), all solution configurations and platforms have their "Build" checkbox checked.
I have also tried deleting all Debug and Release directories as well as the .sdf and ipch directory.
For completeness, I suppose I should mention that I'm using precompiled headers, though I kinda doubt it matters.
[EDIT: I should note that it only seems to be one file (a .h file) that's doing it. I tried renaming it and recompiling, and also removing it from the solution and adding it back in, but it didn't work. ]
I was able to bring my solution back into the right state after deleting all .suo and .csproj.user files. Answer led to this solution. Hope this saves someone time.
I fell into this state after installing Ultimate over Professional and running profiling tools.
Once I had similar problem with my C# project and I think I have tried every possible suggestion available on internet but none worked and then this is what I have done:
Created an empty Project
Added startup function to verify that it does not show any error
Imported all my source code manually one by one
So, Yes, it was the solution. You already have done a lot so I would say you can get lucky by trying here and there however having a new project and importing your individual source file would be faster.
Another solution could be that switching the platform. I noticed that when I when to project properties, the new project I had just created had a platform of 'win32' and my other projects in the same solution had it set at x64. After I switched my project to x64, everything worked just fine. This worked for my interop(C,C+, C#) project and hopefully works for other projects as well.
I have successfully resolved it, try the following:
remove all temporary and intellisense files
remove all project from solution and then add them back(most important)
check projects 'Frameworks and References' to ensure they are valid

Disabling the *.vshost.exe and miscellaneous files from being created on build

I found the following information about the Microsoft Visual Studio "extra" files:
What is the purpose of the vshost.exe file?
My question is, is there a way that I can NOT have the .pdb, .manifest and vshost.exe files from being made? Or are they absolutely necessary?
I just noticed that after debugging it, it's still showing up as a running process in my machine which worries me since I already closed it.
Switch to the Release configuration. Then Project + Properties, Debug tab, untick the "Enable the Visual Studio hosting process" option. Build + Clean, you can delete anything that's left and it won't come back. That this option is turned on by default for the Release build is, arguably, a bit of a flaw but defensible.
The hosting process is a custom hosted version of the CLR. Exactly what it does is not well documented but it is related to configuring the security settings of the primary AppDomain. I've never heard anybody complain about battling CAS problems without it, but then it is unusual to turn it off and your app almost always runs in full trust when debugging from the IDE. It would matter if you build to a network share on early versions of .NET. The only thing that's obvious from disabling it is that anything you write with Console.Write in a gui style app will no longer appear in the Output window. It has nothing to do with speed as claimed in the highly upvoted answer in the link, the core framework DLLs are already resident in RAM since VS and MSBuild uses them.
Best thing to do is just not worry about it too much. A Setup and Deployment project will ignore it.
Regarding vshost files, at least in VS2010:
They are not generated on build, but on selection of build configuration (it will be generated in release when we select release for the first time) and on setting "Enable the Visual Studio hosting process" to true. (As configuration debug and this option set to true are defaults, vshost.exe will be created in bin/debug on opening VS with target project by default.)
They are not cleaned on rebuilding or cleaning the project, but only manually when "Enable the Visual Studio hosting process" is false if VS with that project is open. (And it won't be generated anymore when opening this project.)
If this flag option is true and VS with target project is opened, this file cannot be deleted as being used. Once when it is unchecked, vshost.exe can be immediately deleted.
Summary: Generating and removing these files is not related to build process.
Also, I may add that option "Enable the Visual Studio hosting process" in referenced projects which are class libraries is not considered. This option is only considered for target project which generates executable file.

the application for project is not installed

I'm opening a solution that was apparently built on Visual Studio 2003 (not sure, I don't know anything about it) and trying to migrate to 2010. When trying to migrate I get the message:
the application for project '' is not installed make sure the application for the project type (.csproj) is installed.
If I open each one of the single projects of the solution they migrate fine but not the solution itself.
Right-click on the project file, then "Reload"
If your solution opens, but your project is showing as "incompatible", it may need to just reload. This worked for me when running an update from VS, and it did not recognize my njsproj
I know this is an old question, but it is still occurring in VS 2013.
I had an old VS 2003 web application. I opened it in VS 2013 (Ultimate) and had the error message:
Could not find the server on the local machine.
Creating a virtual directory is only supported on the local IIS server
along with
The application for project is not installed.
Yes, I am upgrading, and yes, I don't have some other elements ready. Giving me errors is fine - but why are you not completing the migration/load of the project. I can't fix the other issues if you don't LOAD ANYTHING! You loaded the subprojects, and then you told me that I should choose a later .NET Framework. Great, I did that. So why didn't you just finish loading the main project and let me fix the errors?
Lots of attempts to fix this failed. My final solution, just to get the project loaded was {arrow pierces chest, dies with Arghhhhhh on his lips}...
I located the {project}.csproj file. I found the <Reference> sections. The paths to the .NET Framework components were no longer valid and referred to old versions no longer installed (yeah, upgrading, remember?). I manually changed the paths to refer to .NET Framework 4.5 components. The project still didn't load.
Then I located the {project}.csproj.webinfo file. It referred to http://localhost/{stuff}/{project}.csproj, so I just set it to {project}.csproj. No luck. Then I just renamed the webinfo file to hide it. Eureka, the project was hot!
The project loaded, I got the "You have completed the first step in converting your Visual Studio .NET 2003 web project. To complete the conversion, please select your project in the Solution Explorer and choose the 'Convert to Web Application' context menu item." Which, of course, is not present, but is present as the very last item in the Project menu. Then I got the "This action will add designer and code behind files required for converting Web site projects to Web application projects. Do you want to continue?" You bet your posterior I want to continue! And now I have a project I can actually start to fix. Thanks, Microsoft, for the informative error messages.
If your projects individually migrate fine, then create a new blank visual studio 2010 solution, and add new projects individually (right click on solution->add->existing project)
But I'm not sure that your projects will load fine individually. There are project types that require some additional software to be installed in order to be supported. The most frequent problems I face are old projects built with old versions of asp.net mvc (1 or 2) and I have asp.net mvc 3 installed...or really old projects built with asp.net ajax...In those cases, you have to install that additional software and then import project, or find a tool to upgrade that project type to a newer version.
I found a solution that worked for Visual Studio 2017.
In Visual Studio, go to Tools > Extensions and updates. At the upper-right search box, search for "integration". It should come up with Analysis or Diagnostic Tools (or similar). Click Disable, then Enable. Exit the dialog, and close Visual Studio. Relaunch and open your solution again. Your projects will still complain they can't be loaded because of incompatibilities, but now you can right-click them individually and select "Reload Project" and they should load fine.
Credit goes to Paul Potter and Paul Shaughnessy at https://developercommunity.visualstudio.com/content/problem/216061/project-incompatible-application-not-installed.html - I just did the verification work, condensing the information, and delivery :)
Adding this answer as reference for people who landed here for missing ".smproj" file.
This issue can arise due to various project files missing. For me, it was because of ".smproj" file missing which is Project file for SQL Server Analysis Services(SSAS). I re-installed SQL Server Data Tools (SSDT) and restarted the Visual studio.
Originally Answered here
Sometimes the SSIS or SSAS Extension in "Manage Extension" is disabled in the settings and must be Enabled manually. And then restart Visual Studio
It happened to me as wel.
You usualy do really need only to reload project in the solution. But in some cases you maybe:
didn't install SQL Server Data Tools (SSDT) for VS
have to enable SQL Server Data Tools manualy in the Extensions
If you have both things settled then try to reload project again. This happened to me when I moved from VS2019 to VS2022 and extension was somehow disabled.
I am using visual studio 2019 and I was faced with this issue when I reopened my ASP.Net webform App in visual studio after modifying for install SSDT.
this problem happens when Visual studio packages will modify (Especially when SSDT will be installed).
To solve this problem you have to go to you project folder and looking for the folder that named '.vs', this folder is hidden.
Deleting these folder will solve the problem because after that when you will open your project with visual studio, it will create the folder again.
Adding this for those who face issues for SSRS projects in VS2017 from earlier version as this comes up in google search.
In Visual Studio, go to Tools > Extensions and updates. Download the below :
Microsoft Reporting Services Projects
Microsoft RDLC Report Designer
In SSIS 2017, t the upper-right search box, search Microsoft Integration Services Projects.
go to Tools > Extensions and updates.
Enable -"Microsoft Integration Services Projects"
This will help to resolve the issue re-launch the SSIS
For my case, I disabled this extension and turns out, it is needed.
Enabling it resolved my problem.
In VS2019 Before you try any of the above right click the solution and click "Resolve Errors" no kidding that made my tabular model solution being available again.
For me what worked was a variation of #vapcguy solution.
Go to #vapcguy link for Paul Potter and Paul Shaughnessy solution: https://developercommunity.visualstudio.com/content/problem/216061/project-incompatible-application-not-installed.html - I
Follow comment on Paul Potter's post by Albert Romeo
Integration Services Plugin was disabled(as explained before: Goto Tools > Extensions and updates > and search for integration/analysis/reporting and enable application
I had to enable integration services, then reload project. I don't know why since I've been using the same SSIS project several times a week for months.

Resources