In the Part1 I had completed tasks of building the projects, and adding the references required. Now it is time to work on project property window.
Firstly let's copy the path of the task project. We can do so by activate the MyControlFlowTask project, then at the properties panel, find the path under Project Folder node and copy it.
Now open the Developer Command Prompt window for VS2012, and navigate to the project folder.
Now generate a key under the project folder by calling sn.exe. In my case, the full command is "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\sn.exe" -k MycontrolFlowTask.snk
After run the command, we have got the key to sign the project. However, we need to use this key to link the task project and task UI project. So we need to do now are:
- export the token of the public key
- sign both task project and task UI project by this key
Within the command window, input below command to output the key into public.out.
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\sn.exe" -p MycontrolFlowTask.snk public.out
Then we need to read the token from public.out, by using command
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\sn.exe" -t public.out
Now your command window probably will look like below
Good, we are close to the end of the project configuration. Now go back to the task project, open the project property window and navigate to the Signing section. Check the box Sign the assembly, expand the dropdown box and click <Browse...>. The Select File dialogue window should pop up.
Because we just generated the key under the task project folder, you should be able to find the key file immediately.
Now, remember we need to put the assemlbies into GAC, it is better to do some post build command to simplify our life, for example, uninstall the assembly if the assembly already exists, and then deploy the new assembly. Below screenshot should give you an idea what we can do by utilising Visual Studio post build event
So now we have finished general configuration of the task project. Follow the same steps to configure the task UI project:
- Sign the UI project by using the key file under the task project folder
- Add the post build command for "MyControlFlowTask_UI.dll"
Finally we can start our coding for the component, I will go through it in my next post :P.
No comments :
Post a Comment