Build scripts for C# project - written in C#? - c#

We've got a quite complex deployment scenario and want to make use of continuous deployment. Currently we've got a huge MSBuild script for everything, however, MSBuild is ok for building but not really suitable for deploying.
We'd love it if there would be some kind of C# project where we could write the deploy code directly with C#. Is there some C# scripting language which is suitable especially for deploying applications?

While it's not a C# project, you can use my company's product BuildMaster to handle deployments. It's designed to solve some of the problems you're already having, and some you probably don't realize you have (configuration file deployments, database schema updates, process automation, approvals, etc.)
However, if all you want is to write C# scripts for deployment, there's a tool called con-dep which looks like what you're describing.

Well, with Roslyn now I suppose that you can technically now use C# as a scripting language. I don't know if it would be terrible appropriate to do so...

Depending on your deployment solutions you might want to look into the NAntBuilder IDE. We used this for continuous ddeployment together with SVN server. If you have TFS why don't you just look into the details and many possibilities of Build Process templates?

You can use the .NET integrated C# compiler.
The advantage is that you can use the same DLLs/APIs in a C# 'script' as you do in your own software.
I use it in our production software. Our production engineers are able to write some small programs for special stuff.
See this answer for details.

You may want to look into using a tool that's specifically designed for handling deployments. If you're using Team Foundation Server, Team Build + InRelease provides a well-supported, well-documented way to handle your builds and deployments. Now that Microsoft owns InRelease, it'll be part of Team Foundation Server pretty soon.
If not, you can always write PowerShell scripts to handle your deployments. PowerShell isn't C#, but it's built on top of the .NET framework (so all the framework methods you're familiar with are still available), and the learning curve isn't very steep.

Related

Best way to creating setup of C# application

Hi i am recently working on a c# window form application. I have done the all stuff and noe it's time to deploy the application, But i am unable to activate the visual studio installshield feature. Can any one here able to tell me any alternet way to create me a setup file of my application. Like Innosetup compiler or other.
Visual Studio Setup Project is easy to work with and is available for both VS2013 and VS2015 in the form of Visual Studio Extension (separately from the default VS installer). Download figures suggest that a whole lot of people are using this extension.
I prefer to use InnoSetup, which is free for any use including commercial.
You can have a UI to make creation simple, but if you want really complex functionality you can write code to create those functions. There is a thriving community of developers that use and contribute to the product, so finding examples is usually easy, but you do have to write your code in Delphi / Pascal.
On the other hand, all the Microsoft options are overly complicated and difficult to get working sensibly so I am pleased to avoid them. Corporate installers are good but incredibly expensive... so really there is no comparison. Ease of use, and free - what more could you ask for?
I should point out that I have absolutely no connection with the product other than that I have used it for many years for many products and have absolutely no complaints.
That depends on your needs.
Mostly you can just create an msi installer with an installer project type on VS.
The problem is that a lot of software distributors require an exe file type. For that you can use the free (limited ) edition of install shield : http://learn.flexerasoftware.com/content/IS-EVAL-InstallShield-Limited-Edition-Visual-Studio
It has everything that a standard installer needs and I use it to distribute my software.
I tried other free msi to exe programs but none of them worked well (this was a while a go and maybe things changed since then)

Easiest way to Implement Scripting to WPF C# Visual Studio 2015

I'd like some help in how to add scripting support to a WPF C# project I'm doing on Visual Studio 2015. One of the things I'd like to do is to be able to change User Control properties within that script. I've being trying Roslyn C#, and I read some stuff about IronPython and PowerShell Tools. But, all that information is not really helping.
So, do you have a simple answer? Like, the easiest way to execute scripts in Visual Studio 2015 C# WPF Application, that are able to change properties of User Controls within the project?
Any help would be appreciated.
Thanks,
Lucas.
T4 templates can help but they are less extensible than lets say Roslyn.
I found a great post on how to easily implement IronPython and how to access User Controls within the scripts in Python, so you can there change different Control properties, and even create them! Here's the link:http://www.codeproject.com/Articles/602112/Scripting-NET-Applications-with-IronPython
I think it should be quite simple to embed powershell or F# interactive in an application and there are lots of examples when we search the web for this. The question is only are we comfortable writing scripts in Powershell and F#?
In my application I provide a C# editor and compile scripts as static methods (which I uses as functions) using the standard .Net compiler API's which are installed with the framework (Microsoft.Csharp, System.CodeDom). This generates a temporary dll and perhaps can not be properly termed a script. The implementation is straight forward and more or less what you expect - I have to provide a way for the users to specify references and namespaces, then generate a source file, compile it to an assembly and then call members of the static class. This above technique works well because the application has extension points that are well adapted to user defined code with a certain well defined structure (you might have similar well defined needs and perhaps full scripting is not necessary).
On the other hand, I am considering providing a "super user" console where the application can be driven by script, and in this case, I will use either Powershell or F-sharp interactive (I'm leaning towards F#). I don't think the implementation is particularly complex, but these are things that can easily bring the application down or corrupt application data if it is not well controlled - and it is unlikely that my users will profit from scripting as it is a programmer environment.

Selecting a Build Server

I'm planning to setup my own build server. I'm primary building C#, C/C++ and Java projects. I would also like my build server to run some external programs/scripts such as my unit tests, code static analysis and doxygen.
Suggestions?
Use Hudson Continuous-Integration software.
We're using JetBrains TeamCity. It's easy to configure, user friendly, has convenient plug-ins for notifications on build events, you can install multiple build workers, define any build engine (.net, java...), it can output artifacts, it can trigger automatically on check-in, it can execute any custom build script etc, etc... and most of all - it's free (for up to 20 configurations).
We've looked far and wide, and we found this to be the best...
Hardware: Discs. Quite some, or a decent SSD. A lot of the stuff you do will be disc based from the compiler side. Not talking about the get latest version (alone), but for example a c++ compiler generates QUITE a number of interim files in the build process. A decent fast subsystem can make a recognizable difference. Especially fi this is not for you but for some colleagues as well, sotit may run a lot concurrently.
Well, enough RAM and a modern multi core CPU go without saying.
I've used Trac and Bitten, which worked quite well. I used it for C# and Python projects.
I have it building, creating docs and running unit tests. Currently I'm investigating running dotCover for test coverage, which shouldn't be too difficult, because bitten basically allows you to call any shell command you need.
Actually, I usually run the build system on an old (not-so-fast) system - it doesn't need to be very quick for me. I like to have developers behind the fast machines ;-)

Embedded scripting engine in a .NET application

I am looking to replace an old control being used for scripting an application. The control used to be called SAX Basic, but is now called WinWrap. It provides us with two primary functions.
It's a scripting engine (VB)
It has a GUI for developing and debugging scripts that get run in the hosting application.
The first feature it provides is actually pretty easy to replace. There are so many great methods of running just about any kind of code at runtime that it's almost a non-issue. Just about any language targeting the .NET runtime will work for us. We've looked at running C#, PowerShell, VB.NET, IronPython, etc. I've also taken a brief look at Lua and F#, but honestly the language isn't the biggest barrier here.
Now, for the hard part that seems to keep getting me stuck. We want a code editor, and debugger. Something simple, not unlike PowerShell's ISE would be fine. Just as long as a file could be created, saved, debugged and executed.
I'm currently looking into Visual Studio 2010 Shell (Isolated) and I'm also looking at the feasibility of embedding PowerShell ISE in my application. Are there any other editors I could embed/use in my application? Purchasing a product is not out of the question. It comes down to a combination of ease of use, how well it meets our needs, and how simple deployment and licensing is for developers.
While I have not used this solution myself, I would recommend that you look into SharpDevelop (OSS .NET IDE) - it has text editor controls that have been embedded in other applications, for instance Kaxaml.

Best continuous integration setup for multi-platform development

What is the best continuous integration setup for a Devleopment department that codes in multiple environments?
At my company we write some code in C# and some in Java, I've previously used CC.Net but I've never done CInt with Java.
I'm aware of Continuum and was recently told about Hudson, but I've never used either.
Would it be better to use two CInt services one for each platform or to use a single one for both?
Why don't you try Team City from JetBrains? It is both for Java and C# and Professional version is free up to 20 user accounts and 3 build agents.
You could simply use the Java version of CruiseControl and have two setups.
As you already know how to use CC.Net and CC.NET can run any build task that outputs XML. Why not just use CC.NET with ant for your java code as well as your C# code.
Or do you need to build on none Windows machine? CC.NET may work with mono, I have not checked.
Remember that any continuous integration setup that compiles all your code and run your unit tests give you great benefits. On most projects having the perfect setup only give a smaller improvement over having a continuous integration setup that works. So I would just pick something you are happy with and start using it now.
Imho, its almost alway better to use one CI for all platforms you plan to deploy to - easier to sort out problems that way.
shameless plug: try Bamboo, the CI server from Atlassian. Its one click setup, built-in support for Ant and Maven and works on all platforms with JVM. It can also do distributed builds on different platforms.
It also integrates with Atlassian Jira Issues Tracker and Fisheye Code Repository Browser if you have those products.
Hudson. I've used it for both .NET and Java projects and it works well to have both platforms using the same continuous integration server.
Note this assumes you want to build the same code on multiple platforms. Hardware has gotten cheaper so use virtual machines or multiple physical servers I'd go with virtual machines and just buy one powerful server to run them on but if you have a lot of old mid range hardware that may be a cheaper option. Set up a main source control repository on one server, and set up servers with the client operating systems you want to build for. For example have a svn server containing your operating system of choice, a Linux server to do Linux builds and a Windows server to do Windows builds. Then just install what ever continuous integration software works best for the given code base and operating system.

Categories

Resources