.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Difficulty compiling IronPython WPF app into .exe when converting from .NET 3.5 to 4.0

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :WPF
We're developing an IronPython WPF/XAML app; it works fine in .NET 3.5 but now trying to move to IronPython 2.6.1 for .NET 4.0. We have a .csproj which we've updated to 4.0 - it mainly bundles our XAML and resources into a .dll - and everything works fine if we run interactively from the command prompt: ipy program.py   but when we try to build it into a standalone .exe using the pyc.py tool: C:\hs\dev\program>ipy.exe "c:\Program Files (x86)\IronPython 2.6 for .NET 4.0\Tools\Scripts\pyc.py" /main:program.py /platform:x86 /target:winexe program.py main_window.py model.py presenter.py wpf_helpers.py pyevent.py dialogs.py login.py k_ticket.py hs_quantity.py hssecdll.py debug_settings.py version_info.py it completes 'successfully' but then if I attempt to run it, the command prompt returns immediately and not even the login dialog appears. There are no error messages, or indications of a problem. This worked fine (with paths as appropriate to reference 3.5) in .NET 3.5, but is now a total mystery. I've tried a variety of pyc.py flags that seemed possibly relevant, but nothing makes it work. Suggestions for what this could be or where to look for problems appreciated! Trying to get this over to customer ASAP.

View Complete Post

More Related Resource Links

WebMatrix conversion failed when converting from a character string to uniqueidentifier?


I am trying to retrieve xml from a small function in my .cshtml page. Its throwing me an error. This however, runs fine in a console/form environment.

It takes 3 parameters and 1 exception.

myDll.GetXML(year, username, uniqueidentifier, out ex);

When I run this page I get the error, "Conversion failed when converting from a character string to uniqueidentifier."

Or a stack of.

System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting from a character string to uniqueidentifier.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

   at System.Data.SqlClient.SqlDataReader.get_MetaData()

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBeha

problem compiling web service


Using Visual Studio 2010.

I created a webservice GetDemographicData asmx, GetDemographicData asmx.cs and then used wsdl to create a proxy, then used csc.exe to create dll.

first time when I generate proxy, it looks and works fine, but when I make some changes to my webservice and regenerate proxy the following problems occur:

1.I lost the function: public DataSet Get_GetDemographicData(string CaseNum, int Version)
2. The namespace changed to my-labs

Why?? Please see my code below:

Any help is appreciated. Thanks.

<%@ WebService Language="C#" CodeBehind="~/App_Code/GetDemographicData.cs" Class="GetDemographicData" %>
GetDemographicData.cs was created under AppDataas follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;

/// <summary>
/// Summary description for GetCurrentReportVersion
/// </summary>
[WebService(Namespace = "http://localhost/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, u

Converting ReportDocument object into byte array ?


Hi All,

          Is it possible to convert the Report Document object as a byte array and store it in SQL , later retrieve and assing it to a report ?


Problems converting VS 2003 project to VS 2008



I'm having problems converting a VS 2003 project to VS 2008 (tried 2005 as well, same problem). There are several problems;
a) I don't have VS 2003 installed.
b) The project is a web service, however I'm not sure what type of VS project it was created as.
c) The general knowledge about the project setup is..slim.

I get a error message using the conversion wizard, however, I'm not familiar with the tool and I cannot quite find any good information on Google for it, so I am left with a error message I do not understand.

Conversion Issues - myProject.csproj:
Unable to open the Web site 'C:\local\path\to\project\myProject.csproj'. The Web site 'C:\local\path\to\project\myProject.csproj' does not exist.

The web service is not intended to run on the dev machine, it is copied to a test or a prod server. However, I do not know how this was done previously. I'm thinking that in order to convert, it has to access the server on which it should run (which is set somehow in a config maybe). But that doesn't actually make any sence..

If anyone could shed light on this, I would really appreciate it.

Thank you.

Converting Time formats


Hi guys,

So ive been converting an asp website to asp.net. What i did was run the migration wizard in the old VS2003, then when importing it bk into vs2008, i belive it upgraded it agin. I have been plodding along correcting basic erros and have come stuck with this one. Originallany the site has two input types, one for date and one for time. the new script is below with error im getting. I manged to get the date correct but the time is more tricky. Any suggestions would be appreciated.



Date = FormatdateTime(IIF(IsDBNull(MyRs1.Fields.Item("").Value), Nothing, MyRs1.Fields.Item("").Value), DateFormat.ShortDate)

Time = FormatdateTime(IIF(IsDBNull(MyRs1.Fields.Item("").Value), Nothing, MyRs1.Fields.Item("").Value), DateFormat.ShortTime)


Exception Details: System.InvalidCastException: Conversion from type 'Double' to type 'Date' is not valid.

Source Error:

