 |
|
 |
First of all, thanks for the article. It's easy to follow - I was able to complete the project from scratch by just following your instruction in a couple of hours. While following this article, I've learned a couple of things.
1. How to debug and step through installer classes (http://weblogs.asp.net/joshrobinson/archive/2004/12/20/327381.aspx) - Without the blog, I might've had hard time to deal with errors in installation.
2. Some of parameters can be entered in installation instead of hard-coded.
|
|
|
|
 |
|
 |
when install, I had an error.
value cannot be null.parameter name:name
An exception occuredduring the commit phase of the installation.This exception will be ignored and installation continue.however,the application might not function correctly after installation is complete
---> Object reference not set to an instance of an object
please help me..thanks
|
|
|
|
 |
|
 |
I had same problem. String value of CustomActionData should not contain return characters although if you just copied from the web page to your visual studio, it will contain return char. Make sure you coped all value to the property. If you do, you shouldn't have any problem.
|
|
|
|
 |
|
 |
I used code your in my project. But when install, I had an error.
error 1001. an exception occurred during the commit phase of the installation. this exception will be ignored and installation will continue. however, the application might not function correctly after insallation is complete. Object reference not set to an instance of an object.
I using MS SQL Server 2005. I references Microsoft.SqlServer.Management.Common;
Microsoft.SqlServer.Management.Smo;
I tried to search. Can you help me? Thanks very much.
|
|
|
|
 |
|
 |
Go to custom action and
right click on custom action
put below string to CustomActoonData for commit
/TargetDir="[TARGETDIR]\" /databaseName="YourDBname" /filePath="[TARGETDIR]Yourbaskup.bak" /serverName=".\SQLEXPRESS" /userName="" /password="" /dataFilePath="[TARGETDIR]Database\\" /logFilePath="[TARGETDIR]Database\\"
|
|
|
|
 |
|
 |
Thanks for this article it's so benifit
but i stopped at the 6 step
i didn't know where i must type the next lines:
/TargetDir="[TARGETDIR]\" /databaseName="SampleDatabase" /filePath="[TARGETDIR]SampleDatabase.bak" /serverName=".\SQLEXPRESS"
/userName="" /password="" /dataFilePath="[TARGETDIR]Database\\" /logFilePath="[TARGETDIR]Database\\"
or repalce this parameters by my parameters
please help me
thanks in advance
|
|
|
|
 |
|
 |
Select the item in Commit folder of Custom Actions and right-click to show Property Window. You will see the CustomActionData property there.
|
|
|
|
 |
|
 |
I used code your in my project. But when install, I had an error.
error 1001. an exception occurred during the commit phase of the installation. this exception will be ignored and installation will continue. however, the application might not function correctly after insallation is complete. Object reference not set to an instance of an object.
I using MS SQL Server 2005. I references Microsoft.SqlServer.Management.Common;
Microsoft.SqlServer.Management.Smo;
I tried to search. Can you help me? Thanks very much.
|
|
|
|
 |
|
 |
Check that user used installation has Administrator rights, or try to install to another directory.
|
|
|
|
 |
|
 |
First of all, thanks for this nice and neat article. It simplifies everything really much.
But i have one problem:
So i attached my stuff to installer and tried to install. Everything is fine.
But when i try to open exe file it says login failed for user 'MyAdminUsername'.
What should we change to use windows authentication?
thanks
modified on Saturday, March 7, 2009 8:31 AM
|
|
|
|
 |
|
 |
Ok, when i attached the database i created it worked fine. But when i deleted the database from
the server and tried to install the database i get an error at the end of installation. It says that
Logical file "SampleDatabase" is not part of database 'SampleDatabase'. Use RESTORE FILELISTONLY to list the logical file names..
any ideas???
|
|
|
|
 |
|
 |
Try to remove all references to "SampleDatabase" from the server. Which type of authentication are you using? This solution tested only with using Windows Authorization.
|
|
|
|
 |
|
 |
Problem is here
sqlRestore.RelocateFiles.Add(new RelocateFile(databaseName, dataFileLocation)); sqlRestore.RelocateFiles.Add(new RelocateFile(databaseName + "_log", logFileLocation));
here databaseName means, name of the database specified in db backup file. But you are specifying the destination db name.
Change it to original db name, here the sample code to read db names from backup file
DataTable dtFileList = sqlRestore.ReadFileList(serverName);
string dbLogicalName = dtFileList.Rows[0][0].ToString();
string dbPhysicalName = dtFileList.Rows[0][1].ToString();
string logLogicalName = dtFileList.Rows[1][0].ToString();
string logPhysicalName = dtFileList.Rows[1][1].ToString
So change it to:
sqlRestore.RelocateFiles.Add(new RelocateFile(dbLogicalName, dataFileLocation));
sqlRestore.RelocateFiles.Add(new RelocateFile(logLogicalName, logFileLocation));
|
|
|
|
 |
|
 |
Your post proved extremely useful.
Thanks for sharing it with us.
read it
|
|
|
|
 |
|
 |
I tried to adapt the sample you gave for SQL 2008 Express. I had an error as below.
You use Version 9 for "Microsoft.SqlServer.Management.Common;" and "Microsoft.SqlServer.Management.Smo;" classes. But I have to use Version 10 for SQL 2008 Express.
What differences must I apply on the codes for this?
errror 1001. an exeption occurred during the commit phase of the installation.
this exception will be ignored and installation will continue. however, the application might not
function correctly after insallation is complete. --> failed to connect to server. --> this SQL Server version (10.0) is not supported
|
|
|
|
 |
|
 |
I only test it with SQL Server 2005. Try to add references to new version of Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Smo
|
|
|
|
 |
|
 |
I have use it in my setup project.
|
|
|
|
 |