"Sharing" .NETMF DLLs with .NET

Ok, it’s obvious to me why .NETMF DLLs can’t be used in .NET and vice versa. However, that doesn’t eliminate the need. Has anyone come up with a workable solution? I consider maintaining two separate DLLs to be the “brute force” method. I’m looking for something more elegant. If I could only put IFDEFs in the project metadata… Perhaps some sort of shared text file imported into the projects at build time?

Why not just two projects pointing to the same .cs files? Obviously, this only works on non-hardware dependent .dlls.

1 Like

It’s easy to share a .cs file between separate projects; in Visual Studio, right-click your project, choose Add, and select the file (do NOT click the Add button!). On the side of the Add button is a little arrow; click it. From the menu that appears, choose “Add as Link”.

Voila, you’re now sharing the same physical .cs file between projects.

1 Like

I think it’s best to keep the common/shared files in a separate project and create a solution that includes that shared project along with the main project you are working on.