file attachments

comments

Unfortunately, when the core VS teams add a feature like this they don't work with us on it, so we usually have to catch up later.

I haven't tried, but this may be as easy as setting a property in the .pyproj file (for example, we probably don't set the target .NET framework version, even though you can select it in the New Project dialog).

You could open the .pyproj and .csproj files in a text editor and compare them - they're just XML files. We won't be exposing the property in the UI anywhere, so this is the only option. Editing project files is pretty safe though.

If you find a way to make it work let us know so we can tell other people and make any changes to our templates. (If you don't find a way then we'll have to triage this feature against all the rest - it probably won't make 2.0 final.)

Thank you for the reply Zooba I have found an alternative solution to this problem.

First I have tried your suggestion, yet unfortunately with no result. The project file generated from a IronPython WPF application *.pyproj structure does miss a reference to the .NET Framework wheras a the project file from a C# WPF application does not:

If you explore both projects in the explorer the C# project will have a folder in the solution folder of the project called 'packages' this folder contains the just installed NuGet packages and their .dll's. Copy this folder to the solution folder of the
python project.

Now you are able to reference the .dll's from the package (NuGet would normally do this automatically for you)
In case of referencing MahApps set references to: MahApps.dll and System.Windows.Interactivity.dll in
YourPoject\packages\MahApps.Metro.0.10.1.1\lib\net40

Don't forget to set the search path to the same path in your project. (for clr.AddReference() to be able to find the assemblies)

Now you can import the assemblies from the package in your IronPython script:

It's quite the elaborate work-around but it works! I guess it would be interesting if someone would able to find out why exactly the NuGet installation doesn't detect the proper .NET framework for IronPython scripts. I am pretty sure you are not able to change
anything in your templates to automate this process (I have tried to install all .NET 4.0 assemblies in the IronPython WPF application that are automatically present in the C# WPF application on start up but also then NuGet trows the same error).

If you're really keen to figure out how NuGet is validating the project you can actually look at their source code:
https://nuget.codeplex.com/ This is all we'll be doing (eventually... which is why you may want to do it sooner :) )