This is a mirror of official site: http://jasper-net.blogspot.com/

BinPack

| Saturday, August 21, 2010
BinPack is a portable security environment for Windows. With 100+ security tools in the repository, you can easily convert any system into a hacking platform in minutes.

20100726guisecurity.png

Read more: West Coats Hackers

Posted via email from .NET Info

Use Linux? Now you can video chat too

| Friday, August 20, 2010
If you’ve been wanting to use voice and video chat on Linux (our top video chat request), then we have good news for you: it’s now available! Visit gmail.com/videochat to download the plugin and get started. ..

Read more: TechBlips

Posted via email from .NET Info

Google Product Graveyard

| Thursday, August 19, 2010
Not all Google projects was success. Take a look on this list

Read more: makeuseof.com

Posted via email from .NET Info

Intel buys McAfee for nearly $8 billion

|
While most of the IT guys I know aren't fans of McAfee -- especially after that teensy little definition screwup which resulted in thousands of unwanted desktop support hours -- Intel is obviously a fan. In a press release this morning, the IT behemoth has announced that they're swallowing up McAfee for the princely sum of $7.7 billion dollars.

Whether guys like you or I like it or not, McAfee still has a lot going for it. It's preinstalled on loads of OEM PCs and gets plenty of subscription buys as a result. It's a force to be reckoned with in the enterprise, and they're one of the most widely-recognized names in antivirus.

Read more: DownloadSquad

Posted via email from .NET Info

PS3 Hacked via USB Dongle

|
   PSX-scene.com reports that the first PS3 modchip has been tested and confirmed working. Working off of a USB dongle, It appears to be relatively user friendly and claims to not void your warranty, and online gameplay works (at least for the time being). It's been a long time coming, cheers to the PS Jailbreak Guys.
 
Read more:  Slashdot

Posted via email from .NET Info

Intercepting .NET SQL queries at runtime

|
image016.jpg

SQL Server Management Studio has been designed for a very fast interaction of the Administrator and/or users with the SQL Server objects. We can see the objects by just clicking in the appropriate item, example to get the views or the users.

The purpose of this article is to show how with a quick knowledge of assembler language and pointers, the possibility to extract useful information without have the source code for any app. You can apply this article to show the queries in runtime for any .NET system. Reverse Engineering for fun. It can be applied also for Worker Processes on IIS for live debugging without Visual Studio.

Let Start. You will need a basic knowledge of .NET Debugging on Runtime Debugging like Windbg. For heuristic knowledge for .NET environments a natural way to execute commands is: SQLCommand Object, but we need to confirm this by looking if Management Studio process has instantiated this class. Let Start.

Steps

Open SQL Server Management Studio.
Login to SQL Server and execute some operations like view the objects or databases.
Open Windows debugger tool and attach the SQL Server Management Studio Process:

Once attached we can find a command line inside windows debugger.
There is a useful helper for debugging we can load this by using:

.loadby sos mscorwks

SOS windbg extensions allows to explore .NET objects at low level, based on the correct mscorwks.

Execute:

!dumpheap -type SqlCommand -stat

Dump .NET Heap for SqlCommand type (-type) and obtain an statistics of it (-stat).

Read more: Codeproject

Posted via email from .NET Info

SQL Server - Identifying identity columns using TSQL

|
One of my friends asked me if it is possible to identify the tables with identiy columns as he wanted to run dbcc checkident command to all the tables of the database.There are actually many ways to identify identity columns from a table.The following three methods will list out the table names and the identity column name (if available)

Method 1 : Use columnproperty function

select         table_name,column_name from         information_schema.columns where         columnproperty(object_id(table_name),column_name,'isidentity')=1 order by table_name
Method 2 : Use sys.all_columns view

select         object_name(ac.object_id),so.name from         sys.all_columns as ac inner join sys.objects as so         on object_name(ac.object_id)=so.name where         is_identity=1 and so.type='u'
Read more: Beyond Relational

Posted via email from .NET Info

How to run IronPython code from C#

|
I’ve just got back from a joint session with Shay at the local .NET user group, I’ve presented IronPython after an excellent IronRuby session done by Shay.

One example I didn’t have the time to show was how to run IronPython script from within C# code. After the session I was asked by a group member to show this exact demo. So without further ado here is how to run IronPython from within the comfort of your C# application:

Step 1: Add references

Add the following assemblies to your project:

IronPython.dll
IronPython.Modules.dll
Microsoft.Scripting.dll
All of the assemblies above are can be found under the IronPython installation folder.

Step 2: write code

Running IronPython is very easy – I’ve decided to create a console application and run an IronPython file that was passed as an argument:

using IronPython.Hosting; using Microsoft.Scripting.Hosting; namespace IronPythonFileRunner { class Program { static void Main(string[] args) { ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(null); ScriptRuntime runtime = new ScriptRuntime(setup); ScriptEngine engine = Python.GetEngine(runtime); ScriptSource source = engine.CreateScriptSourceFromFile(args[0]); ScriptScope scope = engine.CreateScope(); source.Execute(scope); } } }

You can use the same code to embed IronPython by replacing engine.CreateScriptSourceFromFile with engine.CreateScriptSourceFromString.

Read more: Helper Code

Posted via email from .NET Info

12 for 7 - The 12 Windows Phone 7 Development Jump Start sessions are now available on demand (we’re talking 600’ish minutes, yeah, 10 hours, of WP7 Dev’ness)

|
Today we are publishing the first in our training content led by our MVPs.  Rob Miles and Andy Wigley led an incredibly well received live training course about a month ago, focused on getting developers trained up on building amazing applications and games for Windows Phone 7.

We recognize that providing as much technical content as we can for the full range of developers is what developers deserve. While we plan on having more live training sessions in the coming weeks and months, we are also committed to making that content available as quickly as possible to as many developers as possible. Since this round of content is based on Beta Windows Phone Developer Tools, we will not be localizing it.  For our non-English speaking developers, we will be providing localized training once we have released the final developer tools.

Andy and Rob provide a good bit of humor along with their incredible depth of knowledge on the topic of building apps and games for Windows Phone 7. We think they have covered a fair amount ground, but if there are topics you feel we need to cover more in depth, don't hesitate to let us know.

There are 12 sessions in total, each about :50 minutes in length. Think of this as a semester's worth of class time to help you in your quest to be an awesome Windows Phone 7 developer. It's self-paced, and both Rob and Andy are pretty approachable. Head on over to their blogs if you want to get more plugged into what they are doing.

Read more: Greg's Cool [Insert Clever Name] of the Day
Read more: Windows Phone 7 Jump Start

Posted via email from .NET Info

Getting a “System.ArgumentException: Value was invalid” when trying to sign data using SHA256CryptoServiceProvider

|
Here is the symptom:
1.    You are using RSACryptoServiceProvider for computing SHA-2 signatures.
2.    Doing this you get unhandled exceptions of type "System.ArgumentException" in mscorlib.dll saying "Value was invalid".
3.    A typical call that failed was:

