SSIS Connection manager - ssis-2012

I have created two projects with same connection manager names. Though the names are same, they point to two different environments.
I was assuming that if I add package from one project to other I should not face the connection manager related issues.
But I still get the error that connection manager "" not found.
Does this mean that even if I have same connection manager name, I still need to open each DFT and change the connection managers manually?
Regards,
K

I think understand what is being asked here.
Project 1
Project level connection we'll call "TestConnection"
SSIS Package we'll call "TestPackage1" is using project level connection "TestConnection"
Project 2
Again, Project level connection we'll call "TestConnection"
SSIS Package we'll call "TestPackage2" is using project level connection "TestConnection"
You move "TestPackage1" from Project 1 to Project 2 and now all data flow, execute sql task are complaining of missing connection manager.
You asked:
Does this mean that even if I have same connection manager name, I
still need to open each DFT and change the connection managers
manually?
Short answer.... Yes
Understand that behind the scenes with SSIS packages each object, data flow, execute sql task, sources, destinations, connection managers are assign a unique GUID. That unique GUID is used by each object when referencing each other within the project/solution they were created in.
So even if you move the package from one project to another and the connection manager was named the same, that connection manager would not have the same GUID from project to project.
You can see that when look at the code for the connection manager and looking at the code of the package.
From within Visual Studio:
with the package open click on View -> Code from the tool bar
Then right click on the connection manager in Solution Explorer and click on View Code
This will get you a view of the XML code. If I scroll down in my package code to one of the data flows you'll see the connectionManageID is referencing the GUID of the connection manager:
You could, and I have in the past when dealing with large packages, identity the GUID from the project you've copied the package to and GUID the package is referencing then do a find and replace in the code. Save, close all and reopen. I do caution against this
as you could easily, completely break the package if not done correctly. This would be completely at your own risk and I'd make sure you have backup copies of everything prior to even attempting it.
If your package isn't that big, just manually go update each of the tasks.

Related

TFS: How to delete a team project that failed during create?

When trying to create a project in TFS, the CreateProject activity fails. However, the job exists and any attempts to create a project with the same name will fail due to duplicates. Even though the system is treating these failed creations of projects as legitimite and existing items, they are not available for use. If you view the web portal or source control explorer in TFS, the projects are not in the list.
Now that the root issue (the one that caused the activities to fail) is fixed, I want to delete these so I can recreate them. Since the projects don't show up in the web client, I can't delete them, and the delete option in the management console isn't available for projects with a blank State. Furthermore, every time I attempt to "Rerun Job", it just tells me that I can't. There's no descriptor as to why I can't.
Is there a way I can manually remove these project entries from the source of data without damaging the rest of the system? Or are there supported means for overcoming such an obstacle?
You can use the TFSDeleteProject utility to destroy the project i.e. get rid of all the data remnants of deleted project.
https://learn.microsoft.com/en-us/vsts/tfs-server/command-line/tfsdeleteproject-cmd
PS: Please use it with caution as you can do quite a bit of damage if you are not careful.

Fix build vNext after collection move

I moved a team project collection to a new server. Everything is fine in Visual Studio and the web site, but the build is trying to retrieve source code form the old server.
In the build definition I see no place to set the collection URI. There is a System.TeamFoundationCollectionUri variable but it's read only, trying to set it in Variables causes an An item with the same key has already been added. error on build.
Trying to add a new mapping in Repository works so the (web/app) server is aware that the source code moved, but the old location seems to be left somewhere in the build definition.
Is there any way to fix that? Without re-creating all build definitions I mean.
There is nothing visible in the web interface, but you can see the server name in the TFS SQL database. The column Repository is a nvarchar(MAX) containing all the mappings and the server name.
I fixed the server name with a replace in SQL and it works now.

How can I bind my VS 2003 / XP Mode Project to the appropriate Server folders location with TFS?

