.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

CLR Inside Out: IronPython and the Dynamic Language Runtime

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

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

View Complete Post

More Related Resource Links

How to Localize Windows Forms and Change the Language at Runtime

Localization is the process of customizing your application to a particular language, culture or locale. Visual Studio provides support for localizing Windows Forms with much ease. In this article, we will see how to localize windows forms and give the user the ability to change to his preferred language at runtime.
When you run a localized application, the appearance is determined by two culture values. The UICulture property is used to specify which resource files will be loaded for the form. The Culture property, on the other hand, determines how strings such as dates, numerals, and currency amounts are formatted.
Let us see the steps required to create a localized form. You can then expand this example and adopt the same approach for the rest of the forms in your project

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?

CLR Inside Out: Dynamic Languages and Silverlight


DLRConsole gives you an interactive environment for playing with dynamic languages in Silverlight.

Jimmy Schementi

MSDN Magazine February 2008

CLR Inside Out: IronPython


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

James Schementi

MSDN Magazine October 2006

.NET Remoting: Design and Develop Seamless Distributed Applications for the Common Language Runtime


Prior to the advent of .NET, DCOM was the underlying technology for remote communications between Windows-based applications. But DCOM is quirky to set up and configure and not as interoperable as it should be. In .NET, XML Web Services and .NET Remoting are a seamless and effective answer to the demand for tools to build distributed applications.This article provides a primer on .NET Remoting with insights into the internal plumbing. Important aspects of remoting, such as channels, object lifetime management, and clients for remote objects are discussed. In addition, some practical examples are provided.

Dino Esposito

MSDN Magazine October 2002

Microsoft .NET: Implement a Custom Common Language Runtime Host for Your Managed App


While most application developers may not need to write a custom host, understanding what is involved provides a great deal of insight into the architecture of the CLR. After covering how the CLR is started and loaded into a process, how to set the available configuration options, and how a host defines application domains, this article explains how to design a custom host. Important concepts include making the right decisions about the application domain boundaries for the host, configuring them correctly, loading and executing user code, and resolving references to assemblies. Setting security policy and unloading application domains as the application shuts down are also explained.

Steven Pratschner

MSDN Magazine March 2001

Security in .NET: Enforce Code Access Rights with the Common Language Runtime


Component-based software is vulnerable to attack. Large numbers of DLLs that are not tightly controlled are at the heart of the problem. Code access security in the Common Language Runtime of the Microsoft .NET Framework addresses this common security hole. In this model, the CLR acts as the traffic cop to assemblies, keeping track of where they came from and what security restraints should be placed on them. Another way the .NET Framework addresses security is by providing preexisting classes which have built-in security. These are the classes that are invoked in .NET when performing risky operations such as reading and writing files, displaying dialog boxes, and so on. Of course, if a component calls unmanaged code, it can bypass code access security measures. This article covers these and other security issues.

Keith Brown

MSDN Magazine February 2001

Using Dynamic Property inside Html Helper with Razor fires an error



I have the following with Razor:

@Html.GoogleAjax(View.GoogleAjaxKey, new String[,] { { "jquery", "1.4.2" } })

And the I get a strange error:

  'System.Web.Mvc.HtmlHelper<object>' has no applicable method named 'GoogleAjax' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.

What is strange is that it works fine using:

@Html.GoogleAjax("123", new String[,] { { "jquery", "1.4.2" } })

I tried the following code line:


And the key is displayed just fine so the problem is how I use the value of @View.GoogleAjaxKey into Html.GoogleAjax.