Line 74: 
Line 75: 'TODO Need to correct the format 
Line 76:   Time= FormatDateTime(IIf(IsDBNull(MyRs1.Fields.Item("").Value), Nothing, MyR

Help converting vbscript to vb.net


Can anyone help me convert the below vbscript to vb.net:


On Error Resume Next

Dim sRunTime,sSitupCount,sPushupCount,sRunMin,sRunSec,sRunScore,sCompScore,sBodyComp
Dim iCompositeScore

Set oRE = New RegExp

sRunTime = InputBox("Enter your run time")
oRE.Pattern = "[0-5][0-9]:[0-5][0-9]"

If oRE.Test(sRunTime) = True Then
 WScript.Echo "Pattern Match"
 MsgBox "You must enter a valid run time in the following format: ""mm:ss""." & vbCr & "Please run the application again."
End If

sRunMin = Left(sRunTime,InStr(sRunTime,":")-1)
sRunSec = Right(sRunTime,InStr(sRunTime,":")-1)

sBodyComp = InputBox("Enter your waiste measurement")
oRE.Pattern = "[2-6][0-9].[0,5]"

If Len(sBodyComp) = 2 Then
 sBodyComp = sBodyComp + ".0"
End If

If oRE.Test(sBodyComp) = True Then
 WScript.Echo "Pattern Match"
 MsgBox "You must enter a waiste measurement in the following format: ""nn.n""." & vbCr & "Please run the application again."
End If

sSitupCount = InputBox

Converting from PHP to ASP


Dear all friends

 Hi to you all. I am now looking for not only your help but als your advices and suggestions to my situation.

here is the url of my current running PHP server http://www.yarnxchange.com/index.php

FIrst things I wish to know is which asp controls can replace the current PHP ones to act the same way

1.  In the top of the page the Latest news (News Ticker).

2. Under the banner logo the black line has a streamer that read data from database and view them in sme way like marquee and when roll over it stops and when click i can go to the details page.

3. In the bottom page The Yarn offers section . it shows data from mutiple tables but in the same place when click each item it displays the rows of its table in the right section . I think that there is a way or a data controller that can act the same way I wish your advice.

For sure after that I wish to know your ideas , recommendations and advices to make the full conversion in the best way

C# to VB: Converting to Boolean


I am converting some C# code to VB, the following code is part of a function

if (bool.Parse(v["Parent"].ToString()))
e.Row.CssClass = "Parent";

V is System.Data.DataRowView When I convert this to.

If Boolean.Parse(v("Parent").ToString()) Then
	e.Row.CssClass = "Parent"
End If

The code throws an error "String was not recognized as a valid Boolean" But if I use this code

If CBool(v("Parent").ToString) = True Then
e.Row.CssClass = "Parent"
End If

It works fine, which is great, I am just curious why?

Json Deserialization is giving error in IronPython



Have anyone tried json deserialization. When I tried:

>>> import json

>>> json.loads('["foo", {"bar":["baz", '"Test", 1.0, 2]}]')

I got following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\__init__.py", line
 307, in loads
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\scanner.py", line
42, in iterscan

need information about ironpython



 i have installed visual studio 2008.it works fine

now i want to try ironpython. :)

so please give me details of step for installation and which sources require to start ironpython in visual studio 2008.



how to start ironpython in asp.net


i have installed asp.net 3.5. and i have installed IronPython2.6

both wee installed successfull.but when i m creating new web site in the field od language i m not getting ironpython as shown in  


please help me.


VB webform in IronPython asp.net website


Hi, I tried to bring a previously done webform made in vb.net to an IronPython asp.net website with no luck. After seeing it didnt work, I tried to write the simplest codebehind vb.net webform to see if there was a problem with vb.net in an IronPython website and I got the following usual error "be sure that the defined class in this file matchs with the one in the attribute inherits and that it extends the right base page (page or control)" (sorry if the translation isnt the most accurate I get that message in spanish) but if I create a vb.net webform in the same website, with the sourcecode in the same file (with the vb.net code between script runat="server" tags in the same page) I get no problem. Do I have to configure something for both kind of sourcecode languages to run in such way in the same IronPython website, like configuring something in the webconfig file or is there some compatibility issue for doing that which can't be resolved?

I figured out that in some cases I can solve it by creating the app_folder and moving the vb files there, but if these files dont inherit other classes which are in the app_folder

Can IronPython use dynamic variables?


I am building a small application that can

1. Dynamically load 2 text boxes on a web form

2. Build a logic on those textboxes in IronPython to sum them and return the result.

3. I have already built a IPY script that does some opearions on a static text boxes. How to build a script on the dynamic textboxes?

Test Run: .NET Module Testing with IronPython


This month we demonstrate how easy it is to use IronPython to test .NET-based libraries.

James McCaffrey

MSDN Magazine June 2009

CLR Inside Out: IronPython and the Dynamic Language Runtime


This column uses the .NET version of the Python programming languages IronPython to demonstrate the value of dynamic languages and the new Dynamic Language Runtime.

Bill Chiles

MSDN Magazine October 2007

CLR Inside Out: IronPython


IronPython, the CLR implementation of the dynamic programming language Python is introduced this month.

James Schementi

MSDN Magazine October 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend