.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

WF4: Many dynamic assemblies in current app domain ?

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Windows Application
Full code: using System;using System.Linq;using System.Activities;using System.Activities.Statements;namespace ManyAssemblies {  class Program {    public sealed class SayHelloActivity : Activity {      readonly WriteLine writeLine = new WriteLine() { Text = "Hello Workflow 4" };      public SayHelloActivity() {        Implementation = () => { return writeLine; };      }    }    static void Main(string[] args) {      var wfDefinition = new SayHelloActivity();      for (int i = 0; i < 100; i++) {        WorkflowInvoker.Invoke(wfDefinition);      }      var allLoadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();      int wfAssemblesCount = allLoadedAssemblies        .Where(a => a.FullName == "Workflow, Version=, Culture=neutral, PublicKeyToken=null").Count();      Console.WriteLine(string.Format("There are {0} workflow assemblies in app domain.", wfAssemblesCount));      Console.ReadLine();    }  }} The output from this code: ...Hello Workflow 4Hello Workflow 4Hello Workflow 4There are 100 workflow assemblies in app domain. Every execution of wf definition crea

View Complete Post

More Related Resource Links

Dynamic Data, Domain datasource, Poco and lookups


Mr. Edward,

Excuse my question but: it is necessary to involve in our projects something more than just Dynamic Data or should we make use of all other features available in VS2010 (which will make assume taht they had been left out of the Dynamic Data framework) like: wef, poco, azure, wcf, cloud, mvc, silverllight, ajax, odata, agile, workflow, etc.?

Sorry my ignorance, I'm just transcribing names as they come to my mind and of which I don't know anything about


Carlos Porras (El Salvador)

Customizing pages with Asp.Net Dynamic Data Domain Service Web Applications?

Hola, It used to be so easy creating new folder under CustomPages with the (Entity/Table name) and copying on it all base default PageTemplates (Details, Insert, Edit, List and ListDetails) and you will get access to those pages only for the specific table (this was the default automatic behavior of the Dynamic Data framework) When it comes to be using Asp.Net Dynamic Data Domain Service Web Applications it seems that we need to learn a new way of doing this because it is just simply different and you got a lot of errors when compiling your application if you do this the old way? What might be the new way, uh? HOW DO WE DO THIS NOW ... I MEAN ... CREATING DEFAULT CUSTOM PAGES FOR SPECIFIC TABLES (Details, Insert, Edit, List and ListDetails) with Asp.Net Dynamic Data Domain Service Web Applications? The problem arises when the definition for your newly created classes is absent from the automatically generated code when you created your domain service !!!!! . If you simply copy the PageTemplates as they are, you got a duplicated error message because the new .designer file (automatically generated) conains the definition of the class you are copying (not the newer one) so even if you rename your .aspx file the result is not what you would normally expect (the .designer class is not regenerated after renaming). The .designer file keeps the domain service definition and if y

Set up a validator that compare the value of the current field with an other (using Dynamic Data)

Hi! Most of it is in the title : I'd like have a validator on the DateTime_Edit template for example that allows to compare this field with an other DateTime field. My problem is when I am in the DateTime_Edit template of my "master field" (the one I want to check), how can I access to the other field given the architecture of Dynamic Data FieldTemplates? But perhaps I'm not thinking in a good way on this control. Any advice will be welcome. Thanks Raphaelp

Cannot INSERT record using Asp.Net Dynamic Data Domain Service Web Applications

 Hi, I am working on a 'Asp.Net Dynamic Data Domain Service Web Application' project using just 2 tables, FAQ_Categories and FAQs. The FAQs table has a foreign key to the FAQ_Categories. The steps are straight forward. Add a new project (Asp.Net Dynamic Data Domain Service Web Applications) Add folders Model ( for Linq2Sql datacontext), Domain (for the Domain Services class) Add Linq2Slql and add the 2 tables to the designer. Build the project. Add the Domain Service Class to the Domain folder. in the wizard select the DataContext, uncheck the Enable Client & Expose ODate checkbox Check bothe table & their corresponding Enable Editing tables checbox Check the Generate Metadata class Click OK. In Global.asax set Scaffold to true and add the DomainService name. Build and run.   Pages List and Detail are working fine. But if I try to insert a new record, I get the error "FaqId is required" Faq_ID is the primary key in the database table and it is set to Identiy. The Datacontext is correct, it marked the FAQ table with <Global.System.Data.Linq.Mapping.ColumnAttribute(Storage:="_CustomerId", AutoSync:=AutoSync.OnInsert, DbType:="Int NOT NULL IDENTITY", IsPrimaryKey:=true, IsDbGenerated:=true)> _   I tried this using Linq2Sql, Entity Framework, And both in VB and C# with the same result. I am using VS20

Dynamic Data, Domain Services & POCOs...


I have a simple navigation property between two pocos (parent/child) and I'm using the [Key], [Include], [Association] attributes to notate the relationships. However, when DomainModelProvider attempts to load my model -- I get this error:

[InvalidOperationException: Can't find To column for column 'myColumnName'] Microsoft.Web.DynamicData.ModelProviders.DomainColumnProvider.Initialize() +649

Rather than parade my horribly broken code around -- I was wondering if anyone has a good resource or guides on how to use DomainService/Dynamic Data together using custom POCO models with 1:1/1:M relationships -- rather than EF/L2SQL driven data models. I figure I'd start there before giving up.


Dynamic table based on current viewers



Using MS Visual Web Developer 2010 Express, I'm trying to create a simple site where I can view how many people are currently viewing the page. So far I've added a Web Form called 'home.aspx' this will be the only page and it will contain the gridview that displays how many people are viewing (using the sql COUNT function). There's also the default web.config file which I havn't modified yet.

I've added a sqlexpress database called 'Users' and created a Table called 'viewers'. 'viewers' has collumns IP (varchar(50)) and Time (datetime).  The goal is for the table to grow (INSERT users) each time a viewer views the page, and get smaller (DELETE the user) when each person leaves.

I'm kinda stuck now:

1) I dont know what I have to put in my web.config file to create my connection string to my database (all the tutorials are written for people who know all the system.web mumbo jumo).

2) What do I write in my VB code behind file to INSERT users (I'm guessing I just need their IP and Time?) when they come to the site.

3) What do I write in my VB code behind to DELETE users if they leave. (I think this is the harder part. I dont know how to tell the database to constantly be checking to see if some IP address is still viewing, and then delete t

Creating dynamic assemblies


Hi All,

In my application, I want to load some methods during run time. that is, i do not know anything about these methods during compile time. there is a configuration file which includes the data for a given scenario, and the methods should be designed according to the needs of those data. then through that configuration file, these new methods are called.

I imagine that this is possible via .net reflection mechanism, by creating a dynamic assembly which one can define to include all the new methods he needs. then the configuration file will call these methods. i know how to call these new methods from my configuration file. i just want to find the mechanism to define a dynamic assembly that includes all these methods.

hope you can help me.

Get primary key values from insert page and route to details page in a Dynamic Data Domain Service A


I finally figured out how to retrieve primary key values from the insert page template that are inserted via defaults in a SQL Server database. I wanted to get the keys so that I could route the user from the insert page template to the details page template (regardless of whether it’s a custom route or not). There are a number of scenarios where separate insert and details pages are desirable, and routing from the insert page back to the list page is not desirable as Dynamic Data does out of the box. Since I could not find an answer to this problem anywhere with significant effort, I decided I would document it for others, I hope you find it useful - it turns out that it's quite simple under 10 lines of code. I also applied the same idea to a Dynamic Data Entities application which works exactly the same except for two minor changes, I have documented it below as well.

For starters, as is documented plenty elsewhere but bears repeating here, you must first annotate your Entity Data Model with ScaffoldColumn = false for identity columns and guids that get assigned with newid() in thedatabase. This tells Dynamic Data not to attempt to pass a null value from the page through to

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Dynamic Data Templates in GridView ASP.NET 3.5

At a high level, Dynamic Data Templates can be seen as a system to very quickly build up a User Interface linked with the relevant data model, immediately enabling you to perform CRUD operations (Create, Read, Update, Delete) on the database using the specified data source. They provide a powerful method for building up these kinds of applications, and I'm going to focus on an overview of what Dynamic Data Templates actually are, and a few ways of customizing them to suit industry needs.

ASP.NET 4.0 Dynamic Data and Many to Many Entity Framework Entities

I did not play much with Dynamic Data controls in VS2008 and just made a cool discovery in VS2010 Beta 2. This may not even be new, but as I'm sitting 30,000+ feet over the Atlantic ocean, I don't have access to VS2008 at the moment to check.

Dynamic Systems Development Model (DSDM) Methodology

The Dynamic Systems Development Model was developed in the U.K. in the mid-1990s. It is the evolution of rapid application development (RAD) practices. DSDM boasts the best-supported training and documentation of any of the agile software development techniques, at least in Europe. DSDM favors the philosophy that nothing is built perfectly the first time and looks to software development as an exploratory endeavor.

Adding Dynamic Rows in GridView with TextBoxes

I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

Adding Dynamic Rows in GridView with TextBoxex in C#

I decided to write this article because this has been asked so many times before at the forums(http://forums.asp.net) . Basically, this example shows on how to generate a Row in GridView with TextBoxes when clicking a Button that is residing inside a GridView Footer.

What is the difference between "dynamic" and "object" keywords?

Let's take a quick look at the object keyword first. I'm not going to talk a lot about it because it's been around since C# 1.0. This keyword is nothing more than a shortcut for System.Object, which is the root type in the C# class hierarchy. (However, as Eric Lippert pointed out in his blog post, not everything in C# derives from object.) This is a powerful mechanism, since you can assign almost any value to instances of this type.

Dynamic in C# 4.0: Introducing the ExpandoObject

You have probably already heard about the new dynamic feature in C# 4.0 and how it is used to support COM interop. If you haven't, I strongly recommend reading the following MSDN articles: Using Type dynamic and How to: Access Office Interop Objects by Using Visual C# 2010 Features.

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).
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