How to automate Dotfuscator in build - asp.net-mvc-2

I have to protect some dll in my mvc2 project in visual studio 2010. I'm using Dotfuscator and i want to automate it in build process. I refer the following article but I have no idea how to implement it. http://msdn.microsoft.com/en-us/library/hh977082(v=vs.107).aspx

We do this by creating a .proj file (MSBuild.exe) and call it directly using exec.
<Exec Command='"$(OBFU_HOME)\dotfuscator.exe" dotfuscator.xml'/>
<Exec Command='"$(SN_HOME)\sn.exe" -R filename.dll filename.snk'/>
OBFU_HOME & SN_HOME are set in the environment. Make sure you call sn.exe after as the dll needs to be re-signed.
Will this work for you? If not, then you need to put it in the post build event handler.

Related

Queuing a build using Powershell

I want to use a powershell script to queue a TFS build( prompting the user to enter the custom build defination) and wait until the build completes and check the status of that build and do a copy if it succeeds or exit if it fails. I would like to thank you in advance for taking time to answer my question
The simplest way is to use tfsbuild.exe command. This tool is located in Drive:\Program Files\Microsoft Visual Studio xx\Common7\IDE. More detail info to use start command: https://msdn.microsoft.com/en-us/library/ms181742(v=vs.100).aspx
You can also use a script using the APIs, How to queue another TFS (2012) Build from a TFS Build AND pass process parameters?
Which things your want to copy? In the build definition, you can specify a drop folder to copy your build outputs in it.

TFS - Run Powershell script against package before Deployment

