.net

Interop.SpeechLib.dll COM Exception

I am using SpeechLib for a very simple text to voice conversion. Works great locally. When I deploy the applcation on to the server, I get the exception: could not be found. (Exception from HRESULT: 0x80030002 (STG_E_FILENOTFOUND)) I have done the following with no luck: Set the AppPool to run using the LocalSystem Have given write ...

How to stop one thread until n threads have completed their work.

Hello, I have an application with one main thread and N worker threads. At some point I need that the main thread waits until all the N threads have completed one section of their work. I normally would use Monitor.Wait() and Monitor.Pulse() but this will prevent the N threads from working at the same time. Any idea on how to do that?...

Managed COM aggregation

It is my understanding building a COM object aggregating an existing COM object implies implementing redirection logic in the IUnknown.QueryInterface method of the outer object. The question I have is how to do that if the object you are building is managed. On managed objects IUnknown is not explicitly implemented COM Interop does it f...

Creating One MSI for multiple project

I have 2 projects. I want to create ONE single MSI setup package that will install both of those projects. In My Application Folder I have created 2 subfolders (Project A and Project B folder). So after the install, the project ouputs will be in Program Files\MyProduct\Project A Program Files\MyProduct\Project B The problem I am havi...

How can I iterate over a collection and change values with LINQ extension methods?

Lets say I have a collection of Messages which has the properties "UserID" (int) and "Unread" (bool). How can I use LINQ extension methods to set Unread = false, for any Message in the collection in whose UserID = 5? So, I know I can do something like: messages.Any(m => m.UserID == 5); But, how do I set the Unread property of each o...

C# WPF - ScrollViewer + TextBlock troubles

I have a TextBlock within a ScrollViewer that aligns with stretch to its window. I need the TextBlock to behave as the following: Resizes with window, no scrollbars When resized below a certain width the TextBlock needs to keep a MinWidth and scrollbars should appear TextWrapping or TextTrimming should work appropriately How can I ...

HTML based report being ripped to pieces by pagination

Hello, I've created a HTML based report that can be variable lengths and number of segments in C# (which is why Crystal Reports wasn't used) and I can't use the wonderful http://www.printfriendly.com/ as the report is Intranet based (boooo, hiss). I've created a media=print CSS file that is used to make the formatting as paper and ink ...

Events subscribing equivalent of "+= Tab Tab" in C# VS IDE

Hello. I wonder what is (if is) the "shortcut"(code-snippet) for adding handlers in VB.NET (Visual Studio 2005/08), equivalent to the += + Tab + Tab in button1.Click += ... C# IDE. In this way C# IDE auto-creates the necessary method, with all necessary parameters. So, If I know that I need to execute a method at a event even if I don...

LoadControl in static/shared function

Anyone know how I can dynamically load a control inside of a shared/static function? The function itself is inside of a mustinherit/abstract class. (It's an ASP.NET project in VB) I want to do something like this: VB: Public Shared Function GetWidget(ByVal name As WidgetName) As Control Select Case name Case Wi...

.net Resizing control won't work?

I have a couple of pictureboxes that need to be resized by aspect ratio when the window size changes. I assumed I can anchor the width, but set the height manually (i.e. anchor the left, right, and top edges; but not the bottom.) However, my control won't resize if I try changing the Size property. Why wouldn't that work? How can I resiz...

XmlParseException occuring in PresentationFramework for deploys only

I am getting the following exception when I deploy my WPF app to another user's machine: An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll However, the WPF app runs fine when I open it. The app crashes at StartUp with this message. I've double-checked to make sure ...

Windows 7 .net Excel .SaveAs() Error Exception from HRESULT: 0x800A03EC

Background: I toasted my old hard drive at work and am getting a new one. With that I'll have to rebuild my machine. My manager has Windows 7 installed on him loaner laptop that I've been using while my machine is out of commision. But I've run into a problem. We have a fair number of apps that make use of the Microsoft.Office.Interop.E...

Adding a reference without importing types

Hello, My Visual Studio solution has several late-bound projects (dll) which are loaded by other projects in runtime. The dll loaded depends on some runtime condition. To load dll in runtime I need it to be present in the application bin directory, and there are several of those apps. To do that I run a post-build script which copies l...

Convert HTML to PDF

In reference to an earlier post (http://stackoverflow.com/questions/1980890/pdf-report-generation) I have decided to use a solution similar to http://www.alistapart.com/articles/boom For those of you who don't want to read either reference - I'm creating a report and need it as a PDF. I've decided to go the HTML -> PDF route using .NE...

Which account is used when a user navigates to a ASP.NET website?

When a user browses to a ASP.NET website, is the user impersonating the ASPNET account or the account specified in IIS->Directory Security->Account used for anonymous access (EX: IUSR_XXX) My website writes files to the disk and I was wondering which of these accounts need write access to the folder? Also, can someone explain how the im...

Using xsi:nil in XML

I am generating an XML file from a VB.NET app. The document was generating fine before I tried to add nillable elements. I am now testing putting in just one nil element as: <blah xsi:nil="true"></blah> Once this element is in place and I try to view the XML file in IE it is unable to display. I am receiving: > The XML page canno...

C#: how to get an object by the name stored in String?

Good day, is it possible in C# to get an object by name? i.e. get this.obj0 using string objectName = "obj0"; executeSomeFunctionOnObject(this.someLoadObjectByName(objectName)); ...

Is it possible to cause a thread to be created in another app domain?

Let's say I have a non default app domain. I want to get a reference to the Default app domain and cause a thread to be created within it, that runs a piece of code. Is this possible? The only way I can think of doing this is to re-load my assembly into the Default app domain and have some logic in one of the constructors of a type that ...

Override machine.config with web.config

I have recently decided to move my connection strings to machine.config as this seems to be by far the most elegant approach for managing multiple environments. However, I would still like to be able to override these settings in my local web.config if the need arises (or the non-enlightened masses begin to complain). How can I override...

WCF Service Browsing

I have a WCF service installed on my system. I can browse and see the .svc file just fine. Should I be able to use a browser to view the endpoint addresses such as https://svc.example.com/BaseService/Login ...