.net

Where to put extensions to a static class in a library? (in C#)

Although my question is about C# in general, I'll ask it by giving a concrete example. I have written a function EnsureDirectoryPresent, which is an extension of the System.IO.Directory class in .NET's BCL library. Where can I best put this new function? Conceptually the method is an extension method to the Directory class. Regrettabl...

determining when a db4o backup has finished

How can I know when a db4o started from code has finished? Doc mentions it does the backup in a separate thread, but doesn't mention anything about when it finishes. The method doesn't receives any callback. ...

Howto observe converted collections?

I bind a collection ObservableCollection<Foo> to a dependency property on my controller, but I run it through an IValueConverter to make it ObservableCollection<object> instead, which is what my controller expect. The conversion works fine - I create an ObservableCollection<object> and fill it with all the Foo's from the original list. T...

Injecting resources into the manifest of a .NET assembly post-build

Is there a way for me to insert a resource into the manifest of another assembly? I've been experimenting with MSBuild and ILMerge but apparently a resouce assembly created by the Assembly Linker can not be merged wtih ILMerge, looks like ILMerge cant do a resource only merge. al /out:Resources.dll /embed:Test.txt,Resources.Test ilme...

Control inheritance for consistent look and feel in a Windows Forms application

Hi, I am building a windows forms application where a very consistent look and feel across all modules is of very high priority. Apart from standard .NET controls it uses a lot of third party controls from different vendors. I would like to have the ability to change the entire look and feel of the application in one go, may be with up...

can I use using(var scope = new TransactionScope()) with Postgres ?

I'm doing using(var scope = new TransactionScope()) { //lots of calls to sql server scope.Complete(); } and it works like a transaction I would like to know if it is going to work the same with postgres ? ...

VS2010 DSL samples

I want to create my own DSL but working with DSL Definition is confusing. Where can I find some samples? ...

Mixing VB5 and C# in a Windows Form application

I'd like to add a window to my application. Is it possible to "extend" an old vb5 project using C#? Is it easy to do and maintain and is it a good practice ? If not, what are the alternatives? ...

Jquery extensions for asp.net mvc

Are there any jquery extensions available for asp.net mvc? I'm looking for adapters which can be used instead of having to write all javascripts manually. for instance: just include jqgrid script in the master page, call CreateGrid extension metod to define the grid and return a JqGridActionResult from an action to populate it. I found ...

What do 2 brackets in a row mean in xaml.cs ?

Just started learning C# (in xaml), so appreciate some elaboration: ((MSAvalon.Windows.Serialization.ILoaded)(_Text_2_)).DeferLoad(); Not sure what all the round brackets means... does it mean "_Text_2_" is a child of object "MSAvalon.Windows.Serialization.ILoaded" ? and if so... why not just something like: MSAvalon.Windows.Seriali...

what "Weborb for .NET" version am I *really* running?

the header on my console says v4.1.0.0, but I would swear I had previously installed v4.1.0.1, but that WAS a while ago, and now I'd like to be certain I've upgraded. Anybody know a way to figure this out? ...

how to send my datagridview's data Same data to crystal report ?

i have a datagridview same Data to send to crystal report. i need this datagridview data to crystal report and print data ...

Is reading a double not thread-safe?

Update: I just stumbled upon this in Eric Lippert's answer to another question (he is quoting the spec): Reads and writes of other types, including long, ulong, double, and decimal, as well as user-defined types, are not guaranteed to be atomic. OK, so reading a double is not atomic. This means the value could get modified ...

Side By Side ClickOnce Installations

I would like to deploy a TEST version of my internal application to my testing group and I need it to install side by side with the current LIVE version. I changed everything in the Publish Options but it STILL overwrites my LIVE install. What else do I need to do? Do I have to change the Assembly Name on the Application Tab? Is tha...

LINQ where clause running against mapped object

If I want to run something like this BLL.Person person = (BLL.Person)repository.Single(item => item.Id == Id); Down in my single method I'd do something like this: public Resource Single(Expression<Func<BLL.Resource, bool>> where) { Resource resource = AsQueryable().FirstOrDefault(where); return resource; } protected IQuer...

Can a FormsAuthenticationTicket survive an app pool recycle?

I am looking for a solution where we can make a FormsAuthenticationTicket (and corresponding cookie) with a very long expiration period. This is possible by setting a high value or using a sliding expiration, but when the application pool of the website is recycled, the FormsAuthenticationTicket disappears (I think), the cookie gets inva...

Assembly Binding Warning

I copied over my project to another PC. I have a reference to a assembly on my project. On this new PC, a higher version of this referenced assembly exists. I keep getting a warning each time I compile. The warning is along these lines. C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3247: Foun...

Good field names that work for both Rails and .Net apps

I'm really thinking that in the years ahead, I will be creating internal apps in both Rails and .Net Entity Framework that will need to work nicely again the same SQL Server or MySql database tables. At this point I'm pretty much greenfield in the table designs, so I can name my columns anything I want to. I've studied Rails and .Net E...

How to force usage TLS instead of SSL in .Net

How can I force my .Net application to establish connection with some Java Web Service using TLS instead of SSL ? Proxy to Web Service is generated as standard Web Reference (not WCF). Web Service url is https://........ . Some details: From my .Net 4.0 application I'm invoking Java Web Service hosted on JBoss & Redhat. This web servi...

How can I efficiently and easily import/export large business data in .NET ?

Hi, What would be the best data format (XML, Database, etc.) for large business data when we want to efficiently and easily load all of it (import) into business objects in .NET ? I want to load all the data in one go and create all business objects. The data must have a kind of a "schema" to enable other people to create it. Also n...