Programmatically alter SSAS SSDT-BI (BIDS) project - c#

I am writing a C# application that needs to alter a SSAS cube project. The alterations are mainly adding dimension members and measures, but could potentially go beyond that.
I can use Analysis Management Objects (AMO) to add new dimensions, measures etc. after the project has been deployed, but I am looking for a way to do this in a dwproj project on disc.
I could go through the project XML files and alter them directly, but this could be a likely source of errors, and it would be extremely sensitive to product updates from Microsoft.
Alternatively, I could deploy the project to an SSAS server temporarely, do the alteration via AMO, and then regenerate the project from the server. Is there a way to generate a dwproj from a SSAS server database programmatically? (Not via the SSDT-BI project template).

I would highly recommend you use AMO against the deployed database on the server then create the SSDT-BI project as needed. I don't know of a way to create the project files programmatically.
You could of course build a Visual Studio add-in to add dimensions and measures to the project inside Visual Studio like BIDS Helper does (example feature source code here) but that is overkill in my opinion and you will spend half of your time on Visual Studio add-in plumbing not your core business need.

Related

How Can I Create a Setup File for multiple applications in Visual Studio?

I have a C# application and I have some applications like MySQL, MariaDB etc. that I use with my C# application.I want to make a SETUP file that contains my C# application's EXE file and other applications' (MySQL, MariaDB ..) setup files in one setup file.That setup file will install all of these applications with one setup file.
I have tried with Visual Studio Setup Wizard but I can't manage.Can I do that in Visual Studio?If I can, How can I do that?Should I download a visual studio extension?
You can create Setup by installing WIX tool and Install the Visual Studio extension and follow the WIX syntax
If you need to Include multiple EXE files in Setup you need to refer all the files that u needed in Setup.
If you need to install those setup then you need to create the custom action.
you can create a separate project for a custom action and added the references to the required binaries (ie the Binaries you previously mentioned in tags) and added the corresponding dll formed in the binary tag and called it via CustomAction
It's not clear if you've downloaded and installed the VS 2017 Installer Extension from here:
https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects
which lets you create Visual Studio installer projects (not the setup wizard). I suggest you search for tutorials on setup projects if you're totally unfamiliar with them, such as:
https://msdn.microsoft.com/en-us/library/cc766795.aspx
http://www.c-sharpcorner.com/UploadFile/1492b1/creating-an-msi-package-for-C-Sharp-windows-application-using-a-v/
https://www.red-gate.com/simple-talk/dotnet/visual-studio/getting-started-with-setup-projects/
In general you just drag and drop your files into (say) the Application Folder in the File System view; registry entries can be created using the Registry view. Prerequisites such as SQL runtime support. .NET runtime are added with the setup project's properties, choosing from the list of prerequisites.
This will give you a basic setup with little customization. There might be features you require that Visual Studio setups don't support, so something like WiX will give you a lot more functionality with a steeper learning curve if you've never created an MSI setup file before. I would search for a tool that fits your requirement, and this thread might help:
Best tool to create MSI

Visual Studio 2017: .rptproj vs .sqlproj

I have inherited a C# code base that started life in VS2013. We are now moving to VS2017 (from VS2015). The solution contains a number of .rptproj projects used to manage the database schemas. After installing MS Report Projects for VS I can now open the .rptproj projects in VS. However, if I create a new database project the file suffix is .sqlproj. As far as I can see these projects are the same, as they appear in the IDE at least, so I'm a little confused as to what the difference is? Is it purely a name change for some reason is is there more significance to this? I'm definitely missing something here.
.sqlproj files are for writing and deploying sql database objects (tables, views, stored procedures etc)
.rptproj files are for writing reporting services reports
They are different and both awesome :)

How can I manage my projects versions using Visual Studio 2012 Professional

