NET和我有这个错误,我在网上查看并尝试修复它已经有一天了。我很新,任何帮助都会很棒!
Public Shared ReadOnly Property AssemblyDirectory As String
Get
Dim codeBase As String = Assembly.GetExecutingAssembly().CodeBase
Dim uriBuilder As UriBuilder = New UriBuilder(codeBase)
Dim path As String = Uri.UnescapeDataString(uriBuilder.Path)
Return path.GetDirectoryName(path)
End Get
End Property我所犯的错误
错误BC30456 'GetDirectoryName‘不是'String’的成员。
任何帮助都会有帮助。谢谢
发布于 2019-01-30 18:30:08
所发生的事情是,由于您有一个名为path的字符串变量,所以它试图获取字符串path的属性/方法。注意它是如何没有将其大写为Path的。
您可以更改变量的名称或使用IO.Path.GetDirectoryName。我会做前者的。
https://stackoverflow.com/questions/54447133
复制相似问题