.net

Deserialization error in MEF due to missing assemblies

I'm using MEF. I serialize one of the objects which relies on one of the loaded assemblies. Now when I try to deserialize this object it throws "Unable to find assembly" exception. MEF loads the assemblies before this deserialization in another class (I assume that the scope of this is application wide, it loads them into a public prop...

Unhandled Exceptions Crashing VS 2008

In the last few weeks, I've had two occasions where the debug process (vshost.exe) crashes due to an unhanded exception. The first was trying to use the Activator class to instantiate an object, I don't remember details, and today was trying to load a custom config section where I had erred in specifying the type for the section. In bo...

C# app.config problem - ConfigurationErrorsException: Unrecognized element 'setting'

Some background: I have a windows service with 5 web references, Everything works great in several environments Dev,Test,QC. Dev and Test are running windows 2003, QC and PROD windows 2000. We pushed the service to production with the same set of assemblies and config files and are receiving this error. The exception is not consistent th...

Why can't strongly named assemblies use assemblies that aren't signed?

To sign an assembly A you have to make sure all assemblies B, C, D that are used by A are signed, and then all assemblies that are used by B, C, D, and so on. I don't understand what's the security benefit of this. I think it's supposed to prevent tampering, but assembly A is allowed to open any file, and these can be tampered. The same ...

ListView scrollbar messes up my layout

Hi all, I have a WPF ListBox that typically shows 4 or 5 items. For my application that means I almost never have to display a scrollbar (there is enough space). However, in case there are more items in the list, I need to show the vertical scroll bar, but as a result my content has less space and doesn't look nice anymore on a "backd...

Move WCF service from test console app to IIS

Hi, I've been building a WCF app behind 3 projects (contract,implementation,client) I've hosted my service as a console app with basic HTTP binding. I'm now ready to move it to IIS. However, the tutorial for creating a .svc file shows it actually implementing the contract - but I already have an implementation. How do I just redirect to...

DotZlib - Inflate error handling code 1 Z_STREAM_END

Hi, I am using a slightly modified version of the DotZlib which is part of the contrib directory with the zlib source code to inflate a realtime data stream. Instead of the regular inflateInit I need to use InflateInit2 - but this the only difference to the provided library. Netherlesse after a couple of reads I receive error code 1 fr...

why are user controls not collected by Gargabe Collector?

I have a large .NET C# application with a memory leak. Using ants memory profiler, I can see that there are multiple versions of same user controls in memory and the garbage collector is not collecting them. There is output caching on the web forms but no output caching on the actual user controls. Is there a reason why the user contro...

Any experience/opinion about CCI (Common Compiler Infrastructure)?

Hi, If you have any real-life experience with CCI (CciMetadata or CciAst) then please share it so I don't start on a blind alley. I'm interested in the metadata model (is better than System.Reflection for analysing types in assemblies?) and the AST model (is it usable as a base for a language-specific AST?). General opinion about docu...

anonymous functions in unity via config file

I've been using unity with interfaces, but sometimes created an interface only to use a single method in a single class; and used unity as my IoC framework. But then I saw this post: http://codebetter.com/blogs/karlseguin/archive/2009/05/08/making-the-untestable-testable-with-anonymous-methods-and-dependency-injection.aspx which made m...

BindingSource.Filter doesn't work with '!='

I have a binding source and it has a column called Description and I want to exclude all rows that have their description set to 'x'. I have tried: bindingSource.Filter = "Description != ' + x; That doesn't work. Does anyone know how to do a is not comparison for the binding source's filter? I couldn't find any help on MSDN. ...

IIS WCF Service Accesed via JAVA with NTLM Authentication

We have a WCF Service hosted in IIS 6 with Integrated Windows Authentication turned on under Directory Security. Consuming this service from a .NET Windows client the cached NTLM credentials flow to the Server PC and things work great. We would like to have the same occur when a Java client accesses the service (via the WSDL generated ...

Linq to SQL error SQL does not compare NText, Text, Xml, or Image?

When trying to do an update for a Linq object I receive the following error. "SQL Server does not handle comparison of NText, Text, Xml, or Image data types." There is a field in the database that is a Text field because it is going to hold a string that could be as much as 32kb. Should I change the data type or is there a work around...

When to use AsyncOperation and AsyncOperationManager

Hi, I've spent many many hours tonight reading up on implementing the event-based asynchronous pattern Unfortunately, I haven't been able to find any articles at all on witting a class that only supports one Async invocation. Every example I've seen assumes that a method call will be called more than once and thus, should have a userS...

Sort Generic list on two or more values

We have a generic List(Of Product) that must be sorted on two or more properties of the Product class. The product class has the properties "Popular" numeric (asc), "Clicked" numeric (desc), "Name" string (asc). In order of naming the properties we want the list to sort. How can it be sort with an lamba statement? If have found to sort...

How to add files created in a custom msbuild task for build actions later?

I am generating minified javascript files using a custom msbuild task. This action is done "BeforeBuild". I wish to include these generated javascript files as an "EmbeddedResource" after they are generated. How do I do this? ...

Best .NET framework/approach for modular product?

Looking for advice on framework and approach for building a modular web application. Primary goal is to minimize need for redeployment, but redeployment would be fine on occasion. OSGI for Java seems like the right idea but I need a .NET implementation. http://www.osgi.org/Main/HomePage http://stackoverflow.com/questions/126073/mod...

Location of a Windows service *not* in my project

If I right-click and choose Properties on a service (like, say, Plug and Play) in the Services dialog, I get several pieces of information, including "Path to executable". For Plug and Play (in Vista) this is: C:\Windows\system32\svchost.exe -k DcomLaunch Is there some way I can get this same piece of information using .NET code if I ...

Designing API using WCF

I am working on creating a API (using WCF) that will expose some of the internal systems of an ecommerce company to the outside world. The target users of the API are mostly small businesses who may not have extensive develper resources. To ensure the evolution of the API in the future, i have decided that the input and output parameter...

Why is my Form so shy?

EDIT 2 Okay, based on the advice on the answers below I eliminated my thread approach and now my program looks like this: program.cs static void Main(){ Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FrmWWCShell FrmWWCShell = null; var splash = new FrmSplash(); splash.SplashFormInitialized +...