I wonder why Visual Studio is raising this warning:
Access of shared member, constant member, enum member or nested type through an instance
My code:
Dim a As ApplicationDeployment = deployment.Application.ApplicationDeployment.CurrentDeployment
If System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed Then
If a.IsNetworkDeployed Then
' do something
End If
End If
What implies "through an instance"? Also, why is this a "warning"?
Showing a warning is a design option. In C#, it would throw an error when calling a static using an instance (
this
) keyword.The problem is that you should call the object to correctly describe what it is.
More useful info at MSDN.