I don't actually know how the project system worked prior to CTP3, but has 
anyone tried using this construct* in the pyproj file?

  <ItemGroup>
    <None Include="**\*.py" />
  </ItemGroup>

I vaguely recall issues in the past where VS would occasionally replace this 
Include with specific file paths, but my brief experimentation with it this 
morning seemed promising.  Using Add->New Item to add .py files to the project 
didn't affect it.  The only immediate downside was files added via other means 
required a project reload to show up in VS (but this could be turned into a 
single button in the UI).

(*If you aren't familiar with it, this is MSBuild recursive wildcard syntax.)

From: [email protected] 
[mailto:[email protected]] On Behalf Of Michael Foord
Sent: Tuesday, 06 July, 2010 15:36
To: Discussion of IronPython
Cc: Sven Passig
Subject: Re: [IronPython] IronPython Tools for existing project

Thanks Jimmy - that answers all my questions. I would *personally* prefer a 
directory based solution (*much*) with include / exclude regexen but I think 
our developers will be happy with a VS like solution and I can manipulate the 
xml to update the project with new files.

The Chiron problem is a real problem for us and negates some of the advantage 
of using Visual Studio. When there is any news on it please let us know.

Also please let me know when there is news on informing the Silverlight xaml 
designer about referenced assemblies.

All the best,

Michael Foord

On 06/07/2010 23:29, Jimmy Schementi wrote:
On Mon, Jul 5, 2010 at 7:38 AM, Michael Foord 
<[email protected]<mailto:[email protected]>> wrote:
Hello all,

I'm working with a team on an IronPython Silverlight application. Some of the 
team develop with Windows and would like to use IronPython Tools for Visual 
Studio, especially for its debugging capabilities. This means I need to create 
a Visual Studio Solution and project(s) from the existing file layout.

We would like to have the project checked in under version control and I'm 
aware that we'll probably need to manually manipulate the project files when we 
add files outside of visual studio.

I can create the Visual Studio solution and project file and then manually 
manipulate the xml to add all the folders and individual files. So far so good. 
(Although perhaps not ideal having to add files individually - unfortunately I 
was away during the discussion about whether projects should be able to operate 
from the filesystem or have to explicitly include files.)

Yes, projects now have an explicit set of files which VS never magically 
updates. Unfortunately "Show All Files" isn't supported on IronPython projects 
today (well, really MPFProj<http://mpfproj.codeplex.com/> doesn't support it), 
meaning there is no "add this sub-directory" option, so it's really annoying to 
add a new set of files. Which means a script to update the pyproj file is your 
best bet.

Dino and I were discussing a "refresh" button to enable on-demand updating, but 
that kinda sucks for someone who just wants a directory browser, which is 
sounds like you'd prefer? Personally I like the directory browser + regex 
exclusion list, but I understand that others want a closer-to-VS experience. 
Maybe there should be a toggle on the project that will put it in one or the 
other modes? I say a project-setting because it wouldn't be good if a 
explicit-project user created a project, and then it was opened by a 
directory-browser user. =P

Next I want to be able to launch our silverlight app from within visual studio 
in order to be able to debug.

The html file is in a folder call "devcode". This has a subdirectory called 
"python", which becomes "python.xap" when served from chiron.

I set the startup file for the project to "devcode\index.html" and the start 
directory to "devcode".

When I launch the app with debugging from Visual Studio I get the message that 
Chiron has started on port 1322 and IE opens to the page 
http://localhost:1322/index.html

Our html page opens (so far so good again), but unfortunately fails with the 
following error:

Line: 31
Error: Unhandled Error in Silverlight 2 Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server 
settings

So it looks like Chiron is not building python.xap. How can I fix this?

I'm able to reproduce this too; all xap file requests are 500 errors. Must be 
an issue with how VS is launching Chiron, as it works when I launch Chiron with 
the same set of flags from cmd.exe. Let me poke around a bit more ...

The next problem is that the xaml designer doesn't work. It fails due to all 
the external assembly references used in our xaml. Now this itself isn't so 
much a problem as I know the xaml designer is ropey at the moment anyway - 
however Chiron is going to have the same problem. It needs to know which 
assemblies our app uses so that it can serve them (they are served externally 
rather than being included in the xap file and need an entry in the Chiron 
manifest.)

No need for putting an entry in the Chiron manifest; just create your own 
AppManifest.xaml in the "python" directory and put your entries there. Then put 
your assemblies somewhere relative to the "python" directory (like, maybe, 
"bin"?), and use the same relative paths in the AppManifest.xaml, like this:

<ExternalPart Source="bin/foo.zip" />

If this is never going to work with VS tools I can move the assemblies into the 
xap file as we will *probably* need this later anyway in order to allow our 
application to be installed and run out of browser.

True, in SL3 ExternalParts did not work OOB, and I don't think that's changed 
in SL4.

However I had assumed I could "add a reference" to the assemblies we were 
using. The "add reference" dialog doesn't actually allow me to add any 
references... The only active button on it is "Cancel". Is it possible to add 
references to Silverlight assemblies used by our project? (And preferably have 
them picked up by both the xaml designer and by chiron.)

"Add Reference" does not work in any IronPython projects, mainly because there 
is no standard place to put "clr.AddReference" ... at the top of the main file? 
... in a references.py file? This is more complicated in Silverlight, as it 
first requires *either* that assembly to be in the XAP, or as an ExternalPart, 
*or* as a zip-file script-tag, before clr.AddReference is used. So for now, the 
reference must be manually added depending on how you want it deployed. In your 
case, putting it in the AppManifest.xaml will work fine for Chiron, though I'm 
almost certain the XAML designer will not work; we'll have to extend the 
designer the same way we're doing for WPF, except with knowledge of our 
Silverlight app-model.


All the best,

Michael

--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of 
your employer, to release me from all obligations and waivers arising from any 
and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, 
clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and 
acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your 
employer, its partners, licensors, agents and assigns, in perpetuity, without 
prejudice to my ongoing rights and privileges. You further represent that you 
have the authority to release me from any BOGUS AGREEMENTS on behalf of your 
employer.


_______________________________________________
Users mailing list
[email protected]<mailto:[email protected]>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com







_______________________________________________

Users mailing list

[email protected]<mailto:[email protected]>

http://lists.ironpython.com/listinfo.cgi/users-ironpython.com






--

http://www.ironpythoninaction.com/

http://www.voidspace.org.uk/blog



READ CAREFULLY. By accepting and reading this email you agree, on behalf of 
your employer, to release me from all obligations and waivers arising from any 
and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, 
clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and 
acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your 
employer, its partners, licensors, agents and assigns, in perpetuity, without 
prejudice to my ongoing rights and privileges. You further represent that you 
have the authority to release me from any BOGUS AGREEMENTS on behalf of your 
employer.


_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to