How do I know the current source version on a local machine - visual-studio-2010

I'm woking with a team mate programming something in parallel with another group in the same solution.
But, my mate has a different version, the most recent, that is different from my own, older one. I would like to know if there's any way to know the exactly source version that I have on my machine, and then tell him to get the same change sets from the TFS Server.
Is this possible? There's any place that log this kind of information?

To see what versions you each have:
In Team Explorer / Source Code Explorer, you may right-click on a file and View History to see all change set history, and you may right-click on a file and select /advanced/Properties to see what you have in your workspace.
The corresponding command-line comands are tf history yourFileSpec see tf history on MSDN and tf properties yourFileSpec see tf properties on MSDN
To get a specific version:
You may right-click on a file in Source Control Explorer and get specific version. This also has a corresponding command-line of tf get [itemspec] [/version:versionspec] see tf get on MSDN

The tf info command will tell you the details of a file. Included in this information will be the local version (the changeset that you have locally) and the server version (the latest version on the server.)
C:\Temp>tf info filename.txt
Local information:
Local path : C:\Temp\filename.txt
Server path: $/Project/filename.txt
Changeset : 1099
Change : none
Type : file
Server information:
Server path : $/Project/filename.txt
Changeset : 1099
Deletion ID : 0
Lock : none
Lock owner :
Last modified: Thursday, May 26, 2011 10:04:49 PM
Type : file
File type : Windows-1252
Size : 619

Related

How to install tnsping?

How do I have to install tnsping?
I tried to install oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm and I'm able to use some client commands but nog tnsping.
Oracle Instance Client does not include tsnping application. You must run "Oracle Universal Installer" and enable the option for it.
I don't' remember exactly which option you have to set, either it was "Oracle Database Utilities" or "Oracle Net"
Also see McTnsping [link broken] "a Windows stand-alone program which requires no Oracle client". It's portable and doesn't need to be installed.
Usage 1: McTnsping.exe { <tns entry> | <host>:<port> } [<count>]
<tns entry> the net service name in the tnsnames.ora file.
<host>:<port> server name or IP and port (mandatory)
<count> number of times to check target, default is 1.
If whoever will reach the place like me... This is what worked for me:
Instant client Version 12.2.0.1 + sqlplus + tnsping (copied from another server of the same version)
Directory structure and env (as in bash profile):
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=${ORACLE_BASE}/instant_client122
export PATH=$ORACLE_HOME:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME #since all binaries are in $ORACLE_HOME - no bin or lib are present
export TNS_ADMIN=$ORACLE_HOME/network/admin
copy from another server to target:
'tnsping' to $ORACLE_HOME
'$ORACLE_HOME/network/mesg/tnsus.msb' to $ORACLE_HOME/network/mesg
Then put proper values to $TNS_ADMIN/tnsnames.ora and load env variables. After this it should be able to perform 'tnsping' and show proper message as a response.
Here's what I did to copy tnsping over to another machine. In my case, the oracle client is installed at C:\Oracle\product\12.1.0\client_1.
This assumes there's already an Instant Client or similar installed on the destination machine; and that the oracle path and registry keys are set.
(1) Copy tnsping.exe from the source to the destination machine, into client_1\bin.
(2) Copy the following files from client_1\bin to client_1\bin:
oraasmclnt12.dll
oracell12.dll
oraclient12.dll
oraclsce12.dll
oracommon12.dll
oracore12.dll
orageneric12.dll
orahasgen12.dll
oraldapclnt12.dll
oran12.dll
orancds12.dll
orancrypt12.dll
oranhost12.dll
oranl12.dll
oranldap12.dll
oranls12.dll
oranro12.dll
orantcp12.dll
orantns12.dll
oraocr12.dll
oraocrb12.dll
oraocrutl12.dll
oraplp12.dll
orapls12.dll
ORASLAX12.DLL
orasnls12.dll
oraunls12.dll
orauts.dll
oravsn12.dll
oraxml12.dll
orazt12.dll
oraztkg12.dll
This should be about 84.6 MB.
(3) In the client_1 on the destination machine, make a backup of the following files:
oci.dll
orannzsbb12.dll
oraons.dll
orasql12.dll
orawsec12.dll
Now on the source machine, find those files in client_1\bin and copy them to client_1\ (no bin) on the destination machine, overwriting the existing files. (Note: oci.dll is ~330 kb smaller, orasql12.dll is ~300 kb smaller. I'm not sure what's lost, hence the backup).
(4) On the destination machine, create the directory mesg in client_1\Network. Now copy the following file from the source to the destination:
client_1\Network\mesg\tnsus.msb
(5) Open up regedit. Create the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\KEY_OraClient12Home1_32bit
(From another machine, it looks like the x64 version is named HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\KEY_OraClient12Home1, but the tnsping program I'm using says it's 64 bit, so ...)
Under the key, create a string named ORACLE_HOME with the value C:\Oracle\product\12.1.0\client_1.
You should be done now ($$$ = redacted):
C:\Users\$$$>tnsping $$$
TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 03-APR-2
019 08:47:37
Copyright (c) 1997, 2014, Oracle. All rights reserved.
Used parameter files:
C:\Oracle\product\12.1.0\client_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = $$$)(PORT = $$$))) (CONNECT_DATA = (SERVICE_NAME = $$$
$$$) (SERVER = DEDICATED)))
OK (30 msec)
Troubleshooting
Here's the process I followed, sharing for when these steps invariably fail to work on a later version.
First off, I just copied the tnsping.exe over.
I didn't haphazardly pick the above dlls, as far as I can tell everyone is required. I ran the exe, and it would popup an error, I would copy the dll over and try again:
After a few dlls, you'll run into a different kind of error:
If that happens, fire up process monitor and put a filter in for the ProcessName to contain tnsping and try to run the program again. You should see something like the following. The main thing to notice is that it tries to load (in this example) orawsec12.dll, which succeeds, but then it continues to try to load the dll looking in different paths, and then at the end it triggers werfault and the program ends. I guess it realizes there's some kind of version mismatch and keeps looking for the right version.
The missing registry key will show up like the following in process monitor (operation RegOpenKey, result NAME NOT FOUND):
If the tnsus.msb file is missing, you should see something like the following in process monitor (operation CreateFile, result NAME NOT FOUND):

