The rules of the calculation of build numbers are fairly simple. Normally a version number will look like this: AA.BB.CCDD.EEFF, where AA is the major version and BB is the minor version. These two are untouched: you have to set them yourself. The CCDD.EEFF part is modified automatically. CC will be used to represent the number of months elapsed since the starting of the project, and DD the number of days after those months. EE and FF will be the hours and minutes the build was created in that day. Therefore for example, if the project started on Jan 10, 2003 with version 1.0 and you run this macro on Mar 15, 2003 at 14:00, this is the build number that comes out of the calculation: 1.0.0205.1400. (I was told that this is the Microsoft's way of numbering the build.)
Basically the macro, once triggered, tries to open the file AssemblyInfo.cs from a path you specify, and locates the version string (something like this in C#: [assembly:AssemblyVersion("1.0.0220.1536")]) using regular expression. It then updates the old revision and build numbers based on some rules, and writes the file back. At the very end, an optional Build.BuildSolution command is called. If you want to update the build number every time a new build process is kicked off, run this macro instead of using the normal Build->Build Solution menu item.
Thursday, October 14, 2004
Wednesday, July 21, 2004
Adding icon to usercontrols [to display in toolbox]
I did find a way doing it manually, but I don't know if it's the correctway to do it ... but it works !1) Create your usercontrol / Component (e.g MyUserControl class) andmarkup the class with[ToolboxBitmap(typeof(Bitmap))] attribute2) Compile this class into a module (Yeha a module, could not get theassembly to work!!)csc /t:module MyUserControl.csThis will create a file called MyUserControl.netmodule3) Create a bitmap 16x16x16, with the fully qualified name of the classthat has the attribute. i.e. namespace.classname.bmpIn my case since the class does not live in a namespace I useMyUserControl.bmp4) Use the al.exe (Assembly Linker) tool to embed the resource.
Al MyUserControl.netmodule
/t:library /embed:MyUserControl.bmp/out:MyUserControl.dll
This step will create an assembly linking the MyUserControl.netmoduleand the embed resource file!5) Add this control to your toolbox !
Al MyUserControl.netmodule
/t:library /embed:MyUserControl.bmp/out:MyUserControl.dll
This step will create an assembly linking the MyUserControl.netmoduleand the embed resource file!5) Add this control to your toolbox !
Wednesday, July 07, 2004
Referring Global assembly from Add Reference dialog box
The typical way of adding references to .NET Components is to use the .NET Tab on the Add Reference
. Dialogue in your project.
VS.NET builds the complete list of available .NET Components by looking in certain directories. By default it looks in the install directory of the .NET Framework (%SystemRoot%\Microsoft.NET\Framework\vSomethingNumber). It will also look in any directory listed with in a certain registry key (see below).
When you are using a nonstandard GAC component, you might want Visual Studio .NET to list it in the Add Reference... dialog under the .NET tab, without having to browse for it.
Simply installing your assembly to the Global Assembly Cache (GAC) would not help in this scenario. The Add Reference dialog box is path based and does not enumerate the components from GAC.
Here is how to install, reference, and use a nonstandard GAC Component:
Create a directory where your nonstandard GAC components will be stored.
ex. C:\WINDOWS\Microsoft.NET\Framework\[FolderName]
Add a registry key like the one below pointing to where the assembly resides.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
\AssemblyFolders\[FolderName]
@="C:\\WINDOWS\\Microsoft.NET\\Framework\\[FolderName]"
Copy your Strongly Named component to this directory.
Install the component in the GAC (ex. gacutil /i MyComponent.dll)
The GACd component will now be available to add as a project reference in the Add Reference .NET Tab.
NOTE: Since you are referencing a GACd component, the Copy Local property will be set to False. Leave it AS IS. The component will be available in the server GAC when you deploy to the shared environment and should NOT be copied as part of the project.
VS.NET builds the complete list of available .NET Components by looking in certain directories. By default it looks in the install directory of the .NET Framework (%SystemRoot%\Microsoft.NET\Framework\vSomethingNumber). It will also look in any directory listed with in a certain registry key (see below).
When you are using a nonstandard GAC component, you might want Visual Studio .NET to list it in the Add Reference... dialog under the .NET tab, without having to browse for it.
Simply installing your assembly to the Global Assembly Cache (GAC) would not help in this scenario. The Add Reference dialog box is path based and does not enumerate the components from GAC.
Here is how to install, reference, and use a nonstandard GAC Component:
Create a directory where your nonstandard GAC components will be stored.
ex. C:\WINDOWS\Microsoft.NET\Framework\[FolderName]
Add a registry key like the one below pointing to where the assembly resides.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
\AssemblyFolders\[FolderName]
@="C:\\WINDOWS\\Microsoft.NET\\Framework\\[FolderName]"
Copy your Strongly Named component to this directory.
Install the component in the GAC (ex. gacutil /i MyComponent.dll)
The GACd component will now be available to add as a project reference in the Add Reference .NET Tab.
NOTE: Since you are referencing a GACd component, the Copy Local property will be set to False. Leave it AS IS. The component will be available in the server GAC when you deploy to the shared environment and should NOT be copied as part of the project.
Subscribe to:
Posts (Atom)