byte[] signature = rsa.SignData(data, new SHA256CryptoServiceProvider());
4.    The SHA1CryptoServiceProvider did not reproduce the exception.
5.    Additionally you have FIPS policy enabled.
The environment might be Windows Vista and above with .Net Framework version 3.5 or above. The code snippet that reproduces this issue is:
namespace SignData
{
   class Program
   {
       static void Main(string[] args)
       {
           byte[] data = new byte[] { 0, 1, 2, 3, 4, 5 };

           using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider())
           {
               SHA256CryptoServiceProvider ha = new SHA256CryptoServiceProvider();
               byte[] signature = rsa.SignData(data, ha);

               if (rsa.VerifyData(data, new SHA256CryptoServiceProvider(), signature))
               {
                   Console.WriteLine("RSA-SHA256 signature verified");
               }
               else
               {
                   Console.WriteLine("RSA-SHA256 signature failed to verify");
               }
           }
       }
   }
}

This code is directly referenced from the blog http://blogs.msdn.com/shawnfa/archive/2008/08/25/using-rsacryptoserviceprovider-for-rsa-sha256-signatures.aspx and my intension is to show the exception.

Read more: LogIn SDK - Windows SDK team blog

Posted via email from .NET Info

Visual Studio 2010 solution build process give a warning about indirect dependency on the .NET Framework assembly due to SSIS references

|
Here’s how I saw the problem…

2746.image_5F00_thumb_5F00_2ECB3D39.png

Install SQL Server 2005. Afterwards, Install SQL Server 2008. (Integration Services or Management tools features are enough usually)
Install your favorite new tool Visual Studio 2010.
Create or Open a solution for your C# or VB application. The Solution properties should target the “.Net Framework 3.5” to have this problem.
Add references to one or more of the SSIS dlls in the SDK folder. These assemblies may be referenced from References tree in the Solution Explorer pane of Visual Studio 2010, by browsing to the dll files in the 32-bit directories from either SQL Server 2005 or SQL Server 2008:
On a 64-bit platform:
C:\Program Files (x86)\Microsoft SQL Server\90\SDK\Assemblies
C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies

On a 32-bit platform:
C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies
C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies

Microsoft.SqlServer.Dts.Design.dll
Microsoft.SQLServer.ManagedDTS.dll
Microsoft.SqlServer.ScriptTask.dll
Microsoft.SqlServer.SQLTask.dll
Microsoft.SqlServer.TxScript.dll
Microsoft.SqlServer.VSTAScriptingLib.dll

Build menu > Build ApplicationName.
The warnings will appear in the Error List pane.

The build of the .Net application may report the following Warnings in the Error List pane:


The primary reference "Microsoft.SqlServer.Dts.Design, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "2.0.3600.0" than the version "2.0.0.0" in the current target framework.

Read more: Jason's Technical Topics

Posted via email from .NET Info

Tips for troubleshooting SQL Agent Error: 15281

|
Tips for troubleshooting SQL Agent Error: 15281
Chris Skorlinski
Microsoft SQL Server Escalation Services

We encountered an interesting problem the other day I thought I would post on ReplTalk.  Customer call when they noticed the SQL Server Agent resources in their SQL 2008 clustered installation would not start.  The following error appeared in the Windows Application and System Event log.

Windows Application Event Log

SQLServerAgent could not be started (reason: SQLServerAgent must be able to connect
to SQLServer as SysAdmin, but '(Unknown)' is not a member of the SysAdmin role).

[sqagtres] StartResourceService: Failed to start SQLAgent$SQL2K5 service.  CurrentState: 1
[sqagtres] OnlineThread: ResUtilsStartResourceService failed (status 435)
[sqagtres] OnlineThread: Error 435 bringing resource online.

Windows System Event Log

The Cluster service failed to bring clustered service or application 'SQL Server (SQL2K5 )' completely online or offline. One or more resources may be in a failed state. This may impact the availability of the clustered service or application.

Cluster resource 'SQL Server Agent (SQL2K5 )' in clustered service or application 'SQL Server (SQL2K5 )' failed.

We also looked in the MSSQL\LOG folder for SQL Server to see what error messages SQL Server Agent was reporting.  Here is where we noticed Error: 15281.

Read more: REPLTalk covers Using and Tuning SQL Replication

Posted via email from .NET Info

כך תגבירו את חשיפת הבלוג שלכם

|
כולם רוצים יותר חשיפה לבלוג והשאלה תמיד היא איך עושים את זה? אז פוסט זה אינו מדריך ב 10 צעדים לפסגת החשיפה אלא תוספת אחת חשובה – או כמו שאמרו פעם: “התוספת שתופסת”.

לפני הכל אני רוצה לציין שאין תחליף לתוכן טוב וכתיבה איכותית ושום גימיק לא יעזור. ואחרי הפתיחה…

Techie Tal ממליץ: סרגל הכלים של Wibiya. קודם כל מה הוא סרגל הכלים של Wibiya: מדובר בסרגל כלים שמופיע בתחתית הבלוג (כפי שמופיע בשלי) שבו אתם יכולים לשלוט בכל הרכיבים שעיקר מהותם לאפשר לגלשים לשתף את האחרים בפוסטים שלכם.

page1_image.jpg

Read more: Techie Tal

Posted via email from .NET Info

SQL SERVER – Negative Identity Seed Value and Negative Increment Interval

|
I just had interesting conversation with one of my friend who said identity value can not start from Zero. I told him that it can even start from negative value. He did not believe it. I quickly come with example and he was surprised to see it.

USE [AdventureWorks]
GO


