.net

.net console app lifecycle - working around a pre-start initialization error from BuildManager.GetReferencedAssemblies

I'm trying to iterate through the referenced assemblies in my console app. I have been doing this with BuildManager.GetReferencedAssemblies in other projects, but in my console application, I get an InvalidOperationException: This method cannot be called during the application's pre-start initialization stage. To my knowledge, there is...

Microsoft Management Console in .NET applications

Is it possible to host MMC snap-ins inside a .NET application? If not, is it possible to launch MMC with the "Computer Management" snap-in set to an arbitrary computer name ...

Documentation for Bouncy Castle AES 256 encryption in .Net?

I'm trying to implement the Bouncy Castle encryption library in a .Net project, but am not finding a lot of .Net-related documentation. The class/method structure isn't even close to the ample Java-related examples. Does anyone have some good .Net examples for this? Thanks. ...

How to determine location of IsolatedStorageFile root directory

I'm using IsolatedStorage for persisting objects, but from time to time I need to manually clean out files from this directory. As I persist the files, I want to write the physical location of the directory to the console. There doesn't appear to be an accessible property that returns this information though. How should I do it? Here i...

VB.NET - Is there a way to utilize optional parameters in delegates? (Or Plans to Allow this?)

It is my understanding that it is not possible to have an optional parameter in a delegate in the version of VB that ships with VS2008. However, I am wondering if there are any workarounds or plans for incorporating this feature into VB.NET in the future? What I'd like to do: Public Delegate Function Deserializer(Of T)(ByRef Buffer()...

.NET obfuscation of a DLL: how can I protect my code?

I'm in the process of exploring a partnership with a small company. The company is looking for an algorithm that can improve their profits and I have some prototype software that can help them. The core of my software is very confidential and if the company gets a hold of it, then they will certainly not need me. I'm definitely going to ...

How do I add permissions to an OU using C#?

I can get the OU object like.... DirectoryEntry de = new DirectoryEntry( "LDAP://domain.com", "DOMAIN\\Administrator", "Password"); DirectoryEntry ouEntry = de.Children.Find("OU=my-users,DC=domain,DC=com"); But I can't seem to find any classes or libraries to add permissions. I want...

assembly binding logging is turned off

Hi, im trying to run a web appilication in .net framework... and got error.. help me to resolve.. thanks in advance... Server Error in '/PSS.NET' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details belo...

Change the forecolor of read-only properties in a propertygrid

I'm using a WinForms property grid to display the properties of an object. However, most of the properties are read only and thus show up as grey rather then black. Is there a way to customize the colors that are used? I'd like the disabled properties to be a bit easier to read. BTW: I think the answer to this question might be related ...

PHP DOTNET(): Capturing System.Windows.Forms control events to create a usable WIN gui

I made a Windows GUI through PHP's DOTNET class and System.Windows.Forms. But, I'm stuck on handling button clicks, field updates, form open/close events, etc. I cannot get com_event_sink() working with any events whatsoever. I know of no method to get PHP to fake or sink control event "delegates". The best I can do is hackish - cons...

Does ASP.net Report Viewer / Reports require Reporting Services on SQL server

I have an application that makes use of Report Viewer and Report (.rdlc) files. Does this mean that I need to have "Reporting Services" installed on my SQL server?? Also would not having "SQL Server Analysis services" affect me any way I want to make sure I keep using - SQL Server Profiler - SQL Server Agent - create and run manageme...

Python vs C#/.NET -- what are the key differences to consider for using one to develop a large web application?

My organization currently delivers a web application primarily based on a SQL Server 2005/2008 back end, a framework of Java models/controllers, and ColdFusion-based views. We have decided to transition to a newer framework and after internal explorations and mini projects have narrowed the choice down to between Python and C#/.NET. Le...

Run Once Code: Beyond Boolean?

I'm struggling for a pattern here. I have quite a few tasks that need to be run, but only need to be run once if they haven't been run before. Everything right now is handled by if/then, booleans and a hashtable. There are also nested children of the same effect (if/then, boolean) so their parent if/then, boolean isn't set to true until ...

File.Delete error "The process cannot access the file because it is being used by another process"

I have written a DotUnit test suite for testing some data import functionality in my application. It works by making a backup of some local Microsoft Access Database, let's call it 'Test.mdb', to 'Test.mdb.bak', performing some data import (and subsequent Assert checks) and then restoring the original from the backup. The SetUp() functi...

How to get a specific section from Microsoft Word using C#

Need help in figuring out a way to fetch a particular block of content from Microsoft Word document using the section number in C# .NET. For example if a word document which has sections as follows: Introduction Format Description 3.1 Details 3.2 Tables 3.3 Figures Analysis Now from section 3.2, I would like to get access to...

No MSDTC - Still getting "communication with underlying transaction manager failed"

Hi In my project I am using Ado.Net's DbTransaction object to manage transaction... Then why I am getting MSDTC related error - "communication with underlying transaction manager failed". Here is my code. DbTransaction trans = Connection.BeginTransaction(); //Code if (successfull) { trans.Commit(); } else { trans.RollBack();...

How to Assign the value to Main /Parent Structure in a Nested Structure?

Hi I have writen an Nested Structure in C# . Find the code snippet below: public struct SMB_MESSAGE { #region SMB Parameter public struct SMB_PARAMETERS { public byte WordCount; public ushort[] Words; } #endregion #region SM...

MEF Load Plugins(dlls) from folder not in Executing assembly but another dll.Can you help?

Hi all I need to implement a very small plugin architecture.I am new to MEF so even simple things become complex. Lets assume I have 2 dlls Client(Executing Assembly) and Server Within Server I have a folder called "Plugins" Usually I create a "Plugins" folder in the bin directory of the executingAssembly and all works with this piece o...

sending mail .net need help

Requirement: I have a web application deployed in a server. On a button click, I need to open outlook new mail window with some values populated in a particular format. So that the user can edit the values if want and change the To, CCC fields with the recipient list, and then send the mail manually… Note: Assumption is that there is ...

how to display 12 hour video on loop, synced to system clock?

Hi. I don't have any video experience, so my searches on this weren't productive. There might be software out there that does exactly what I need but I couldn't find. I think I'll have to develop something, though, in which case I'm platform and language agnostic as this is a fun project, though I do have experience in .NET. I appreciat...