Why/how are Registry Entries Hidden in Regedit but visible in PowerShell?

I'm working with a new property schema, and have been in the habit of checking the registry when I register or unregister a new version. One of the primary places to check this is HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\PROPERTYSYSTEM\PROPERTYSCHEMA.
Interestingly, I occasionally lose access to this registry location in Regedit. I see see this (note the absence of PropertySchema):
I know the schemas are still registered, because I can use the prop.exe tool and propschema SDK sample application to describe them. The properties are available in Windows Explorer and in Search.
Also, I can use PowerShell to list the contents of this hive:
C:\Users\carlton> cd hklm:
HKLM:\>
C:\Users\carlton> cd hklm:
HKLM:\> cd SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\PROPERTYSYSTEM\PROPERTYSCHEMA
HKLM:\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\PROPERTYSYSTEM\PROPERTYSCHEMA> dir
Hive: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\PROPERTYSYSTEM\PROPERTYSCHEMA
Name Property
---- --------
0000 (default) : C:\Program Files\Internet Explorer\ie9props.propdesc
SchemaId : {D9B5ABA1-5E8A-4902-B6A1-50B3C0311C2E}
URI : ie9props.propdesc
CompactURI : 5376bae4b39f43768806afcb6b8ff5464bf9c989d1a819c6e6d99ba1e8ce2512
0001 (default) : C:\Program Files\Microsoft Office\Office14\Custom.propdesc
SchemaId : {537AAAB1-1D85-48DC-A99E-16EB8C309FE5}
URI : custom.propdesc
CompactURI : 2e3be58e5cbbc0da093956b46a3905f11cf0f5bbf11987a8619e25f7261ee8be
0002 (default) : C:\apps\MSOffice\Office14\VisioCustom.propdesc
SchemaId : {18503526-0466-4942-AC6E-41C1D380EABA}
URI : visiocustom.propdesc
...
Anyway, I don't understand how this happens, and whether I should be worried about it. Exporting this key from a colleague's machine and re-importing it can temporarily help, as it will show keys in Regedit that were hidden/missing (even if they weren't on my colleague's machine).
I'm in the Administrators group, running Windows 7 SP1.
The 32bit program data on 64bit systems available in 'Wow6432Node' folder of the registry (in above case 'SOFTWARE\Wow6432Node\MICROSOFT\WINDOWS...'). This is transparent to the applications, hence you can read data from applications but you don't see that in Regedit.
Harry Johnston's intuition was correct. I re-ran regedit from a command line with the path c:\windows\regedit, and I once again see what I expected under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PropertySystem\PropertySchema. I could've sworn it wasn't showing it either, but it's working now, apparently.
I confirmed as much by exporting the parent key (PropertySystem) from the 64-bit and 32-bit regedit's and running Beyond Compare. The propdesc files are verily not there in the 32-bit version.
See 32-bit and 64-bit Application Data in the Registry (MSDN)

