Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

vcsjones/ResharperInteropHelpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What Is It?

Resharper Interop Assist is a Resharper Plug In that assists in writing and consuming Interop code. Interop is tricky, and easy to get wrong. This tool aims to catch these problems, resulting in fewer bugs and less hairpulling.

What Does It Do?

It provides the developer warnings and quickfixes for common interop problems that don't immediately present themselves as a bug. Take this imported method declaration:

[DllImport("kernel32.dll", EntryPoint = "CloseHandle")]
public static extern void CloseHandle(int hObject);

CloseHandle takes a platform-dependent sized integer, however in the delcaration we declare it with a 32-bit integer. This declaration will work fine if run as x86, however when run against the x64 CLR, the incorrect marshalling will result in CloseHandle trying to close an incorrect handle. Interop Assist will warn the developer of this scenario:

Resharper Interop Assist

Resharper Interop Assist keeps a dictionary of how the parameters should be marshalled for well-known libraries, such as kernel32.dll.

Other functionality includes warnings when the [DllImport] attribute is missing, or is not declared static.

What Is The Goal?

The goal of Resharper Interop Assist is to provide as much assistance as possible with incorrect marshalling.

How Do I Install It?

Not at the moment. Right now the project is currently too incomplete to focus on this. However, if you want to try it out, you can download the Resharper SDK and build it yourself.

##License

Creative Commons License

Resharper Interop Assist by Kevin Jones is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

About

A Resharper plugin to assist Interop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages