robertb_NZ
Well-known member
I have a reference
JSPG1I.json
that should be resolved relative to another file. It shoujld be simple to get this using Path.GetFullPath(File, Path): -
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
But I get this error message: -
Severity Code Description Project File Line Suppression State Program Sequence Number
Error BC30057 Too many arguments to 'Public Shared Overloads Function GetFullPath(path As String) As String'.
I am using Visual Studio targeting Net Framework 4.0, and I see that the version of Path.GetFullPath for Net Framework (any version) only supports the first argument. I think that the code above would work if I changed to Net Core. Is this a minor change, or should I be concerned about this? If it is NOT a minor change, what is the best way of achieving what I want while staying within Net Framework? My current best thought is
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
EDIT: Environment.CurrentDirectory DOESN'T SEEM TO BE AVAILABLE IN Net Framework 4
BTW, the File2 value could be any valid relative path. Preceding logic already removes URL's (start with http...) and absolute references (start with x .
.
	
		
			
		
		
	
				
			JSPG1I.json
that should be resolved relative to another file. It shoujld be simple to get this using Path.GetFullPath(File, Path): -
			
				VB.NET:
			
		
		
		Dim File1 As String = "C:\tutorials\TstSQL\JSPG1.json"
Dim Path1 As String = Path.GetDirectoryName(File1)
Dim File2 As String = "JSPG1.json"
Dim Path2 = Path.GetFullPath(File2, Path1)Severity Code Description Project File Line Suppression State Program Sequence Number
Error BC30057 Too many arguments to 'Public Shared Overloads Function GetFullPath(path As String) As String'.
I am using Visual Studio targeting Net Framework 4.0, and I see that the version of Path.GetFullPath for Net Framework (any version) only supports the first argument. I think that the code above would work if I changed to Net Core. Is this a minor change, or should I be concerned about this? If it is NOT a minor change, what is the best way of achieving what I want while staying within Net Framework? My current best thought is
			
				VB.NET:
			
		
		
		Dim Save = Environment.CurrentDirectory
Dim Path2 = Path.GetFullPath(File2)
Environment.Currentdirectory = saveEDIT: Environment.CurrentDirectory DOESN'T SEEM TO BE AVAILABLE IN Net Framework 4
BTW, the File2 value could be any valid relative path. Preceding logic already removes URL's (start with http...) and absolute references (start with x
 .
.
			
				Last edited: 
			
		
	
								
								
									
	
		
			
		
		
	
	
	
		
			
		
		
	
								
							
							 
	 
 
		 
 
		
 
 
		 
 
		 
 
		 
 
		