.net

Why doesn't ASP.Net recognize my user control?

In my current project (ASP.Net 2.0) I have a lot of web user controls, among them "Office.ascx". Office.ascx is loaded into another controls using this line: guide_controls_display_Office o = (guide_controls_display_Office)LoadControl("Office.ascx"); The control I am loading it into has Office.ascx registered using this line: <%@ Re...

how to get number of matched results of a query to SharePoint?

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + ASP.Net + SharePoint Server Enterprise 2007 on IIS 7.0 with Windows Server 2008 Enterprise. I am currently using queryex web serivces API to get matched query results for a specific query. My question is, how to get the number of matched query results without returning the whole qu...

How to pass multiple command line arguments in a Program called in VB.net

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim p As New ProcessStartInfo p.FileName = "D:\c\File_copy_program.exe" p.Arguments = "D:\c\File_copy_program.exe" & "D:\PE.nrg" & "D:\c\1.nrg" p.WindowStyle = ProcessWindowStyle.Hidden Process.Start(p) End Sub As you may s...

C# compiler: /nostdlib option

How is this possible not to include stdlib (mscorlib.dll) to my C# application when compiling it? As far as I know, all classes inherit System.Object class, which is defined in mscorlib.dll. What is more - types such as int are just aliases e.g. for System.Int32, which are also defined in mscorlib. Is this option ever used? ...

Validate Flash in .Net web application

Hi, I am working on a website and I have embed a couple of Flash component, the problem is that when I tried to validate the page (http://validator.w3.org/check) i get numerous error related to Flash like there is no attribute "src" there is no attribute "quality" Any way to validate those? Thanks ...

Loading powershell script around 10000 times.

I have a powershell script that runs during an msbuild process and validates some stuff by extracting info from log files. The script loads 2 xml files and then does some validation from the data extracted from the log files. Usually the script takes on average 1 to 2 seconds to run. Loading the xml files takes around 800ms to run. Sinc...

How can I pass a variable number of named parameters to a method?

I understand how to get the names of parameters passed to a method, but let's say I have a method declaration as follows: static void ParamsTest(string template, params object[] objects) and I want to use object/property names in my template for substitution with real property values in any of the objects in my `objects' parameter. L...

.NET Base type information?

Is there any convenient function to get a list of base types of a class. For example, I want to get base types (both interfaces and classes) of ArrayList class. The result should include "Object, IList, ICollection, IEnumerable, and ICloneable" Please advise. ...

c# ChannelFactory: How to reconnect/reopen connection after FaultException|TimeoutException?

Hello, I am using a ChannelFactory with netTcpBinding. Sometimes I get exceptions and after these I can not use the channel anymore because it is in faulted state. What should I do to reestablish the connection? Should I call abort(), then close/open. Or Close(), then open(), or should I just use a new object like: myPublicChannel = t...

Where does static classes/members allocate?

Hi, it's being a long time since i'm trying to find out the truth about static classes. my point is: value types are allocated in stack, reference types in heap, when using the new operator. but a nature of a static class is that you can't make an instance of it, and sure it's not a value type. so i have a question when and where does th...

Use cases for using netmodules when compiling .NET assemblies?

I'm interested in use cases for netmodules in .NET. In particular, I've been looking into better ways to break up solutions in .NET but not have quite as many assemblies to deploy. Netmodules are a very interesting idea, but they appear to break debugging and are not natively supported in Visual Studio (though they are for MSBuild). I'd ...

Role Based Authorization in .NET with PrincipalPermission and SecurityAction.Assert

I have a class attributed with [PrincipalPermission(SecurityAction.Demand, Authenticated = true)] public class MyProtectedClass { } This works as expected and callers are denied access when the current principal is not authenticated. In one specific scenario, I want this logic short-circuited...that is, the caller should not need to...

Why do I get a null reference exception in this expression tree?

I have a tree expression that looks like this: .Block( System.Object $instance, MyType2 $result) { $result = (MyType2)((MyType1)$instance).Property1; .Goto return { }; .Label .LabelTarget useDefault:; $result = .Default(MyType2); .Label .LabelTarget return:; $result } These are the custom types ...

Choosing an ESB for .NET

I know that the question has been asked before, but it's been two years and things might have changed. Also I have more specific requirements that I wish to discuss. We have a few systems that need to interoperate. We want to use the Mediator Pattern and a Publish/Subscribe communication model: Some systems will publish information to t...

Mono ORM that works with PostgreSQL?

I've been trying to find a decent ORM that works with both Mono and PosgreSQL. Does anyone know of such an ORM? ...

How to intercept method call of a class

Hi all, Is there anyway to intercept method call of a class so you can do AOP? e.g. I want the Teacher.Talk() performs differently in two scenarios: class School { [Fun] public void Picnic { Teacher t = new Teacher(); t.Talk(); } public void Seminar{ Teacher t = new Teacher(); t.Talk(...

The mplayerc playback position, .net

What is the simplest way to get the current playback state and position in mplayerc from .net? ...

.NET 1.1 Process.ProcessName and performance counters

Our customer has a HTTP Remoting endpoint with a framework method that attempts to find out the name of the current running process. In calling System.Diagnostics.Process.ProcessName it intermittently gets into this error condition in some of their Windows 2003 servers. Error Message : System.InvalidOperationException: Couldn't g...

What is the difference between <# and <#+ in T4?

What is the difference between the <# tag and the <#+ tag in T4? ...

Set AutoFac to use PropertiesAutowired(true) as default?

Is there a way i can set AutoFac to use PropertiesAutowired(true) to be the default for all types being registered. i.e. I dont want to use ".PropertiesAutowired(true)" all the time var builder = new ContainerBuilder(); builder.RegisterType<Logger>() .PropertiesAutowired(true) .SingleInstance(); ...