Somehow my project got its source control bindings mixed up, and I'm trying to bind the local files to the correct place on the server. I am trying first to unbind the project, but when I then try to set up the binding anew and "Add Solution to Source Control", I get, "A project PDAClient.csdproj that you are attempting to add to source control cannot be added because the item AppSettings.cs is already under source control at the selected location"
It apparently only chose AppSettings.cs as the problem file to complain about because it is the first one in alphabetical order. I surmise this because I temporarily removed it from the project, tried again, and it complained about the next file in alpha order in the same way.
To try to outfox TFS, I renamed "MSSCCPRJ.SCC" to "MSSCCPRJ.SCCHide" and also renamed "PDAClient.vssscc" to "PDAClient.vsssccHide" but it simply created a fresh "PDAClient.vssscc"
(PDAClient is the name of the solution and the project)
If I try from VS 2003 File > Source Control > Change Source Control, I see this:
If I then select Bind for the solution, and then the eponymous project, I see:
If I hit "Browse" or the ellipsis button in the Server Binding column, it just "flashes" but opens no dialog for me to make the connection.
So the solution's binding is "invalid" but the project's binding is supposedly valid...
If I then select "OK" I get this:
...which looks promising ("Yes! Fix the bindings!") but selecting the "Fix" button simply takes me back to the Change Source Control dialog without having done anything. So I finally, reluctantly, select the other option, to "continue with the existing bindings" and see:
Okay...it tells me I have to check in a project for that to work, and I try to proceed, but see:
Note that it is trying to connect me to Handheld/Development/Development/HHS, but that's not what I want and need. DEV is a different branch; this is the Release branch. You can see that in the screamshot above in the solutions Path property (set to C:\Project\sscs\Handheld\Release (etc.)) not ...Development...(etc.) I compared the two using the built-in tool and saw that, indeed, the Server version was from the Dev branch (not the desired Release branch) and took the local version. But then I got:
As I then saw that some of the project's files were checked out, I was hoping against hope that perhaps it was now going to work. I tested it by making a change to a method name, but ended up seeing this, "An error or user cancellation occurred during checkout. Some files may not have been checked out. (File was not checked out.)" and then that was followed up with, "Could not perform refactoring because some of affected files could not be made writeable."...and so my change was backed out for me automatically.
Obviously, this isn't going to work, because I do need to make changes to this project.
Flailing about with what's left to me on the File > Source Control menu, I selected "Add Project From Source Control..." to see what it might offer. It first gives me a dialog where I connect to a TFS; I did. I navigated to the right spot on the server, and this looks good and ready to go:
Selecting OK invokes a dialog that tells me, "The local folder you chose to store your solution contains one or more solution files that have the same name as those in the source control server folder." with Overwrite, Cancel, and Help buttons.
I select Overwrite. I am then presented with a dialog:
I select PDAClient.sln (HHS was the former name of the solution/project)
However, when I subsequently select the Open button, I get, "The folder 'C:\Project\sscs\Handheld\Releases\6-4-0\HHS' cannot be used for the solution or project because it is already in use to store part of another solution or project."
I have no choice but to select "OK" which negates the whole process.
As a final head-first, possible-collar-bone-breaking feat of Any-Port-in-a-Stormism Syndrome, I select File > Source Control > Team Foundation Server MSSCCI Provider. This invokes the Kafka-esque Windows 2010 Shell inside of VS 2003 inside of XP Mode. According to what I see there, my setup is correct: The Server's copies of the Release project are bound to the local files Release folders:
But \Releases\HHS is grayed out, indicating there is no connection between the server folders and the local folders. And note that most (not all, but most) of the files in the Releases setup are actually stored locally in the Development folders! There are some key files that are bound correctly:
All the (dozens of) unseen files (only the first and last are seen in the last two screenshots) are tied to Development, too.
Although I don't have a "bind" type of context menu item for \Releases\HHS, there is a "map local"; although it is already ostensibly mapped correctly, I try it out, but get "The local folder could not be set to C:\Project\sscs\Handheld\Releases\6-4-0\HHS because it is already the local folder for another server folder."
So I go up to \Development\HHS, which does have a "valid" binding; note, again, that it is bound to the wrong local path (Releases instead of Dev).
So for it I first select the contextual "Remove Mapping" menu item. This affords me the opportunity to "Edit or remove a workspace mapping." I change the local folder from Releases to Dev. It looks good; Dev is now bound to Dev, and the binding is still seen as valid; this time it really is (I hope, anyway).
I now turn my attention back to Releases, but the context item "map local" is no longer there...and, although it shows the right connection between Server location and local, it is still grayed out...???
Note: The "Pending Changes" list of files is identical with both \Development\HHS and \Releases\HHS highlighted: the same three files in both cases are shown as being in the local Releases folder, and all the others in the local Dev folder.
Back in VS 2003 (out of the VS 2010 Shell running the TFS MSSCCI Provider), I go to "Change Source Control" and see that both the solution and the project have a Status of "Valid" now...when I select "OK" though, it tells me many of the files do not match and to either contact the administrator or perhaps a Get All will solve it. I tentatively look into a Select All, but see that it still says my project is bound to Development. ARGHHHH!!!!
Can anybody make sense out of this madness? How can I get the Release server folders pointed to the Release local folders, and Dev Server folders to the Dev local folders, without any bleedover and mismatching?
UPDATE
I looked in Source Control Explorer (TFS MSSCCI) again this morning, and my Dev\HHS had again gone back to being set to the wrong local path (Releases) and is connected (I guess that's what the glyph of the facing-each-other vertical arrows to the left of the folder indicates).
As to Releases\HHS, it was not connected (no glyph), but I was able to right click and map to a new folder I set up.
Here's what I see now (after changing the mapping of DEV from the local Releases folder back to the local DEV folder AGAIN!).
Properties for Dev HHS:
Properties for Release HHS:
I don't know if this makes sense to you, but it looks fishy to me.
UPDATE 2
The madness continues unabated today. My solution claims to have two pending checkins:
When I select "Check In," I get a confirmation dialog; I continue with the "Check In" button there. Then I get the "Check In - Source Files" dialog. I select the "Check In" button there, too. But then I see, "Files not checked out"
If I repeat the operations above, the last message is:
No Changess to Check In
All of the changes where either unmodified files or locks. The changes have been undone by the server."
???
IMO, I would have saved a lot of time by just zipping up files when I wanted to save the latest changes, rather than use this irksome beast; I spend more time fiddling with "productivity" tools than just using a more straightforward approach. Give me zip files and a good diff util over this cauldron of dashed hopes and clever-clever dirty tricks!
UPDATE 3
And if I close the project and re-open it, I see the following three times in a row:
So who in blue blazes told you to find such a server?!?!
Then I get:
And finally this again:
Argggggghhhhhhhhhhhhhhhhh!!!!!!!!!!!!!!!!!!!
UPDATE 4
Even though the path for the solution and project are right (Releases), this is what the files in the project show:
The branches tab, as shown in Update, show Dev going down to Release; I don't know if that's right or not, because Release was a branch of Dev,
or...???
Anyway, I see the above from File > Source Control > Team Foundation Properties
HOWEVER, when I choose File > Source Control > Team Foundation Server MSSCCI Provider, the binding seems to be correct - the HHS Dev project has Dev as its local folder location, and the HHS Release project has the Release folders as its local location.
I don't know who is more confused: me, anybody who happens to read this, or TFS/MSSCCI itself. This kind of thing is, ironically, a real productivity killer.

TFS - Permission for specific project

This is the extension of the following Stack Overflow question
Scenario:
Visual Studio Solution has projects A, B & C.
Project A is core library used by B & C.
Remote employee has permission to access only project C (which needs project A).
Question:
How can remote employee build and test project C which references project A, while remote employee has permission to access only project C.
Is it necessary to share project A with remote employee or is there any way around.
You can simply remove Project A from the solution. Obviously, the other projects would still need the relevant dlls.
If there is very sensitive information in project A then I have the following suggestion (of course this will depend on your architecture):
Create a public interface for project A, put this in Project D or something.
Make project A use this, then create a mock for the Project A interface and provide this project instead.
This would give all the dependencies necessary, and mean that you don't have to provide the dependant dlls. It is also good practice for unit testing.
In order to solve this, you need to
Move project C out of the solution into a solution of its own.
Change the project reference from C to A to a binary reference so that C references the compiled output of A. In order to do this, place A.dll in a directory under the newly created C-solution. Also add A.dll to source control so that the remote employee can retrieve the solution and A.dll from source control.
If you make changes to A that are required in project C, you need to check out A.dll, substitute it by the new version and check it in again.
Of course this means that the effort is higher if you want to propagate changes made to project A to the newly created C-solution. But it separates the environments cleanly from one another.
This approach also works if you want to follow the excellent suggestion of #pm_2 about extracting the relevant interface of A and provide only a mock version to the remote employee. In this case, you place the interface dll and the mock version to source control.

Problem updating Connection String in Visual Studio Sql Service Projects

I have created a few clr stored procedures and had them setup to our development environment. I now want to update the connection string on the database tab of the project but its not saving. Here is the list of things I have done:
I checked to make sure that the project file and user project file were not read-only
I have deleted the user project unloaded the project and reloaded and the project and created a new connection string
I am not sure what else to do, has anyone else had issues updating database connection string in a Sql Service Project?
Visual Studio 2008 doesn't update the connection strings properly when you edit them, it adds a new string instead of replacing them. Look in your app.config file and you might have multiple instances of the string that are named the same.

Resources