This project has moved and is read-only. For the latest updates, please go here.

Build target DLL


Is it possible to specify build target as dynamic library instead of application? I understand that this may require tools like py2exe, pyinstaller, or even Cython.


Zooba wrote Jun 3, 2014 at 7:21 PM

Not currently, though with the latest pre-release versions of PTVS (2.1 Beta or later), you can add a build step manually to enable this.

You will need to edit your .pyproj file manually to add code something like this:
<Project ...>
  <Target Name="CoreCompile">
    <Exec Command="command goes here" />
(Note that this is a really simple example, and not sufficient to work nicely with VS, but it should work.)

Once you've added this, when you reload your project you will see the Build command enabled, and when you rebuild your project whatever command you've put in will run. You can use this to directly invoke whatever external tool you like.

(You can in fact do far more complicated things with this - it's just using MSBuild, so anything supported in an MSBuild project is supported here.)

denfromufa wrote Jun 3, 2014 at 8:14 PM

@Zooba, What example of Exec command can you give that enables build to library (*.DLL)?

Zooba wrote Jun 3, 2014 at 10:39 PM

I don't know of any off the top of my head. The command is identical to what you would type on the command line though, so if you find a tool that can build to a DLL from the command prompt then you can put exactly the same commands in Exec.