I have a WPF C# application here, finally have solved errors. But after I run the program, it can work, just that there are 7 warnings that I have no idea what is it about. I need to know whether it will cause any problem to my project or not..
Warnings:
-
CA2214:Microsoft.Usage: ‘PoseViewModel.PoseViewModel()’ contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences:
PoseViewModel..ctor()
ViewModelBase.get_IsInDesignMode():Boolean
PoseViewModel.set_IsTracking(Boolean):Void
ObservableObject.RaisePropertyChanged
(Expression>):Void -
CA2000:Microsoft.Reliability:In method ‘SpeechController.InitSpeechRecognition()’, object ‘<>g_initLocal()’ is not disposed along all exception paths. Call System.IDisposable.Dispose on object ‘<>g_initLocal()’ before all references to it are out of scope.
-
CA1901 : Microsoft.Portability : As it is declared in your code, parameter ‘dwExtraInfo’ of P/Invoke ‘NativeWrapper.mouse_event(uint, int, int, int, int)’ will be 4 bytes wide on 64-bit platforms. This is not correct, as the actual native declaration of this API indicates it should be 8 bytes wide on 64-bit platforms. Consult the MSDN Platform SDK documentation for help determining what data type should be used instead of ‘int’.
-
CA1401 : Microsoft.Interoperability : Change the accessibility of P/Invoke ‘NativeWrapper.SetCursorPos(int, int)’ so that it is no longer visible from outside its assembly.
-
CA1401 : Microsoft.Interoperability : Change the accessibility of P/Invoke ‘NativeWrapper.mouse_event(uint, int, int, int, int)’ so that it is no longer visible from outside its assembly.
-
CA1060 : Microsoft.Design : Because it is a P/Invoke method, ‘NativeWrapper.SetCursorPos(int, int)’ should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.
-
CA1060 : Microsoft.Design : Because it is a P/Invoke method, ‘NativeWrapper.mouse_event(uint, int, int, int, int)’ should be defined in a class named NativeMethods, SafeNativeMethods, or UnsafeNativeMethods.
Help!
So… that’s what warnings are. They aren’t errors, just warnings. The application will work, but some parts of the code is suspicious for Visual Studio. Just try to fix them to ensure the quality of what you are producing.
For instance, the second one seems pretty important.