Archive

Archive for the ‘Visual Studio’ Category

PHP time

July 16th, 2009 No comments

tutorial_debug_rest It’s been a long time since my last post cause I’ve been working in a e-shop project build on top of osCommerce. My background in php was very limited so i have to go “slow”. At first i used the very friendly (to php devs whatsoever) Rapid PHP, but it wasn’t fit my needs anymore so i “googled” for something like “php visual studio 2008” to see if there’s something new-on-the-block and easily come up with the vs.php.

Just what i was wanted! Debug, Code Highlighting just like in visual studio and the same friendly environment. To use the same environment that i use for several years now is VERY important to me because i use visual studio 8hours/day and it cut down the learning curve of a new dev environment.

That’s all for now, the links below may seem useful to you (sure been very useful to me)

VS.PHP Tutorials, Documentation, Forum

Install php on IIS

Categories: PHP, Programming, Visual Studio Tags:

Deploy the right app.config every time with build events

May 22nd, 2009 3 comments

It’s been a while since i have been “searching” build events but recently i made a mistake in creating setup for a customer by packing my own app.config so i have to do this all over again(poor me) so i decided to find a way to deploy the “right” app.config file every time.

Of course you can use many apps/procedures to do this and in large teams you can use servers just for this thing (along with unit testing and stuff of course …) but for a poor developer like me which comes from the all-time-classic-keeping-things-simple-DOS-age this is the most sufficient solution. Here it goes(i suppose you have a windows project with a app.config file ready)…

 

Create a app_deploy.config file in project directory

 

test1

 

then while app_deploy.config is selected go to properties (F4) and change the “Do not copy” property to “Copy if newer”

 

test2

 

after that right click on project and select “Properties”, select “Build Events” tab and push the “edit post-build” button

 

test3

 

finally you can write this script into the window (or you can write your own DOS-like scripts using the macros described there)

IF $(ConfigurationName) == Debug GOTO end
md c:\Build\TestProject
copy $(TargetPath) c:\Build\TestProject
copy $(TargetDir)app_deploy.config c:\Build\TestProject\$(ProjectName).exe.config
copy $(TargetDir)*.dll c:\Build\TestProject
:end

 

this line is checking that it isn’t debug mode

IF $(ConfigurationName) == Debug GOTO end

second line makes a build directory

md c:\Build\TestProject

the third line copies the .exe file to output directory

copy $(TargetPath) c:\Build\TestProject

the forth line deploy our configuration file and rename’s it to match the exe file

copy $(TargetDir)app_deploy.config c:\Build\TestProject\$(ProjectName).exe.config

the fifth line copies the necessary dll’s that application requires

copy $(TargetDir)*.dll c:\Build\TestProject

and the last is the “escape” line of the debug mode

 

after this you can build your project in any other mode than debug and then the “deployable” files in c:\Build\TestProject

 

Thank you for reading this and see you soon!!!

Categories: Build, Generic, Visual Studio Tags:

Build automatically all projects in path

May 8th, 2009 No comments

For a long time i was searching a tool that it would build all my projects when i get latest version from sourcesafe/svn without opening solutions one-by-one so i create one to fit my needs. It’s very simple get-things-done program, the whole class goes like this

        private void addProjectsToList()        {
desProjectsFound.Items.Clear();
foreach (string strFileTypes in desProjectTypes.Items)            {                foreach (string item in Directory.GetFiles(                    desPathToProjects.Text,                     string.Format("*.{0}", strFileTypes),                    SearchOption.AllDirectories))                {                    desProjectsFound.Items.Add(item, false);                }            }            desProjectsFound.Sorted = true;        }

        public static string GetVSExeLocation()        {            return string.Format("{0}\\devenv.exe",                 ConfigurationManager.AppSettings["DevEnvLocation"]);        }

        private void btnBuild_Click(object sender, EventArgs e)        {            ExecuteAction(" /Build");        }

        private void btnRebuild_Click(object sender, EventArgs e)        {            ExecuteAction(" /Rebuild");        }

        private void ExecuteAction(string action)        {            for (int i = 0; i < desProjectsFound.Items.Count; i++)            {                if (desProjectsFound.GetItemChecked(i))                {                    Process.Start(GetVSExeLocation(),                         desProjectsFound.Items[i] + action);                }            }

        }

As you will see in download i use Krypton Toolkit


By the default options this thing will build automatically all projects in path.

Below is the compiled version of the program, don’t forget to modify the VS path in the config file to match the destination of your visual studio installation

 

ProjectBuilder.zip (697,82 kb)

Hope this helps someone besides me!

Categories: C#, Programming, Visual Studio Tags: