.net

What does the file security.config.cch do with the CLR ?

I've been experiencing nasty lockups while debugging under VS2008, SP1 on my machine. I was running ProcMon.exe to try and determine what is going on. One thing I see is 100s or 1000s of repeated reads + writes to a file called security.config.cch and security.config.cch.new. What are these files? Why would my application need to r...

How do I get all the base types in an assembly?

So if I have an instance of System.Reflection.Assembly and I have the following model: class Person {} class Student : Person {} class Freshman : Student {} class Employee : Person {} class PersonList : ArrayList {} class StudentList : PersonList {} How can I enumerate the assembly's types to get a reference to only the Person and...

How do I get all the bottom types in an assembly?

This is sister question to this one If I have an instance of System.Reflection.Assembly and I have the following model: class Person {} class Student : Person {} class Freshman : Student {} class Employee : Person {} class PersonList : ArrayList {} class StudentList : PersonList {} How can I enumerate the assembly's types to get a...

Is there a built-in way to handle multiple files as one stream?

I have a list of files, and i need to read them each in a specific order into byte[] of a given size. This in itself is not a problem for a single file, a simple while ((got = fs.Read(piece, 0, pieceLength)) > 0) gets the job done perfectly fine. The last piece of the file may be smaller than desired, which is fine. Now, there is a tric...

.NET client vs. ActiveX (or another approach?)

Does anyone have any white papers or articles that would compare and contrast a web architecture where a .NET client component is required and the options being considered are ActiveX or a .Net component solution? I have a customer that wants to architecturally recommend a .Net client approach over Active X. However, there are some st...

C# Managed Thread Cleanup

After my application creates a thread using a ParameterizedThreadStart delegate, that thread performs some initialization and runs to completion. Later on, I can observe that this thread is no longer active because its IsAlive property is false and ThreadState property is ThreadState.Stopped. Once a thread reaches this state they rem...

How do you keep user.config settings across different assembly versions in .net?

Basically the problem is that each time the assembly version changes (i.e. the user installs a new version of the application) all their settings are reset the the defaults (or more accurately a new user.config file is created in a folder with a different version number as the name) How can I keep the same settings when upgrading versio...

Good example WPF applications

I'm just starting to learn WPF and am interested in seeing some sample applications. These can either be applications written entirely for showcasing WPF features, or real-world applications written in WPF. Obviously the source code would need to be available. Does anyone have any suggestions? ...

WinForms: Design vs Code

I am a solo dev building a WinForm App, C# & .Net 3.5, in VS2008. It is, essentially, a glorified data entry and retrieval application. My question is, Is it normal to spend %60 + of my time on "design"? The UI, placing all the controls, naming the controls something intuitive, setting properties on the UI controls(Modifier, onFocus...

Simple Http proxy using Sockets: Questions

Hello, I'm trying to learn how sockets works in C#. My idea was to program a simple http proxy: Here's my code: using System; using System.IO; using System.Net; using System.Net.Sockets; using System.Text; using System.Text.RegularExpressions; using System.Threading; class Program { static void Main(string[] args) { Th...

Querying on Collection with Nhibernate Criteria Api ?

Hi, I have an "Estate" entity, and this entity has a collection "EstateFeatures"(type:EstateFeature) and EstateFeature has a property "MyFeatureValue". Note: These are the limited properties for the question. All Entities has an Id and all necesarry etc Estate IList<EstateFeature> EstateFeatures; EstateFeature FeatureValue MyFeat...

How do I invert BooleanToVisibilityConverter?

Hi, I'm using a BooleanToVisibilityConverter in WPF to bind the Visibility property of a control to a boolean. This works fine, but I'd like one of the controls to hide if the boolean is true, and show if it's false. Is this possible? Thanks, Andy ...

Hosting .NET method in SQL Server CLR

I have been asked to create a function in SQL Server 2005 that is a CLR hosted function I have created in .NET 3.5. Do CLR functions hosted in SQL have access to App.Config files or do all config options need to be passed as paramaters? ...

How can I get the size of a POST request in javascript?

Is there any way to get the size of a POST request in javascript? I want to check the size of a file before uploading it via a c# handler so I can tell the user to upload a smaller file. Thanks in advance. ...

Are LINQ generated classes POCOs?

Are the classes generated by LINQ (DBML) considered POCOs? If I add static queries to these classes, are they still POCOs? I imagine it changes once I start doing business things in the LINQ partials. Such as adding other attributes, creating collections and basically making the partials more than DAL classes. If the LINQ classes ar...

File Permissions Dialog via .NET

How can I launch the standard file permissions dialog from a .NET application? Can't seem to find any example of this anywhere. I don't want to programmatically set file permissions, I want to let a user set them via the dialog. ...

Does a WPF .NET 3.0 Date Picker exist?

I am trying to find a WPF 3.0 date picker control. What can you recommend and where is it? ...

Team is Going from XP32 to XP64 for .NET Development - Any Gotchas?

My team is getting new XP64 workstations. We've been using XP32 up until now. Most of our work is done in managed C#/VS2008/.net 3.5 and SQL Server 2005. However we do have a couple apps that are still in VS2005/.net 2.0. The majority of our applications are ASP.NET webforms apps and WCF services that are running on 64bit servers in prod...

LINQ Join On Between Clause

Hello All, I am having some issues throwing together a LINQ query that will join a table based on a zip code. I need to join the table based on whether the customer's zip code lies with in a range of zip codes that is determined by ZIPBEG and ZIPEND columns. The T-SQL would look something like this: JOIN [ZipCodeTable] [zips] O...

.NET: ListView blues?

Selection count, .SelectedItems.Count, does not change when the Selected property is set to true on an item in the Items collection of an ListView. Example: lvPept.SelectedItems.Clear() lvPept.Items(6).Selected = True Dim newLen As Integer = lvPept.SelectedItems.Count lvPept is a ListView and contains 10 elements. newLen is ...