How do I stop SQL Server 2008 R2 trying to install some package when I build my setup project?

一世执手 提交于 2019-12-21 03:37:22

问题


I have a WPF Linq-to-SQL project which I have been developing using MS Visual Studio 2008. I was running SQL Server 2008, and recently upgraded it to version R2. Now, whenever I build my SETUP project (not the app itself), the build process causes a window to launch:

SQL Server 2008 R2 Management Studio Please wait while Windows configures SQL Server 2008 R2 Management Studio

Which after a progress bar and some delay, complains: "The feature you are trying to use is on a network resource that is unavaiable." With an option to point to a source, and it is apparently trying to use c:\687b0370badbfcf47c\x86\setup\ , which doesn't exist.

If I click Cancel at that point, it says, "An installation package for the product SQL Server 2008 R2 Management Studio cannot be found. Try the installation again using a valid copy of the installation package 'sql_ssms.msi'."

I then get to watch the progress bar go backwards, and then it starts all over again. At this point, the setup build is waiting trying to build the MSI for my project. One time this resulted in Visual Studio crashing. Other times, I have been able to tell the progress bar window to cancel, and then my setup project builds fine.

So my questions are:

  • How do I get this to stop launching unwanted installer attempts when I try to build my setup?

and

  • Why is it doing this in the first place?

回答1:


The folder c:\687b0370badbfcf47c is what was created by the SQL install when you ran it - it creates a randomly named folder and then expands all its setup files into that folder. Whichever feature you are missing was merely installed as "advertised" instead of being installed fully, this means it doesn't get installed until you actually try to use the feature, which is what the publish functionality of VS is doing.

I can't guess exactly what is missing, but this is how to fix it.

  • uninstall your current instance of SQL (which will take 10 to 15 mins depending on the speed of your machine), then reinstall. Make sure you take the install option that allows you to choose which feature to install, then make sure you have selected the database engine, client connectivity tools, management tools (if available), and also Management Studio (if available - you might as well, managing the database without it is a PITA).

  • or you can start to install another instance from the same SQL installer package. Once you get to the initial setup screen, bring up file explorer and find the temp folder it has made and its expanded install files. Recreate the folder c:\687b0370badbfcf47c, and copy the expanded install files over to it. Then cancel the install you had in progress. Now build your setup again, the SQL install will kick in, but now it should complete and let you continue.




回答2:


When you build a Microsoft Visual Studio 2010 setup project a Microsoft SQL Server 2008 R2 setup might start. To solve this problem on a x64 system:

regsvr32.exe /u "C:\Program Files (x86)\Common Files\microsoft shared\MSI Tools\mergemod.dll" regsvr32.exe "C:\Program Files (x86)\Common Files\microsoft shared\MSI Tools\mergemod.dll"

on a x86 system

regsvr32.exe /u "C:\Program Files\Common Files\microsoft shared\MSI Tools\mergemod.dll" regsvr32.exe "C:\Program Files\Common Files\microsoft shared\MSI Tools\mergemod.dll"



来源:https://stackoverflow.com/questions/4040970/how-do-i-stop-sql-server-2008-r2-trying-to-install-some-package-when-i-build-my

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!