cvs2svn 2.4.0 - error pass 16 svnadmin

Good afternoon,
Using version 2.4.0-dev on a Linux machine, I am trying to migrate a CVS project to SNV. I had some issues with symbols, and I created a hint rule file based on symbol-info.
Now to my current error. The CVS project is called package. I want to migrate it to SVN under the directory structure svnrepos/sw/package. The svnrepos/sw already exists (along with other projects under svnrepos.
In my option file (created from cvs2svn-example.options), I am using
ctx.output_option = ExistingRepositoryOutputOption(
r'/var/svn-test', # Path to repository
#author_transforms=author_transforms,
)
...
run_options.add_project(
r'cvs/package',
trunk_path='sw/package/trunk',
branches_path='sw/package/branches',
tags_path='sw/package/tags',
...
I also tried
run_options.add_project(
r'cvs/package',
trunk_path='trunk',
branches_path='branches',
tags_path='tags',
initial_directories=[
r'sw/package'
],
with the same error:
----- pass 16 (OutputPass) ----- Starting Subversion Repository. Starting Subversion r1 / 635 Starting Subversion r2 / 635 Starting
Subversion r3 / 635 ERROR: svnadmin failed with the following output
while loading the dumpfile: svnadmin: E160020: File already exists:
filesystem '/var/svn-test/db', transaction '48-1c', path 'sw'
I am at a lost on how to resolve this issue.
Note:
My initial tests were using command line arguments with the results that trunk, branches and tags were created in svnrepos/trunk, svnrepos/branches and svnrepos/tags respectively. As I indicated earlier, I want these to be under svnrepos/sw/package
Thanks in advance
Daniel
I solved this issue. Essentially the migration has to be done is two steps
1.Use cvs2svn to produce a dump file. In the option file, I used the following
# Use this type of output option if you want the output of the
# conversion to be written to a SVN dumpfile instead of committing
# them into an actual repository. The author_transforms option is as
# described above:
ctx.output_option = DumpfileOutputOption(
# dumpfile_path=r'/path/to/cvs2svn-dump', # Name of dumpfile to create
dumpfile_path='packageDump',
#author_transforms=author_transforms,
)
Note that the path for trunk, tags, and branches also includes a reference to package.
run_options.add_project(
r'cvs/package',
trunk_path='package/trunk',
branches_path='package/branches',
tags_path='package/tags',
As I mentioned in the original message, there were some symbol issues, and I created a symbol hint file where svn-path points to my desired package directory. For example
0 tag_pk_1_0_0 tag package/tags/pk_1_0_0 .trunk.
2: Use svnadmin load to load the generated dumpfile onto svn
svnadmin load --parent-dir sw /var/svn-test < packageDump

File Replace during upgrade

We use Inno Setup(version 5.4.2) as the packaging tool to generate our installer. While upgrading our software from older version to current version,
we try to overwrite existing binaries/drivers. This is often leading to issues as some monitoring software like 'HP ArcSight Logger/Connector', 'SplunkUniversalForwarder' etc. are holding file handles on our binaries and casuing overwrite to fail. Our installer shows beolow popup message on encountering this issue each time.
"C:\Windows\System32\drivers\xxx.sys
An error occurred while trying to replace the existing file:
DeleteFile failed; code 5.
Access is denied.
Click Retry to try again, Ignore to skip this file(not recommended), or Abort to cancel installation"
Interestingly, even after above getting above pop-up, we were able to rename xxx.sys to xxx.sys.old manully. We used to suggest cusotmers to rename
xxx.sys to xxx.sys.old and 'Retry' the installation. After renaming, upgrade used to complete without any issues.
Questions
1) Is it possible to rename xxx.sys through program always, when we hit this issue.
2) Any process to reproduce the DeleteFile failed; code 5 issue?
Using the installer you can rename the existing file and install the new file using the correct file name with help from the windows registry.Remember to ask the user to reboot their computer to complete the install.Another option would be to either use the installer to rename the file and again using the window's registry to delete the unneeded file.
Window's registry allows you to delete or rename files on reboot as part of an install.
Reference to use of PendingFileRenameOperations:
http://support.microsoft.com/kb/181345
Example to rename from microsoft support:
The syntax used is (without quotes):
"\??\source file !\??\target file"
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
Value name: PendingFileRenameOperations Data type : REG_MULTI_SZ
Value data: \??\c:\temp\win32k.sys !\??\c:\winnt\system32\win32k.s
The same command can be used to delete a file as well although requires the use of nulls.
http://www.pcreview.co.uk/forums/pendingfilerenameoperations-delete-file-t1715654.html
Same example used to delete a file:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
Value name: PendingFileRenameOperations Data type : REG_MULTI_SZ
Value data: \??\c:\temp\win32k.sys\0\0\0
I hope this helps you!

VS2010 DB Project Deploy Error SQL01268 Directory Lookup Failed

My VS2010 database deploy is failing on my build server, which has SQL Server 2008 R2 installed on it. Here's the output that's relevant:
Creating Acme.Database...
D:\TeamCity\BuildAgent\Work\da2fc5ebd5805d44\src\Acme.Database\sql\Acme.Database.sql(30,0): Error SQL01268: .Net SqlClient Data Provider: Msg 5133, Level 16, State 1, Line 1 Directory lookup for the file "C:\Program Files\Microsoft SQL Server**MSSQL10.MSSQLSERVER**\MSSQL\DATA\Acme_Database_log.ldf" failed with the operating system error 3(The system cannot find the path specified.).
D:\TeamCity\BuildAgent\Work\da2fc5ebd5805d44\src\Acme.Database\sql\Acme.Database.sql(30,0): Error SQL01268: .Net SqlClient Data Provider: Msg 1802, Level 16, State 1, Line 1 CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
An error occurred while the batch was being executed.
The actual path is here:
C:\Program Files\Microsoft SQL Server**MSSQL10_50.MSSQLSERVER**\MSSQL\DATA\Acme_Database.mdf
The only reference to the path I could find in the database project was in the root folder, a file called:
PRIMARY.Acme_Database.sqlfile.sql
It includes an ALTER DATABASE statement that I changed to use the _50 path, but this did not fix the issue.
I'm not sure why the db project needs to know where the actual database MDF file is located in any case - I would have thought it could just connect to it vis TSQL, but in any case I can't get the project to deploy with this error and would appreciate any help.
Turns out if you specify a "file" in Schema Objects\Database Level Objects\Storage\Files (use Add Item, File) the values specified in the path override those looked up from the Server. If you must specify them use the variables from sqlcmdvariables $(DefaultdataPath)$(Databasename) to fill things out.
Take a look at the default file path on the server itself.
Screencast: http://screencast.com/t/OWM5ODFjZj
The fact that you don't have a path specified could likely be the issue.
[Update]
The reason I suggest this is that during the creation of the deployment script, if you have not specified the settings in the Project Settings -> Deployment tab, the DefaultDataPath is looked up from the target server's path.
I don't know anything about TeamCity really so this may be a stupid question, but how are you doing the deployment? It looks like the MSBuild deploy task for a DB project can take a property that gives the data path:
http://www.codewrecks.com/blog/index.php/2009/10/06/deploy-a-database-project-with-tfs-build/
Can you set the path that way?
I had the same error, but a different solution.
For me everything was correct (as far as I can tell), but the generated deploy script set the path variables before the databasename variable - resulting in a reference to a variable that did not exist. I updated Database.sqlcmdvars to hardcode the database name value - not best practice, but a sufficient workaround for my needs.

Resources