Do I need to change something on my Html Helper? Here it is:

    public static MvcHtmlString GoogleAjax(this HtmlHelper helper, String key, String[,] libraries) {


MVC3: Define Dynamic ViewModel property inside Action Filter



How can I define a Dynamic ViewModel property in MVC 3 inside an action filter?

I am looking to have something like but inside the ActionFilter and not in the controller:

ViewModel.Title = "Home";

Thank You,


create and insert into a dynamic sql table at runtime

Below I have a bunch of SQL statements that creates a table at runtime and the "pic" column is a dynamic column and the code creates the number of "pic" columns depending on the count of the uploader control.  the problem comes when I try to insert into that table and I am trying to say for every "pic" declare variable @pic.... it works well for just one file in the uploader but for multiple files i get the following error The name "pic1" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted.Directory.CreateDirectory(MapPath(".") & "\port\" & clientname.Text & "\")        Dim objConn As New SqlConnection("Data Source=xxxxxxxxx.hostedresource.com; Initial Catalog=mrpoteat; User ID=xxxxxxx; Password=xxxxxxxxx;")        objConn.Open()        Dim strCommandText As String = ""        For index = 1 To Attachments1.Items.Count Step 1            If String.IsNullOrEmpty(strCommandText) Then                strCommandTex

Problem with Dynamic Controls inside an UpdatePanel

Hello Everybody ,I have this problem,if anyone could help me i'll be so gratefull. I had been created some dynamic radio buttons in a loop inside a dinamy table which is inside an UpdatePanel , but i can not handle the events my code is below:public void MetodoCreacion(){RadioButton RBtn = null;Table table = new Table();TableRow row = null;TableCell cell = null;for (int i = 0; i < 5; i++){row = new TableRow();cell = new TableCell();RBtn = new RadioButton();RBtn.ID = "RBGN_" + i.ToString();RBtn.GroupName = "RBGN1";RBtn.Text = "Opcion " + i.ToString();RBtn.CheckedChanged += new EventHandler(RBtn_CheckedChanged);RBtn.AutoPostBack = true;cell.Controls.Add(RBtn);row.Controls.Add(cell);table.Controls.Add(row);}UpdatePanel1_UpdatePanelAnimationExtender.Controls .Add(table);}public void RBtn_CheckedChanged (object sender, EventArgs e){Label1.Text = ((RadioButton)sender).ID;}and the controls doesent call the event ...thanks a lot

Common Language Runtime Debugging Services


Application has generated a exception that could not be handled.

Process id=0xb0c (2828), Thread id=0x910 (2320).

Click OK to terminate the application

Click CANCEL to debug the application.

Now ive dont all of that, when i click OK the message just disapears all the way, but when I click CANCEL a differnt message appears. It says,

No Debugger found.

Registered JIT debugger is not avilable. An attempt to launch a JIT debugger with the following command resulted in a error code of 0x2 (2). Please heck computer settings.

Cordbg.exe !a 0b0c

Click on retry to have the proess wait while attaching a debugger manually.

Click on Cancel to ab

Error trying to set Correlation Token at runtime for ReAssigning Task inside while loop.


Hello Friends,

I have developed a custom sequential WF in VS 2010 using custom WorkFlow Content Type and ASPX forms.

Requirements are as below:

1.WF creates an approval task for User A. If User A rejects,then WF completes.
2.If User A approves,task is assigned to User B. If User B approves,then WF completes.
3.Is User A approves and User B rejects,then I need to ReAssign the task to User A.

I am facing problems in the 3rd point above.
I have a while loop having a Sequence Activity and the activities: CreateTaskWithContentType,onTaskChanged and CompleteTask are inside the Sequence Activity.

I am aware that the Correlation Token has to be set at design time in the VS 2010 WF Designer.

The issue is of dynamically assigning Correlation Tokens(Task Tokens) to the activities: CreateTaskWithContentType,onTaskChanged and CompleteTask which are inside Sequence Activity(Inside While Loop).

My Code:
CorrelationToken C_Token =
                 new System.Workflow.Runtime.CorrelationToken();
createTaskWithContentType1.CorrelationToken = C_Token;

I get the error:"This operation can not be performed at runtime" when trying to assign Correlation Token dynamically as above.

Can anyone please hel

Dynamic Gridview inside a Dynamic Gridview


If there's a better way to accomplish what I'm attempting I haven't found it yet. That being said, I have create a gridview like the one here, http://www.aspsnippets.com/Articles/Adding-Dynamic-Rows-in-ASP.Net-GridView-Control-with-TextBoxes.aspx . And with some minor tweaking it working great for all my fields, checkboxes, etc. The issue is my last column is another gridview, and I'd like it to function the same. that is, a dynamic gridview inside of a dynamic gridview. I get that I have to create it initially with null values or it won't show up. I guess what I'm having trouble figuring out is instead of go will null data in the parent gridviews column, do I place my blank child gridview. Do I create and bind the child gridview first, or second. Generally just not sure. Also, as far as storing the data from the child gridview goes, will each one need it's own datatable? Thanks for any input, and if you have any suggestions on the whole idea please feel free to let me know ;-)

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlC

dynamic javascript of an .ascx control inside an updatepanel not changing on client between async po


I have a confusing state issue. I found a way around it, but I would like to know why this is happening. First of all, I am using .NET 3.5 and that can't change right now (an easy fix may be the fixed ID capabilities of .NET 4.0).

Type csType = this.GetType();
ClientScriptManager cs = Page.ClientScript;
string jScriptBlockName = "SignUpSignInNameAvailabilityScript";
if (!cs.IsClientScriptBlockRegistered(csType, jScriptBlockName))
{   //NOTE: verified code always enters this
    StringBuilder cstext2 = new StringBuilder();
    cstext2.Append("function GetSignUpSignInNameAvailabilityMessage() { var id = '"
          + CreateUserWizardStep1.ContentTemplateContainer.FindControl("iSignUpSignInNameAvailabilityMessage").ClientID
          + "'; alert(id); return id; }");
    cs.RegisterClientScriptBlock(csType, jScriptBlockName, cstext2.ToString(), true);

This code is in Page_Load of an ascx. The same control is drawn on two separate postbacks of an UpdatePanel in different places of the page thus giving them different client IDs. The code works correctly on the first refresh of web browser; but after UpdatePanel

Can I use the Dynaqmic Language Runtime (DLR) in SQL Server 2008 R2?


Hi All,

Sorry if this is a total newbie question.  I've searched all around and it would seem like the answer would be 'no'.  The point of confusion is that visual studio lets me write the code in a sql project but then barfs with this error:

"One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?"

System.Core I can actually reference.  Microsoft.CSharp I cannot and I understand that this is a security issue.  Fine.  But is DLR usage considered dynamically compiled code?  Seems a little weird since all it really is is a hashtable lookup and some late-bound dereferencing (yes, it could take down your server, but there you go.)

Anyway, is there a way for me to use a 'dynamic' object in SQL server 2008 R2 or am I just out of luck?





TSQL help please - dynamic sql inside WHILE loop


I would like to store data into different temp tables based on different WHERE clause. I used the below script but it throws error. Please help

My Script:



@counter int



@counter = 0



@counter <

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