I currently have a CI Setup in TFS 2013 which does the following
Pulls code down from Git on every commit to a branch
Builds the Solution
Runs N-Unit Tests Against the solution
Runs Jasmine Front-end Tests against the javascript
Deploys on success via WebDeploy to chosen server.
I have now managed to install Grunt and NodeJS on the server to do some manipulation of the Javascript between steps 5-6. Does anyone have any advice on how this might be done?
I've tried post-tests scripts to minify the javascript successfully on both the src and bin/_PublishedWebsites directory but this does not seem to persist over to the deployment server. And infact, the _PublishedWebsites route puts the build folder in an undeletable state due to maxmimum character limits on Windows files (argh).
You should switch over to using Release Management for Visual Studio 2013 (works with 2012 as well). This allows you to parameterize your release and push the same output through multiple environments. Very configurable and even makes sure that the tools you need end up on the server that you are deploying to. Supports Puppet, Chef, DSC, and create your own.
http://nakedalm.com/installing-release-management-server-tfs-2013/
And for an overview: http://nakedalm.com/building-release-pipeline-release-management-visual-studio-2013/
I managed to get this working with the addition of two extra steps to the pubxml file used for the deployment.
First, i added a dependency powershell script which ran NPM install and grunt tasks.
<PipelineDependsOn>
CustomBeforePublish;
$(PipelineDependsOn);
</PipelineDependsOn>
<Target Name="CustomBeforePublish">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -file Pre_Deploy_Javascript_Build.ps1 $(ProjectDir)"/>
</Target>
Following this. I had now created additional files which did not exist in the project. I had to now ensure that these were published. To do this, i added another step.
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
CopyMinJSFiles;
$(CopyAllFilesToSingleFolderForMsdeployDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn >
<Target Name="CopyMinJSFiles">
<ItemGroup>
<_MinJSFiles Include="$(ProjectDir)\App\*.js" />
<FilesForPackagingFromProject Include="%(_MinJSFiles.Identity)">
<DestinationRelativePath>App\%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>

Automatic installer deploy to remote server using TeamCity and MSBuild

I'm having a .net WPF project that compiles to a bunch of dlls. I also have another project that compiles all the dlls and creates an installator exe.
I am also using TeamCity to automatically do those tasks for me with a press of a button.
The problem is that I want to have a separate TeamCity build configuration intended to automatically copy the result installator exe to a number of remote machines, each having specific credentials. But, unfortunately, I don't get how do I do this.
I have found some articles on automatic deploying (like this http://www.troyhunt.com/2010/11/you-deploying-it-wrong-teamcity.html), but, obviously, they are very specific for web projects.
So, how should I correctly deploy my installator on build?
Your best bet is to research NAnt and make a simple task that will copy the TeamCity artifact (installer) out to the specified location.
All you would need to do is have TeamCity execute the specified NAnt task after the installer has been built.
http://nant.sourceforge.net/release/0.85/help/tasks/copy.html
Update
Also, check out this question for solutions on specifying the credentials for the copy task.
OK, I've found out that it's pretty easy to do this using the FtpUpload MSBuild community task. There, one can set up the credentials and all other stuff needed for uploading a file (or a set of files) via ftp.

TFS 2010: Copy _PublishedWebsites to test server

I've seen similar questions and answers but found them not really what I want.
I have a large solution with several web projects in it. All the web projects share some common code so they are all part of the same solution (there is a common project that is referenced by all of them).
I've been running on Team Foundation Server 2008 and we are upgrading to TFS 2010 to be ready for our move to visual studio 2010 and .net 4.0.
I've got the build working with a 2010 build by creating a new build because we only had one customization I'm trying to reproduce.
Once the build is done I have the files dumped at
\\SERVER\tfsdump\devel2010 build\devel2010 build_20101008.3\_PublishedWebsites
by using the dump folder option but the build location is
C:\Builds\1\Web Applications\devel2010 build\Binaries\_PublishedWebsites
All I want to do is after the build is finished I want to copy _PublishedWebsites\SiteA to \ServerA\ShareA
and copy _PublishedWebsites\SiteB to \ServerB\ShareB
Because there is only one build agent all I need is to call a batch file to run the copy but for easy of use for my developers I need this batch file to be called after every build. Is this possible or is there a better solution?
To make things harder the site is still a 2008 project and it is requested that it stays that way until we can fully test it under VS 2010.
Use a CopyDirectory build activity, set Source property equal to BuildDetail.DropLocation + "\_PublishedWebsites\SiteA" and set Destination property to your desired location. I have put this activity as the last activity in build process and it works properly.
Taking a cue from Afshar's answer, for people directly editing XAML template file, create a new sequence after copy to the Drop location is successful:
DisplayName="Something" Source="[BuildDetail.DropLocation + "_PublishedWebsites\SiteA " ]" />
The quotes inside should be written as &quot and semicolon.

How to automate a build for a Visual FoxPro project?

I'm interested in figuring out how to automate a build from Visual FoxPro similar to how we can build .NET projects from the command line using MSBuild.
It seems that it is possible to pass command line arguments to VFP.exe which may include the ability to specify some initial startup prg that runs however it is unclear how well starting up the IDE will work from non-interactive accounts such as the Network Service on Windows which is likely where an automated build would run.
Has anybody attempt this before or read about anybody attempting to script a VFP build like this? I would be grateful for any pointers that may lead me to a solution.
A simple solution is to create a program file that builds the application, and call VFP to execute that program. You can also add any pre or post build commands to that program file.
Create a VFP configuration text file, called BUILD.FPW
SCREEN=OFF
COMMAND=DO C:\Project\BUILD.PRG
Then create C:\Project\BUILD.PRG
Modify Project C:\Project\MyProject Nowait
_vfp.Projects.Item(1).Build("C:\Project\myapp.exe", 3, .f., .f.)
If file("C:\Project\myapp.err")
* Do something for build errors
Else
* No errors
Endif
Quit
Finally, to build it
C:\Program Files\Microsoft Visual FoxPro 9\vfp9.exe -CBUILD.FPW
VFP will build it non-interactively. It will log build errors to myapp.err. If it builds successfully, no error file is created.
Experience in Automate VFP Project
Build (FinalBuilder Route)
Automated Build