IF EXISTS (SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[IdentityNegative]') AND TYPE IN (N'U'))
DROP TABLE [dbo].[IdentityNegative]
GO

CREATE TABLE dbo.IdentityNegative
(
ID INT NOT NULL IDENTITY (-100, -1),
Firstcol VARCHAR(100) NULL
)
GO

INSERT INTO dbo.IdentityNegative (Firstcol)
SELECT 'First'
UNION ALL
SELECT 'Second'
UNION ALL
SELECT 'Third'
UNION ALL
SELECT 'Fourth'
UNION ALL
SELECT 'Fifth'
GO

SELECT *
FROM dbo.IdentityNegative
GO

DROP TABLE dbo.IdentityNegative
GO

Now let us see the resultset. Here we have specified negative identity Seed value as well negative Increment Interval.

Read more: Journey to SQL Authority with Pinal Dave

Posted via email from .NET Info

Encrypt a File using DES (Data Encryption standard) Algorithm in ASP.NET

| Wednesday, August 18, 2010
Security in cryptography

Cryptography play important role in Security. Using Cryptography we can Encrypt and Decrypt the information in the Coded form.

How we Encrypt the File using DES (Data Encryption standard) algorithm.

1.Open visual studio and create a project

2.Add the following assembly on the page

using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Security;
using System.Security.Cryptography;
using System.Text;
using System.IO;
3.Now write the Code in the Page
public class Tester
{
   public static void Main()
   {
        try
       {
           DESCryptoServiceProvider myDESProvider = new DESCryptoServiceProvider();
            myDESProvider.Key = ASCIIEncoding.ASCII.GetBytes("12345678");
           myDESProvider.IV = ASCIIEncoding.ASCII.GetBytes("12345678");
           ICryptoTransform myICryptoTransform = myDESProvider.CreateEncryptor(myDESProvider.Key, myDESProvider.IV);
           FileStream ProcessFileStream = new FileStream("test.txt", FileMode.Open, FileAccess.Read);
           FileStream ResultFileStream = new FileStream("testDes.txt", FileMode.Create, FileAccess.Write);
           CryptoStream myCryptoStream = new CryptoStream(ResultFileStream, myICryptoTransform, CryptoStreamMode.Write);
            byte[] bytearrayinput = new byte[ProcessFileStream.Length];
            ProcessFileStream.Read(bytearrayinput, 0, bytearrayinput.Length);
           myCryptoStream.Write(bytearrayinput, 0, bytearrayinput.Length);
            myCryptoStream.Close();
           ProcessFileStream.Close();
           ResultFileStream.Close();
       }
       catch (Exception ex)
       {
           Console.WriteLine(ex.Message);
       }
   }

Read more: C# Corener

Posted via email from .NET Info

Why I Love NServiceBus

|
NServiceBus was designed around the fallacies of distributed computing and faces each fallacies head-on rather than trying to sweep the them under the rug and hide from them while pretending that they don’t exist.  It is only by acknowledging and addressing these fallacies that our systems become truly and effectively distributed.  This is one the foundational principle of NServiceBus.  It’s not just about plugging in the WCF MSMQ  binding and somehow magically request/response will bring scalability.

In a nutshell, all of the learning and hard lessons discovered through the school of hard knocks and best thinking of distributed systems (rather than whimsical, so-called vendor best practices) are baked into the heart and core of NServiceBus.

vs. Web Services

Previous to going to his class I had already done a decade of web services using SOAP and REST and I kept running into the same types of problems over and over again.  I’ve read all of the best practices of the vendors and so forth, but the thing that always bugged me was how everything related to these "best practices” (if it’s even appropriate to call them that), always pointed us back to purchasing more licenses—such as database licenses, OS licenses, etc.  If you want an eye opener and sample of what Udi brings to the table, take a look at his Reliability, Availability, and Scalability webcast.  The biggest problem with with web services is that they run afoul of practically all of the fallacies.

So where do web services fit in?  As integration points with 3rd parties that connect across the web.  They’ve worked great in that arena and will continue to work well into the foreseeable future.  Furthermore, a “web service” AJAX call from a browser into a service may also be appropriate.

vs. WCF

Essentially WCF is just a way of wrapping all of Microsoft’s myriad of integration and communication technologies under one API.  The problem is that all of these technologies, with the exception of MSMQ, were built upon the paradigm of RPC—remote procedure call.  Essentially, it’s all about blocking communication.  Could you imagine a world in which you called someone on the phone and waited on hold until you received the information you needed?  RPC is just like that.  Your servers are at 0% CPU, but you have no threads left to serve because they’re all blocked waiting for remote services to respond.  The MSMQ binding helps, but not if you use it in a synchronous blocking manner with an RPC-type interaction.

Read more: Inversion of Control Freak

Posted via email from .NET Info

IIS 7.0 and 7.5 configuration reference

|
If you need to look up the IIS 7.0 and 7.5 configuration reference there is an easy to remember URL:

http://www.iis.net/configreference

Even better, if you are a bit old fashioned like me and like a compiled help file (CHM) the download links at the bottom of that page let you download those too.

Read more: Notes from a dark corner

Posted via email from .NET Info

Acronis True Image completely free

|
Acronis True Image is a powerful disk imaging software that creates backups and recovers PC systems.Unfortunately this software is not free.However Acronis has an agreement with Seagate and Western Digital and provides a re-branded version of Acronis True Image completely free. This rebranded version of Acronis True Image comes in 3 versions.DiscWizard for Seagate Users, MaxBlast for Maxtor users and Acronis True Image WD Edition for Western Digital users.
Each of these versions work only with the respective products.For example Acronis True Image WD Edition works only in computers having Western Digital Hard Disks and Seagate Disc Wizard works only in computers having Seagate Hard Disks.

Read more: AgniPulse

Posted via email from .NET Info

NHibernate Logging Providers

|
NHibernate Logging Providers makes it possible to use your favourite logger with NHibernate. You no longer have to use log4net. The new NHibernate (since NH3) logging abstraction makes this possible. The providers are developed in C# using .Net 3.5.

Note

I will keep updating the logging providers with the current NH Trunk. When a version if NH3 is tagged I will provide a permanent Download for that particular release.

Available Logging Providers

The current release contains log providers for the following logging frameworks.
  • Common.Logging 2.0

Common.Logging 2.0 supports several other logging frameworks. So you can use each of them with NHibernate via Common.Logging 2.0 abstraction.

Read more: Codeplex

Posted via email from .NET Info

SQL commands help site

|
plsql_record_type_ex.gif

This web site hold an reference to most of the PL/SQL commands with examples.

Read more: _EnterSources_

Posted via email from .NET Info

C# המדריך הישראלי ל

|
שמי חיים מיכאל ואני בחרתי להקים בלוג זה עבור הספר "המדריך הישראלי ל-#C" שאותו התחלתי לכתוב בשנת 2009. באמצעות בלוג זה אני מקווה לקבל פידבקים מאנשים שמשתמשים בספר כדי להבטיח את שיפורו ועידכונו לאורך זמן.
מניסיוני בשנים האחרונות בהוראת שפות תיכנות מתקדמות באקדמיה, בצבא, בחברות פרטיות ובקורסים לקהל הרחב אחד החסמים הוא חוסר הידע בשפה האנגלית. זמינותם של ספרים בעברית עוזרת באופן משמעותי בתחילת דרכם של סטודנטים רבים. אני מקווה שספר זה ישרתך נאמנה בהתמודדות עם חסם השפה. ספר זה מהווה מדריך בסיסי בלבד. הוא איננו מתיימר להוות מדריך מפורט לשפה. המטרה בכתיבתו היא לסייע לכל מי שיש לו קשיים באנגלית. ידע עדכני ומפורט ב-#C ובשפות תיכנות אחרות (כגון: Java ו-PHP) ניתן למצוא באתר www.abelski.com, שהקמתי בשנת 2007. בעוד שהספר "המדריך הישראלי ל-#C" כתוב בעברית את האתר www.abelski.com החלטתי לפתח באנגלית ובכך להיטיב עם העולם כולו.

Read more: C# Book

Posted via email from .NET Info

SQL SERVER – Download SQL Server 2008 Interview Questions and Answers Complete List

|
I was getting many request to update SQL Server Interview Questions and Answers I had written couple of years ago. I have modified the original document a bit and corrected few of the typos and errors. I have really enjoyed going over all the Interview Questions and Answers. It has been the most popular subject always on this blog.

I am in process of updating that with few new questions and answers I have received from industry experts. Please provide your feedback on how we can further improve them or what kind of questions and answers would like to include in them.

Read more: Journey to SQL Authority with Pinal Dave

Posted via email from .NET Info

Windows Kerberos Authentication Bypass

|
OVERVIEW:
A vulnerability was found in all recent Windows operating systems. The attack allows a malicious user to physically login on a target host in a Kerberos-based network, under the assumption that he knows a valid user principal and has the ability to manipulate network traffic. Our research shows that all recent versions of the Microsoft Windows operating systems are vulnerable to the attack.

AFFECTED SYSTEMS:

  • Windows XP Service Pack 2
  • Windows Vista Service Pack 1
  • Windows 7
  • (using a Windows Server 2008 Domain Controller)

Read more: secgroup.unive

Posted via email from .NET Info

NHibernate tutorial

| Tuesday, August 17, 2010
  Working with object-oriented software and a relational database can be cumbersome and time consuming in today's enterprise environments. NHibernate is an object/relational mapping tool for .NET environments. The term object/relational mapping (ORM) refers to the technique of mapping a data representation from an object model to a relational data model with a SQL-based schema.
NHibernate not only takes care of the mapping from .NET classes to database tables (and from .NET data types to SQL data types), but also provides data query and retrieval facilities and can significantly reduce development time otherwise spent with manual data handling in SQL and ADO.NET.
  NHibernate's goal is to relieve the developer from 95 percent of common data persistence related programming tasks. NHibernate may not be the best solution for data-centric applications that only use stored-procedures to implement the business logic in the database, it is most useful with object-oriented domain models and business logic in the .NET-based middle-tier. However, NHibernate can certainly help you to remove or encapsulate vendor-specific SQL code and will help with the common task of result set translation from a tabular representation to a graph of objects.


Read more: Google Knol

Posted via email from .NET Info

Model View Controller for Android

|
This weekend, Gaurav released his initial implementation of the MVC pattern for Android at http://blogs.mastergaurav.com/2010/08/14/model-view-controller-mvc-for-android/. This opens up several possibilities for anybody looking to create an application on Android.
  • The implementation, even though is an initial early push, has a robust infrastructure. Here's an initial analysis and outline of the implementation:
  • The implementation, quite similar in nature to Struts (and he's inspired by Struts for the same), has a front controller and implements Command Pattern.
  • Controller is implemented as Application specialization that does all housekeeping.
  • Command is modeled using ICommand interface. Noting that a large part of the commands will be network, database, file-system or related operations that may take a long time to complete, it provides response using callback listener for asynchronous implementation
  • All commands are managed using CommandQueueManager which internally is managed using a simplified ThreadPool of CommandThread instances.
  • The public interface of interacting with this complex infrastructure is CommandExecutor, internally made use of by the Controller.
  • Modeling request, response and listeners are available in the package com.mastergaurav.android.mvc.common.
  • To keep developer use extensible, input-commands and output-activities, they are purely numeric in nature.

Read more: Eduzine

Posted via email from .NET Info

Drill Into .NET Framework Internals to See How the CLR Creates Runtime Objects

|
   Since the common language runtime (CLR) will be the premiere infrastructure for building applications in Windows® for some time to come, gaining a deep understanding of it will help you build efficient, industrial-strength applications. In this article, we'll explore CLR internals, including object instance layout, method table layout, method dispatching, interface-based dispatching, and various data structures.
   We'll be using very simple code samples written in C#, so any implicit references to language syntax should default to C#. Some of the data structures and algorithms discussed will change for the Microsoft® .NET Framework 2.0, but the concepts should largely remain the same. We'll use the Visual Studio® .NET 2003 Debugger and the debugger extension Son of Strike (SOS) to peek into the data structures we discuss in this article. SOS understands CLR internal data structures and dumps out useful information. See the "Son of Strike" sidebar for loading SOS.dll into the Visual Studio .NET 2003 debugger process. Throughout the article, we will describe classes that have corresponding implementations in the Shared Source CLI (SSCLI), which you can download from msdn.microsoft.com/net/sscli. Figure 1 will help you navigate the megabytes of code in the SSCLI while searching for the referenced structures.

Read more: MSDN Magazine

Posted via email from .NET Info

Git – Cloning and pushing via https (Linux and Windows)

|
Unfortunately the Eclipse team provider EGit does currently not support to use HTTPS for cloning and pushing. Fortunately the Git command line supports this (under Linux without problems):

git clone https://vogella@github.com/vogella/de.vogella.rcp.example.git
// do some changes
git push https://vogella@github.com/vogella/de.vogella.rcp.example.git

If you are on Windows and if you are using msysGit then you may receive the following error:

error: error setting certificate verify locations:
CAfile: /bin/curl-ca-bundle.crt
CApath: none
while accessing your_repo

If you have this error you can disable ssl verification to solve it.

git config --global http.sslverify "false"

Read more: Eclipse Papercuts

Posted via email from .NET Info

.NET Best Practice No: 1: Detecting High Memory consuming functions in .NET code

|
Introduction and Goal
Thanks a lot Mr. Peter Sollich
CLR Profiler to rescue
Features of CLR profiler
Do not user CLR on production and as a starting tool for performance evaluation
How can we run CLR profiler?
Issues faced by CLR profiler
The sample application we will profile
Using CLR profiler to profile our sample
That was a tough way any easy way
Simplifying results using comments
As said before do not get carried away with execution time
Conclusion.
Source code
Other Articles
My FAQ articles

Introduction and Goal

One of the important factors for performance degradation in .NET code is memory consumption. Many developers just concentrate on execution time to determine performance bottle necks in a .NET application. Only measuring execution time does not clearly give idea of where the performance issue resides. Ok, said and done one of the biggest task is to understand which function, assembly or class has consumed how much memory. In this tutorial we will see how we can find which functions consume how much memory. This article discusses the best practices involved using CLR profiler for studying memory allocation.

Please feel free to download my free 500 question and answer ebook which covers .NET , ASP.NET , SQL Server , WCF , WPF , WWF@ http://www.questpond.com .


Thanks a lot Mr. Peter Sollich

Let’s start this article by first thanking Peter Sollich who is the CLR Performance Architect to write such a detail help on CLR profiler. When you install CLR profiler do not forget to read the detail help document written by Peter Sollich.

Thanks a lot sir, if ever you visit my article let me know your inputs.

Read more: Codeproject

Posted via email from .NET Info

FireMon

|
What is FireMon?

FireMon® is software that helps you manage your firewalls. FireMon will plan and report on any changes to the firewall policy, increasing visibility and reducing the cost of making changes. It will show you which of your rules are unused and how traffic flows through each rule, letting you clean up unnecessary access and tighten down existing rules. And, with continued, automated analysis of things like PCI and NSA guidelines, FireMon will greatly improve your compliance posture. It'll even help you with security management on other devices in the Enterprise, like routers and load balancers.

The bottom line? FireMon is software that will help you manage your security devices better so you can provide better service to your users at a lower cost to you.

Try FireMon on your own network.

Read more: Secure Passage

Posted via email from .NET Info

AlgoSec Firewall Analyzer

|
The AlgoSec Firewall Analyzer (AFA) is comprehensive, multi-vendor policy management solution -- with exclusive topology-aware technology -- that intelligently automates analysis of your firewall, router and VPN infrastructure. AlgoSec Firewall Analyzer is a unique solution that helps you achieve the following:

Eliminate Risks
Ensure Compliance
Optimize Your Security Policy
Effectively Manage Change
The AlgoSec Firewall Analyzer also comes with flexible deployment options and customization capabilities that makes deployment easy and tailored to your specific needs and environment. And a variety of licensing options makes it easy to chose the solution that best fits your needs.

Eliminate Risks

Analyzing complex firewall policies manually is time consuming and requires understanding of all possible options and combinations. As a result, many risks are not detected and impose a threat to the organization's security.

The AlgoSec Firewall Analyzer provides in-depth, intelligent analysis of the entire security policy leveraging unique algorithms that factor in network topology, all possible traffic variations and industry best practices resulting in a comprehensive identification of risks (and the specific rules that are causing them) and detailed and precise remediation guidance. This includes the ability to analyze several firewalls together -- taking into account their relative hierarchy in the network -- and presenting results in a single report, enabling more efficient and accurate risk management for groups of firewalls.

Read more: AlgoSec

Posted via email from .NET Info

Fire Walker

|
What is Fire Walker?

Fire Walker is software that allows you to operate someone else's computer via a connection or through the internet, you can see their screen, send files, receive files, chat, draw and use their computer as if you were sitting in front of it.

Read more: Nexus Concepts

Posted via email from .NET Info

Test your antivirus software

|
The following site give an examples of viruses or malware programs - so you can check you current antivirus.

Posted via email from .NET Info

Actipro WPF Studio

| Monday, August 16, 2010
FeatureFocusWizard.png

Actipro WPF Studio is a bundled suite of professional user interface controls and components for Windows Presentation Foundation (WPF).

To make the bundle extremely cost effective, licenses for WPF Studio are priced to provide more than a 60% savings over the cost of purchasing all Actipro's WPF controls individually!

The company behind WPF Studio, Actipro Software, has been making top-notch Windows Forms controls since .NET was first introduced, and was the very first control vendor to release a commercial WPF control.

Read more: Actipro

Posted via email from .NET Info

ASP.Net – Calling JavaScript from Code Behind

|
.Net gives us the ability to call javascript code from the code behind. This means that you don’t have to write the javascript code in the “Source” of the aspx page. Just for an example, let’s say that you have a button on a form that just want to popup an alert that says “HEY” when it is clicked.

protected void btnHey_Click(object sender, EventArgs e)
{
    StringBuilder sb = new StringBuilder();
    sb.Append("<script language='javascript'>alert('HEY');</script>");

    // if the script is not already registered
    if (!Page.ClientScript.IsClientScriptBlockRegistered(Page.GetType(), "HeyPopup"))
         ClientScript.RegisterClientScriptBlock(Page.GetType(), "HeyPopup", sb.ToString());
}

Let's say that there is already a javascript method in the ASPX page. To run that method, you would use similar code, but with one difference:


// javascript method in ASPX page
<script language="javascript" type="text/javascript">
   function ShowMessage(myMessage){
       alert(myMessage);
   }
</script>

// C# code
protected void btnHey_Click(object sender, EventArgs e)
{
  StringBuilder sb = new StringBuilder();
  sb.Append("ShowMessage('hey');");

  // if the script is not already registered
  if (!Page.ClientScript.IsClientScriptBlockRegistered(Page.GetType(), "HeyPopup"))
      // notice that I added the boolean value as the last parameter
      ClientScript.RegisterClientScriptBlock(Page.GetType(), "HeyPopup", sb.ToString(), true);


Read more: </dream-in-code>

Posted via email from .NET Info

When do I need to use GC.KeepAlive?

|
Finalization is the crazy wildcard in garbage collection. It operates "behind the GC", running after the GC has declared an object dead. Think about it: Finalizers run on objects that have no active references. How can this be a reference to an object that has no references? That's just crazy-talk!

Finalizers are a Ouija board, permitting dead objects to operate "from beyond the grave" and affect live objects. As a result, when finalizers are involved, there is a lot of creepy spooky juju going on, and you need to tread very carefully, or your soul will become cursed.

Let's step back and look at a different problem first. Consider this class which doesn't do anything interesting but works well enough for demonstration purposes:

class Sample1 {
private StreamReader sr;
public Sample1(string file) : sr(new StreamReader(file)) { }
public void Close() { sr.Close(); }
public string NextLine() { return sr.ReadLine(); }
}

What happens if one thread calls Sample1.NextLine() and another thread calls Sample1.Close()? If the NextLine() call wins the race, then you have a stream closed while it is in the middle of its ReadLine method. Probably not good. If the Close() call wins the race, then when the NextLine() call is made, you end up reading from a closed stream. Definitely not good. Finally, if the NextLine() call runs to completion before the Close(), then the line is successfully read before the stream is closed.

Having this race condition is clearly an unwanted state of affairs since the result is unpredictable.

Read more: The old new thing

Posted via email from .NET Info

SQL SERVER – Finding the Occurrence of Character in String

|
This article is written in response to provide hint to TSQL Beginners Challenge 14. The challenge is about counting the number of occurrences of characters in the string. Here is quick method how you can count occurrence of character in any string.

Here is quick example which provides you two different details.

How many times the character/word exists in string?
How many total characters exists in Occurrence?
Let us see following example and it will clearly explain it to you.

DECLARE @LongSentence VARCHAR(MAX)
DECLARE @FindSubString VARCHAR(MAX)
SET @LongSentence = 'My Super Long String With Long Words'
SET @FindSubString = 'long'
SELECT (LEN(@LongSentence) - LEN(REPLACE(@LongSentence, @FindSubString, ''))) CntReplacedChars,
(LEN(@LongSentence) - LEN(REPLACE(@LongSentence, @FindSubString, '')))/LEN(@FindSubString) CntOccuranceChars

This will return following resultset.

CntReplacedChars     CntOccuranceChars
-------------------- --------------------
2                    2

Read more: Journey to SQL Authority with Pinal Dave

Posted via email from .NET Info

Different ways to get Identity of New Inserted Rows in SQL Server

|
There are different methods to know the Identity Value of a newly added row.

Let us consider the following example:

--Create a Table
CREATE TABLE test
(
id int identity(1,1),
names varchar(100)
)

--Insert Data
INSERT INTO test(names) SELECT 'testing'

--Get Identity Value that is Populated in the Current Scope
SELECT scope_identity()


--Get Identity value that is Populated in the Current Session
SELECT @@identity

--Get Identity value that is Populated in the Table
--Regardless of Scope and Session
SELECT ident_current('test')

Note that first two methods wont give correct values if data are added to the ‘different tables’

Read more: SQL Server

Posted via email from .NET Info

Extended WPF Toolkit – New RichTextBox Control

|
There has been a new control added to the Extended WPF Toolkit project on CodePlex called the RichTextBox.

The RichTextBox extends the System.Windows.Control.RichTextBox control that represents a rich editing control which operates on FlowDocument objects. The RichTextBox control has a Text dependency property which allows a user to data bind content to the RichTextBox.Document property. The RichTextBox control introduces the concept of Text Formatters. Text Formatters allows a user to format the content of the RichTextBox control into any format of their choice. Three Text Formatters are included; PlainTextFormatter, RtfFormatter, and a XamlFormatter. The RtfFormatter is the default Text Formatter. A user can create their own custom Text Formatter by creating a class that inherits from ITextFormatter and implimenting the contract accordlingly.

Usage

When data binding to the Text property, you must use the Text Formatter that matches the format of the underlying data. If your data is in RTF you must use the RTF formatter. If your data is in plain text, you must use the PlainTextFormatter.

Read more: <ELEGANTCODE>

Posted via email from .NET Info

NHibernate Visual Designer from Mindscape

|
The developers at Mindscape have a fantastic Visual Designer for their LightSpeed O/R Mapper that integrates into Visual Studio. I absolutely love the roundtrip synchronization between the database and domain model as well as the added support for refactoring, inheritance, migrations, etc. The number of features and ease-of-use shows Mindscape's deep commitment to making the developer experience as productive and pleasurable as possible.

The other day they released a separate product, called NHibernate Designer, that offers similar functionality for those developers using the NHibernate O/R Mapper. Again, this is a Visual Designer that quickly and easily integrates within Visual Studio and allows you to do model-first development using the designer or reverse engineer tables from a database.

Read more: David Hayden

Posted via email from .NET Info

Get GC Information in Silverlight

|
To demonstrate this I used the bing’s world leader search page and here is the url

http://www.bing.com/visualsearch?q=World+leaders&g=world_leaders&FORM=Z9GE74#

Steps to get the GC information are

  1. Start a cmd or powershell  as admin , this required to collect ETW tracing
  2. Browse the above mentioned webpage using IE
  3. Issue the command “PerfMonitor.exe /process:4180 start” where 4180 is the internet explorer’s process id
  4. Do the necessary actions
  5. Then issue “PerfMonitor.exe stop”
  6. The command to get the report “PerfMonitor.exe GCTime”. This will generate a report and open it in the browser

Perfmonitor is like xperf for managed code. This is non-intrusive and can collect some valuable information in production. This is an xcopy tool and does not need an install.

Read more: Naveen's Blog

Posted via email from .NET Info

Got Error 0x80070520 When Binding Certificate to Web Site on IIS 7

|
One of my customers had a problem when using one certificate on IIS 7. This certificate once been used on IIS 6 and it works fine. This means there is no problem with the certificate itself.

Here are the steps. Open the IIS MMC, open the Site Bindings, and then add a HTTPS binding. Select this certificate from the certificates drop down list, and click OK. Then, got follow error:

A specified logon session does not exist. It may already have been terminated.
(Exception from HRESULT: 0x80070520)

There was no problem using other certificates in the drop down list. Using CertUtil command to verify the certificate, we got error s like the Encryption test failed for the certificate imported.

The problem is due to Administrators group doesn’t have permission to access the private key file which is under "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys". By default, administrators group and system account have full control for this folder. This was resolved by giving administrators group full control to this folder.

Reference:
278381  Default permissions for the MachineKeys folders
http://support.microsoft.com/default.aspx?scid=kb;EN-US;278381

Read more: AsiaTech: Learning by Practice

Posted via email from .NET Info

Hosting a WCF REST Service with WebServiceHost

|
WebServiceHost  factory helps us to host a WCF REST Service in  managed application.  This class is derived from ServiceHost class and automatically enables webHttpBinding  and webHttpBehavior on the service End points.

In this article, I will explain

  1. What is WebServiceHost Factory class?
  2. What is its function?
  3. Where to use it?
  4. One sample on hosting WCF REST Service using WebServiceHost.
What is WebServiceHost factory?
  1. This is useful to host WCF REST End points.
  2. This is derived from ServiceHost.
  3. WebServiceHost has some extra functionality.
  4. WebServiceHost works exactly the same way ServiceHost works.

WebServiceHost factory perform following special task
It disables meta data
It disables WSDL
It disables end point
It prevents meta data publishing
Autometically create End Point
It autometically creates the end point for all contracts using webHttpBinding
No need to call AddServiceEndPoint
Autometically add WebHttpBehaviour
It adds behavior to all end point adding behavior ensures URI+Verb routing will work for all incoming requests

Posted via email from .NET Info

My new home page, rejuvenated [Updated collection of great Silverlight/WPF/Windows Phone Data Visualization resources!]

|
It's been a few months since I posted my previous collection of Silverlight/WPF Charting links. In the meantime, the April 2010 release of the Silverlight Toolkit was published with support for stacked series and significant performance improvements! And Windows Phone 7 has been steadily building momentum - it's handy that the Data Visualization assembly also works on Windows Phone!

So there's lots of good stuff - here are all the links (FYI: previously published links are gray):

Overviews (100 level)

Scenarios (200 level)


Read more: Delay's Blog

Posted via email from .NET Info

SQL Server - Writing IF-ELSE code in TSQL

|
IF..ELSE clause in SQL Server is used for decision making. You can use it to run a set of statements based on certain conditions. The following are the examples on how to use it effectively for various purposes.

declare @status bit
set @status=1
if  @status=0
print 'The event is closed'
else
print 'The event is started'

if @status=0
Begin
print 'use id column in the where clause'
select * from #t where id=2
End
else
Begin
print 'use names column in the where clause'
select * from #t where names='Suresh'
End

Read more: Beyond Relational

Posted via email from .NET Info

LightSwitch Architectural Overviews

|
Last week we announced LightSwitch, a new tool for developers to make it easier to build line of business applications.  You gave us a lot of great feedback, thank you for all of the comments and questions!  One of the key requests was to provide more information about the architecture of the applications that are built with LightSwitch.  The team has been working hard to publish a set of material on this which I wanted to share with you, including the top level architecture topology:

1376.LightSwitchApplicationOverview_5F00_thumb_5F00_1B69D27B.png

Read more: Jason Zanders Weblog

Posted via email from .NET Info

Step-by-Step Guide to create a File Explorer in Silverlight 4

|
Table of Contents
Introduction
Background
Basic knowledge on the API
Prerequisite
Setting up Project
Configure Application for Out-of-Browser Support
Configure Application for "dynamic" keyword Support
Play with the XAML
Create the basic UI
Create the Template for drive selector
Create the Template for folder browser
Implementing Code
Create the basic classes
Create Dependency Properties
Implementing GetDriveInfo() method
Implementing GetFolders() method
Implementing GetFiles() method
Integration of API calls to the page
What Next?
End Note

Introduction

You all know that, Silverlight 4 has the feature to talk with COM APIs. In my earlier posts I already mentioned various Interoperability functionalities of Silverlight. You can see some articles I have written here. In this article, I will show you how Silverlight can read your local files, folders and drives. At the end of this Article you will be able to open any file/folder/drive and read their attributes. Here I will demonstrate by creating a small application like Windows Explorer and reading all your drives and their contents

Read more: dot net spark

Posted via email from .NET Info

Automatic Authentication with the Request Builder

|
The Request Builder feature in recent versions of Fiddler includes a number of enhancements, including the ability to follow HTTP redirections, and to automatically authenticate (using the current user's credentials) to servers that demand authentication using the NTLM or Negotiate (NTLM/Negotiate) challenge-response protocols. Following redirections is simple enough, but properly constructing a response to a server's Negotiate authentication request entails some very complicated code. The problem is that while .NET can automatically add credentials to HTTPWebRequest objects, there's no trivial way to calculate the challenge-response string when you're using a socket directly (as Fiddler does).

Fortunately, a (now-defunct) blog post from "Jeff" suggested a hack that works rather well—use Reflection to grab internal fields (including the challenge-response string) from a dummy WebRequest object. While using Reflection to grab internal fields is inherently fragile (e.g. subject to breakage in updated versions of the framework) this particular trick appears to work reliably in both .NETv2 and .NETv4 frameworks.

Each Fiddler session keeps a dummy WebRequest variable which is not initialized by default.

private WebRequest __WebRequestForAuth = null;
If, however, the server returns a WWW-Authenticate header demanding NTLM or Negotiate, and the Session Flag x-Builder-AutoAuth is present on the session, then the object will be initialized, with the current session's URL:

if (null == __WebRequestForAuth)
{  

__WebRequestForAuth = HttpWebRequest.Create(this.fullUrl);
}

Then, we use Reflection to get the Authorization String we'll be adding to the request

try                
{                    

#region Use-Reflection-Magic-To-Tweak-Internals                    
Type tWebReq = __WebRequestForAuth.GetType();
tWebReq.InvokeMember("Async", BindingFlags.Default | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetProperty, null, __WebRequestForAuth, new object[] { false });

object objServerAuthState = tWebReq.InvokeMember("ServerAuthenticationState", BindingFlags.Default | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.GetProperty, null, __WebRequestForAuth, new object[0]);                    
   
if (objServerAuthState == null) throw new ApplicationException("Auth state is null");

Type tAuthState = objServerAuthState.GetType();
tAuthState.InvokeMember("ChallengedUri", BindingFlags.Default | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetField, null, objServerAuthState, new object[] { new Uri(this.fullUrl)});                    

Posted via email from .NET Info

Issues using Response.Redirect in Silverlight

|
I was working with one of customer's today, on a Silverlight application. The customer wanted to make the browser redirect the client to a different URL. As in the current scenario the re-direction was to be made to an internal Silverlight Page within the application we had to use something like-

Response.Redirect();http://localhost/SilverlightSampleTestPage.aspx#/About

In the above example we are trying to redirect to About page.

The application worked liked a charm until it was noticed that when redirected to the About page, the About page would get loaded twice. In order to confirm the same, we used Fiddler which helped us confirm the behavior.

On further investigation it was found that Response.Redirect causes the browser to do a fresh navigation rather than fragment navigation. Due to this Internet Explorer demands for a new copy of the file and hence loads it twice. This is by design.

As the behavior cannot be changed, the following workaround can be used-

1)      Create an initialization parameter, for example initparam.
2)      Assign the page name to which the re-direction is required, to the value attribute, example value="link=/About"
3)      Write the following code to redirect to the new page mentioned in the value attribute

Application.Current.Host.NavigationState = App.Current.Resources["link"].ToString();
4)      This will help us, get the same results as Response.Rediect without the issue of the page loading twice.

Read more: User Interface Support Team Blog

Posted via email from .NET Info

WPF Inside Out: Dispatcher

|
Back in this post I showed you how you can have a look at the original source code of .NET, including original comments and variable names. In this post we’ll see a few interesting things about WPF’s Dispatcher class.  But first some background on the subject.

WPF Thread Affinity

Almost every WPF element has thread affinity. This means that access to such an element should be made only from the thread that created the element.
In order to do so, every element that requires thread affinity is derived, eventually, from DispatcherObject class. This class provides a property named Dispatcher that returns the Dispatcher object associated with the WPF element.

The Dispatcher class

The Dispatcher class is used to perform work on his attached thread. It has a queue of work items and it is in charge of executing the work items on the dispatcher thread.

So, when you want to change a property of a WPF element from a thread different of the one who created the element, you should use the element’s Dispatcher property to dispatch the operation to the correct thread. This is done using the BeginInvoke method that accepts a method to be invoked.

Where is the Dispatcher of the thread saved?

Every thread should have their dispatcher object, so you would think they will save the dispatcher on the Thread Local Storage (TLS).

It turns out they store a static list of all available dispatcher objects.
Of course, this list is synchronized using a private global static object (this is a common best practice when locking object).

Whenever the dispatcher of an object is needed, they go over the list, comparing the dispatcher’s Thread property with the current thread, until they find the correct dispatcher object for this thread.

The reason, as they note in the comments is that managed TLS is rather expensive.

Above this list they add the following optimization: before going over the dispatchers list they check if the last given dispatcher is suitable, so only a thread context switch will derive a new list search.

Read more: Arik Poznanski's Blog

Posted via email from .NET Info

כיצד לגרום להתקנת תוכנה בעת לחיצה פעמיים על סיומת של קובץ לא מוכר באמצעות Group Policy – שתי דרכים

| Sunday, August 15, 2010
דרך ראשונה – שימוש באופציה של Software Instllaton : 

ב GPO ברמת ה Software Installation לא כל מוצר נועד להפצה בדרך זו, ולכן המוצר לא רושם את הסיומות במאפייני המוצר תחת ה Software Installation, במקרה הזה לא נוכל להשתמש באופציה של ההתקנה אוטומטית בעת לחיצה על סיומת הקובץ. אציג כאן דרך לרישום המוצר ע"י עריכה באמצעותADSIEDIT . אתן דוגמא למוצר Acrobat Reader של חברת Adobe. על מנת להפיץ את המוצר יש צורך להמיר את קובץ ההתקנה של ה Reader לקובץ עם סיומת MSI.  אין צורך בתוכנה צד שלישי לצורך פעולת ההמרה.  במאמר זה, אדגים את הפריסה על מוצר מגירסא 9.33.  נעזרתי במאמר הבא לצורך הפריסה, ניתן לעיין גם כאן:

בגדול כל מה שעלינו לבצע, לאחר הורדת קובץ ההתקנה של ה Reader, זה להעתיק את הקובץ על שולחן העבודה ולהשתמש בארגיומנט –nos_ne, להלן הפקודה:

"%UserProfile%\Desktop\AdbeRdr933_en_US.exe" -nos_ne


Read more: הבלוג שלי

Posted via email from .NET Info

Writing optical discs using IMAPI 2 in powershell

|
Today I’m going to show how to use Image Mastering API (IMAPI2) in powershell. I’m using that technique when need quickly to burn some data, in format, which is not exposed by default in Explorer. This also can be useful if you are developing some code on IMAPI2 and need some proof of concept, if that can be done using build-in windows image mastering API.

IMAPI2 is written using COM, so no additional wrappers/interops required in order to get it working in powershell. The advantage of IMAPI is the possibility to write to different medias, for example to CDRW So, let’s begin:

First of all you'll need to build in memory file system image, which will contain your files. There are few steps to achieve that:

Create file system object
PS C:\Temp> $fsi = New-Object -ComObject IMAPI2FS.MsftFileSystemImage
Select appropriate settings like File System type, revision and so on
To view current state of any object you can just type its name in PowerShell:
PS C:\Temp> $fsi
PS C:\Temp> $fsi.FileSystemsToCreate = 7
PS C:\Temp> $fsi.VolumeName = "MyImage"
Add files to your file system:
PS C:\Temp> $fsi.Root.AddTreeWithNamedStreams("C:\test\imt\data\2tracks")
Create result stream, that will contain your data in required format:
PS C:\Temp> $resultimage = $fsi.CreateResultImage()
PS C:\Temp> $resultStream = $resultimage.ImageStream
Actually at this step you can stop and save resulted image to the local hard disc, this will be a pure iso image.

To perform writing disc recorder needs to be initialized:

Enumerate available recorders through MsftDiscMaster2
PS C:\Temp> $dm = New-Object -ComObject IMAPI2.MsftDiscMaster2
Create DiscRecorder object
PS C:\Temp> $recorder = New-Object -ComObject IMAPI2.MsftDiscRecorder2
Initialize recorder with unique id from discmaster2
PS C:\Temp> $recorder.InitializeDiscRecorder($dm.Item(0))

Read more: OpticalStorage

Posted via email from .NET Info

NHibernating a WCF Data Service

|
WCF Data Services ships with two built-in query providers, a query provider for Entity Framework that uses the CSL model to infer all the service metadata for the exposed entities and their associations, and another provider, a Reflection Provider that uses .NET reflection over the exposed object model to infer the same metadata.

The Entity Framework provider is usually the one that most people use for its simplicity. The simplicity of this provider resides on the fact that you actually don’t need to do much for getting a data service up and running. You only need to define a entity framework model and expose it in the data service using the DataService<T> class.

The Reflection Provider on the other hand requires some more work, as you also need to implement the IUpdatable provider if you want to make your model read-write (otherwise, it’s read-only by default).

While the Entity framework provider is simple to use, the resources you want to expose in the data service gets tied to all the limitations you find in an Entity Framework model (for instance, you might entities or properties you don’t really want to persist in a database). This provider also implements IUpdatable and that implementation can not be customized, extended or replaced for providing some additional business logic functionality in the data service. And although you can use interceptors, I find that technique very limited as they represents aspects that are applied to a single entity. There is no way to inject cross-cutting aspects that affect all the entities (Entity based Authorization for instance). You can use the Data Service Pipeline for injecting that logic, but you don’t have entities at that point, only the messages on the wire (atom feeds or json messages). A technique I used in the past was to extend the EF entities with partial classes to add some additional business logic to the entities, and attach the data service to the Saving event in the Entity framework to run some logic before the entities were created, updated or deleted. However, I still don’t like this technique much because you end up with a model totally limited to what you can define in EF.

The advantage of using the reflection provider is that you can expose a much rich object model in your data service, even if you need to write some more code. In addition, as you are also writing an IUpdatable implementation, you can inject all the business logic or cross-cutting concerns that are common for all the entities in that class. However, the problem with the reflection provider is to make the service implementation efficient enough to resolve the queries in the data source and not the memory. It does not make sense at all to use a rich object model on top of entity framework for instance, if you still need to load all the object in memory to use linq to objects to perform the queries (unless the number of entities you manage is really small). So, the only possible solution to implement a service that manages a large number of entities and expose a rich object model at the same time is to use an ORM other than EF, like Linq to SQL or NHibernate.

NHibernate in that sense is a much mature framework, you are not tied to a single db implementation (sql server), and the number of features that this framework can offer is obviously higher, making NHibernate a good technology for implementing data services. In addition, NHibernate 3.0 already ships with a Linq provider out of the box that works really well (Entity Framework Code Only looks promising too but it is a CTP at this point).

In order to use NHibernate in a data service, you need to provide an IUpdatable implementation for making it read/write (support for POST PUT and DELETE). Otherwise it will behave as read only by default (only GETs supported).

Read more: Pablo M. Cibraro (aka Cibrax)

Posted via email from .NET Info

Silverlight Startup Best Practices

|
Introduction
Startup is important because it is the first interaction that your user has with your application.  You get one chance to impress, and failure to do so could mean the user closing and/or uninstalling your application permanently.  What follows is a set of tips and tricks you can use to supercharge the startup path of your Silverlight application.


The Cardinal Rule
There is, essentially, a single cardinal rule.
    Do the absolute minimum required to display your main screen.


Write this on a sticky note and hang it on your monitor.  This may seem like common sense (I like to think so), but I’ve analyzed many an application that violates this rule in more ways than one.  The less deterministic the code is that you’re executing, the more you’re asking for trouble.  To subdivide this rule into some specific examples:
Minimize your download size.
Never wait on network I/O before displaying your main screen.
Minimize disk I/O, delay-load any data or business logic that you can.


Minimize your download size
Since your application has to be downloaded before it can start up, your download size directly affects startup time.  Consider dividing your application into multiple XAP files.  The first XAP should include only what is necessary to display your main screen and provide core functionality.  Tim Heuer has put together a great video on silverlight.net titled “Loading Dynamic XAPs and Assemblies” that explains this concept in detail.  Use this method to componentize and delay load parts of your application that pull in large dependencies and/or don’t absolutely need to be available when your application starts up.


Another great tip on Silverlight XAP compression comes from David Anson.  A Silverlight XAP is just a renamed Zip file, but as of Silverlight 4 our XAP compression algorithm isn’t as efficient as it could be.  By simply re-zipping your XAP files using an optimal compression algorithm you can shave about 20% off your download size (as high as 70% in extreme cases).  Check out David’s post, “Smaller is better!” for the details and a useful script to help you automate the process.


Never wait on network I/O
No-doubt, this is one of the riskiest things you can do during startup.  Network I/O latency is non-deterministic; when you make a call to a web service or access data from a network share your request could return in 2 milliseconds, 2 seconds, 2 minutes, or it may never return at all!  If your application waits for this data to be retrieved before showing your UI, it may never show up.  At best, you are gambling on the speed of your network connection to determine your startup time.


Minimize disk I/O
When you increase the amount of data that you load from disk (whether raw data files or loading unnecessary assemblies) you increase the amount of time that you’re waiting for physical media.  It takes a substantial amount of time for your hard disk to seek to each new read location, and it takes time to read the data once you seek there.

Read more: Silverlight Performance Blog

Posted via email from .NET Info

SQL Compact ASP.NET Membership provider

|
Project Description
Implementation of a ASP.NET Membership provider for SQL Server Compact 4.0, for use with Forms Authentication for web sites using only SQL Server Compact 4.0. This project provides files that contain a Membership provider, a Role provider for ASP.NET and a SQL Compact database.

How to use the provided files

1. Change SqlCeMembershipProvider::encryptionKey to a random hexadecimal value of your choice.
2. Copy the three files in the /App_Code folder to your web sites' ~/App_Code folder.
3. Copy the /App_Data/SqlCeAspnetdb.sdf database file to to your web sites' ~/App_Data folder.

Read more: Codeplex

Posted via email from .NET Info

ASP.net MVC HTML5 Helpers Toolkit

|
The ASP.net MVC HTML5 Helpers Toolkit contains a rich set of controls that you can use to build ASP.net websites using HTML5. Harness the power of HTML5 and start using it in your applications. It's lightweight and can be a great step in getting your website up to speed with HTML

Read more: Codeplex

Posted via email from .NET Info

“Fade in” Screen in Silverlight 4

|
I’ve had a couple request to create a fade in screen using Silverlight/Expression Blend 4 and decided that I would add it to my blog. The whole point of this application, is to present information to the user and once they click on the screen for it to appear in the background. This could be used in numerous ways for a business application. (click to shop, click for more info, etc).

Before diving into this, I did not want multiple XAML pages and chain them together. I wanted to use some of the built in behaviors and states and use no procedural code.

You may want to see a demo of this live before reading further. You can check it out here: http://mbcrump.web01.appliedi-labs.net/fadein/Default.html

To get started, we will create a new Silverlight 4 application using Expression Blend 4. After we create the application, we will add 2 buttons and it will look like the following. Pretty simple right? I went ahead and added names and a background color but this is completely optional.

image_thumb_10.png

Read more: Michael Crump

Posted via email from .NET Info

Debugging Silverlight in Firefox

|
Just a little tip I learned recently but if you are an avid firefox user and you want to debug Silverlight 4 applications in the firefox browser, then here are a few steps you need to take to make that happen, since it doesn't work right out of the gate.

Step 1
In firefox, at the address bar type "about:config" without the quotes. If done correctly you will see a little warning.

Step 2
Accept the warning. Tell it you will be careful, you promise.

Step 3
In the filter field, type "dom.ipc.plugins.enabled.npctrl.dll" and you should see only 1 entry.

Step 4
Change the value from "true" to "false". You can do this by just double-clicking the entry.

Step 5
Restart the browser and you should be good to go.

Of course you could ignore all that and manually attach the visual studio debugger to "plugin-container.exe" but that would be painful and the above way is much easier.

Read more: XAMLmammal

Posted via email from .NET Info