Thursday, February 21, 2013

How to add assembly/dll file in gac(Global assembly cache) on run time


Step 1
first of all make a dll file and give a strong name and write following code in assemblyInfo.cs

for giving strong name right click on project name in visual studio and go to property and now go in signing tab and choose snk name and write following code in "assemblyInfo.cs"
then press ctrl+s for save
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile(@"E:\ktp\ktp\ktp1.snk")]//path for strong name
[assembly: AssemblyKeyName("")]

 now rebulid application again

Step 2
now go to your new project and make a set up now right click on set up and go to view now further go to file system now right click on file system on target machine and add a global assembly cache folder
and now right click on global assembly cache folder and add assembly or dll that we want to add gac


Step3
now rebulid the set up and install set up that dll automatically added in "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\ktp(dll name) location.and we use that dll


By: Dalip Kumar

Wednesday, February 6, 2013

Resetting lost/ forgotten MySQL root password

Steps:
1. Stop the MySQL server process by going in "Services" .
2. Now open notepad & write the following
USE mysql;
UPDATE user SET password=PASSWORD('New password')    WHERE user='root';
FLUSH PRIVILEGES;
In place of 'new password' you can enter enter your new desired password.
3. Now save this notepad file by name of "mysql init.txt" and place it on desktop. 
4. Now open DOS window & enter the path where MySQL is installed ( which is C:/\Program Files by default)
5. Open dir file in  'C:\ Program Files\MySQL\MySQL Server 5.5\bin' and check wether 'my.ini' file is present there.
6. After this come out of bin folder & write the following command
bin\mysqld.exe --defaults-file="my.ini" --init-file="C:\\Users\Administrator\Desktop\mysql init.txt" --console
After this some messages are shown.
7. Now go to 'Services' and start the MySQL server.


8. After this you can work in MySQL by entering new password.