I am working on developing an asp.net mvc web application , using visual studio 2012 professional. now when I want to update my project, for example by adding new features, I do the following steps:-
I copy the project folder.
past it inside a "versioning" folder.
work on the original project , were I add the new features and code.
now if I want to revert my project back before the new features, I can open the folder inside the "Versioning" folder. and so on...
now my current approach is some how sufficient.. but I am trying to find a more automated approach where I can for example revert certain file let say a certain .cs file to its previous version , or revert back my whole project to certain point.
so can anyone advice how Visual studio 2012 can help me in managing my versioning ?
Thanks in advance for any help.
Regards
You'll want to use a version control system like Team Foundation Server (TFS), Git, Mercurial, Subversion, etc. I personally recommend Git. Many of them have a means of integration with Visual Studio 2012 (for example, see How to Connect Visual Studio 2012 with git (github)?). Version control software supports features such as tracking file changes, creating code branches, merging code from different commits/users back together, etc.
Here's what a very simple workflow might look like with version control (see https://guides.github.com/introduction/flow/ for an example of the GitHub flow):
You're ready to add a new feature/start a new version. For simplicity we'll assume you're working on a single branch (e.g. Git "master" branch).
As you program, you make incremental changes to you source code and commit those changes regularly. Each commit gives you a snapshot of the work you've done and you can go back to any commit at any point and compare the changes between commits. The VCS you choose will influence how you synchronize those changes with a central/remote repository. You can even check revision history and look at previous versions of specific files and your code is typically backed up on another server for you without much additional work.
When you're ready to release, you could tag a specific revision (or merge features branches into master, or ... etc.). Whatever the case, you can keep track of all the cumulative changes you've made for each release and be able to revert back to any point.
There are a few other steps you may consider for versioning such as updating the assembly information. In the AssemblyInfo.cs file there is assembly metadata specifying the assembly version, file version (or informational version, which I prefer). See What is AssemblyInfo.cs used for?. You can configure Visual Studio to auto-increment the version numbers.
Team Foundation Server should be available by default with VS 2012, although I'm vague on the details of setting up a TFS server to host your repositories. Visual Studio added direct support for Git (open source, very popular) starting in VS 2013, however there is an extension available for 2012 (https://visualstudiogallery.msdn.microsoft.com/abafc7d6-dcaa-40f4-8a5e-d6724bdb980c). The extension allows you to perform some of the most used Git functions such as committing, branching, and pushing.
Here are some links to get you started:
Why should I use version control?
Using Git with Visual Studio
https://git-scm.com/download/win
https://tortoisegit.org/
https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx
I use VSTS and it is fantastic. You can use GIT or TFS version control. Both are hosted by Microsoft. I prefer Microsoft due to the idea of long term support and reliability. You can see they are supporting VS 2008 to current.
https://www.visualstudio.com/team-services/pricing/
It is also free for up to 5 users.
From the link posted below.
It has full support for many versions of Visual Studio
Q: Which versions of Visual Studio can I use with Visual Studio Team Services?
A: You can use:
Visual Studio "15"
Visual Studio 2015
Visual Studio 2013
Visual Studio 2012
Visual Studio 2010, requires Service Pack 1 and KB2662296
Visual Studio 2008 SP1, requires GDR update To connect to Team
Services with
Visual Studio 2008 through 2012
Start Visual Studio.
From the Team menu or Team Explorer, go to Connect to Team Foundation Server > Select Team Projects > Servers.
Add your Team Services account ({youraccount}.visualstudio.com).
Select your team project, and finish connecting.
If you get connection errors, try choosing HTTPS as your protocol.
https://www.visualstudio.com/en-us/docs/setup-admin/team-services/connect-to-visual-studio-team-services
GIT Vs TFS Version Control - https://www.visualstudio.com/en-us/docs/tfvc/comparison-git-tfvc
One thing to look into is how you visualize editing and checking in code. I personally find that TFS version control follows a very simple and linear model. I prefer it to git. But its really Apples vs Oranges and usually people like what they are used to. I will say that Git currently is in active development and is not as feature rich as TFS-VC. Not to mention VSTS hooks into their entire ecosystem of plugins, build systems, test infrastructure and all of their cloud platform "Azure"
If you dont need to be sharing your version controlled stuff, I like TurtleSVN. Its simple and I like the UI it has for displaying modifications between versions. It adds a choice on the right-click menu of any file or folder in windows explorer for "TurtleSVN" and then all of the operations can be handled from there.
My Suggestion is still using TFS - I my project which is a product ( ASP.MVC application ) - we are using following structure in TFS..
we have a main branch - DEV branch a QA branch and a SP branch. See screen shot attached)
Main Branch - Where all the code is merged using scripts - before we start with new version of development and then a new DEV branch with version is created from this main branch.. - so we have track of every version and new features added to each version... and For new client the code from Main branch is given.
Dev - Based on features added we create different folder for each new set of features / enhancements and put the version.
SP - After development is completed - the DEV branch is freeze and we create a new branch id SP and deploy the code for QA team - any defect founs are fixed in SP and deployed to QA - once testing is done the code is SP is freeze with QA approved and deployed to main and provided to Clients..
Finally using script - every thing from SP is merged in to Main.. and for new development - a new Branch in DEV is created from the Main..
This way we have track of enhancements / feature for each DEV phase and related SP is available and our product is getting developed in Main.
Hope this Helps..

Create Solution/Project programmatically without Visual Studio

I would like to create a Visual Studio Solution and a C# Project programmatically, but without a instance of Visual Studio installed on the machine.
Scenario
I am trying to build a "engine" that will read some metadata in a SQL database and transform them into a UI. The database will be maintained by another people with a Web or WCF interface and I want the Server Application frequently (by schedule or pressing a button) use this informations to create autommaticaly a new version of the software (create solution -> project -> build -> create deployment).
So, I searched about programmatically create Solution and I found only the Automation Model in VS, it's about use an Add-In Project and this don't serves for my propose.
Perhaps I was a little confused in my explanation, so ask me more especific details, so I can be more accurate :)
Thanks for help
I think generating the solution is a little extreme.
The solution file structure hasn't changed much since 2005 http://msdn.microsoft.com/en-us/library/bb165951(v=VS.80).aspx, and there are a few projects trying to automate their generation, like Premake https://bitbucket.org/premake.
However, the kind of scenario you describe, might be I believe (better?) adressed with t4 templates http://msdn.microsoft.com/en-us/library/vstudio/bb126445.aspx, or only project file generation.
What you are describing is possible to do in C# Windows app but tedious and difficult. I remember seeing VB6.0 app like that but here i would suggest you look into WPF. Still it's C# programming but WPF can load dynamically a "window" from a string or a file if you want.

Setup project and IIS

I am creating a new Setup project using Visual Studio 2010.
I have an existing application which has a few .aspx files along with few other directories. The application has lots of other non-ASP.Net files such as exes and dll's.
I am not quite sure whether I should create a "Web" setup project or create a simple setup project instead?
I am looking for some advice on this.
Any kind of inputs are appreciated!
Thanks.
Be aware that those project types were removed in VS2012. Assuming you want to invest in this technology at all, the "Web" setup project handles IIS configuration. The "Setup" project is just file copying.
My input would be to go directly to Windows Installer XML or InstallShield Limited Edition.

Categories