.net-2.0

Late resolution of MSI variable for part of install folder path

In a setup project, on User Interface, I've created a RadioButtons (3 Buttons) dialog box. I've placed it before the Installation Folder Dialog. I wish to incorporate the value selected in the RadioButtons dialog as part of the Installation Folder. To do this I've placed the name of the variable amongst the path where I wish to use it...

How to speed up dumping a DataTable into an Excel worksheet?

I have the following routine that dumps a DataTable into an Excel worksheet. private void RenderDataTableOnXlSheet(DataTable dt, Excel.Worksheet xlWk, string [] columnNames, string [] fieldNames) { // render the column names (e.g. headers) for (int i = 0; i < columnNames.Len...

Why can't set cast an object from Excel interop?

Trying to get a reference to the worksheets (using Excel interop): Excel.Application xl = new Excel.ApplicationClass(); Excel.Workbooks xlWorkBooks = xl.Workbooks; Excel.Workbook xlWorkBook = xlWorkBooks.Open(fileName, 0, false, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false,...

What issues might I have in opening .NET 2.0 Projects in Visual Studio 2010?

The small software team I work on recently got approved to upgrade to Visual Studio 2010 (we're currently using VS 2005). We have several ASP.NET 2.0 and WinForms (in .NET 2.0) projects in production. I've been tasked with downloading VS 2010 and seeing how well it plays with our current projects. What issues should I be aware of when...

Getting an occasional error calling WebServices

I have a ClickOnce app that calls WebServices on the server (standard ASMX style, not WCF). Occasionally, the users get this error: System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. System.Net.WebException: Unable...

How to troubleshoot dependencies not copying.

I have an EXE project A, which references a class library project B (all in the same solution). Project B has a reference to about 10 3rd party DLLs (from DevExpress). All the referenced assemblies have Copy Local set to true. When I build the entire solution, the resulting DLL from project B is copied into the bin/debug of project ...

ASP.NET Hide Length of Password During Entry

I have to hide the length of the password being entered during login of my asp.net web application. I know the asp.net textbox server control has the textmode of password but I can't even show the that. Any suggestions on how to hide the user input? ...

ByRef vs ByVal generates errors!?

ByRef vs ByVal generates errors!? I had a method that used an Object Function Foo(ByRef bar as CustomObject) as Boolean this method generated errors, because some strange .NET Runtime things changed the bar object, causing its Dispose()al. A lot of time spent to understand the thing(where the ... object is changed), until somebody ...

Why should I not use AutoDual?

Up to now, I've always decorated my .NET classes that I want to use from VB6 with the [AutoDual] attribute. The point was to gain Intellisense on .NET objects in the VB6 environment. However, the other day I googled AutoDual and the first answer is 'Do Not Use AutoDual'. I've looked for coherent explanation of why I shouldn't use it, ...

Integrating a ClickOnce app with Outlook

I have a ClickOnce app that used to be run by users with Power User privileges. So to integrate to outlook (e.g. syncing of emails, appointments and addresses) I used a 3rd party component from Add-In Express, which includes an ActiveX DLL. So when the user would download my app, I'd register the ActiveX DLL (if it wasn't already regis...

How to tell if the OS is Windows XP or higher?

I am trying to play with the Environment.OSVersion.Version object and can't really tell what version would indicate that the OS is Windows XP or higher (e.g. I want to exclude Windows 2000, ME or previous versions). ...

How to add a vs2005 .tlb reference to a vb6 app

Error referencing vs2005 c# file(.tlb extension) in vb6 application. error message: Can't create activeX object Pls, need some help urgently ...

Filter elements in PropertyGrid

In System.Windows.Forms there are a PropertyGrid that displays properties of an attached object. Let's say MyTextBox : TextBox. Now, I would like to display on it some MyTextBox properties, say only Size, Location and my custom property Date. More that than, I would like to be able to change the real property names, say "Dimension", "...

How to draw mixed-formatted text with .Net 2.0

Hi, is there a way to draw mixed-formatted text in .Net 2.0? I'm looking for something similar to System.Drawing.Graphics.DrawString() My problem with this method is that it allows only one format style for the whole text. But I need to draw text that has different format styles (e.g. a part of the text shall be underlined, another p...

Can I have different '.settings' specified for debug and release configurations?

I have a .settings file (containing both User and Application settings) that I would like to contain different values if built in Debug mode. Is there a supported or recommended way to do this? ...

Setting CPU target to x86 on .NET 2.0 project adds .NET 3.5 dependencies.

I have a project in VS2008 that targets .NET 2.0 framework. It was original set to build for AnyCPU. I changed it to x86 and for whatever reason, VS adds the following lines to .csproj: <ItemGroup> <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> <Visible>False</Visible> <ProductName>.NET Framework Client Profi...

Parsing an XML string containing "&#x20;" (which must be preserved)

I have code that is passed a string containing XML. This XML may contain one or more instances of &#x20; (an entity reference for the blank space character). I have a requirement that these references should not be resolved (i.e. they should not be replaced with an actual space character). Is there any way for me to achieve this? Basic...

What is the best approach upgrading from .NET 2 to 3.5?

We've been developing apps since .NET 2 release and now we are planning to upgrade to .NET 3.5. What is the best approach upgrading from .NET 2.0 to 3.5? BTW ... the external components that we use are: 1. EntitySpace - ORM 2. Microsoft Enterprise Library 3. Microsoft ReportingViewer 9.00 4. Telerik ASP.NET Controls ...

How late it is to not migrate to .Net 3.5 from .Net 2.0 ?

We have some applications that are being worked upon in .Net 2.0 since long back. I'm recommending my team to move the base from .net 2.0 to .net 3.5sp1 and focus and leverage from C# 3.0 but I'm facing difficulties in doing so. What are the implications of not migrating to .net 3.5 and C# 3.0 ? What are your experiences on this front an...

Unable to add Rhino Mocks 3.5 to a .NET 2.0 project in Visual Studio 2010

We're upgrading from Dev Studio 2005 to Dev Studio 2010. I opened my 2005 solution in Visual Studio 2010 and went through the conversion process keeping all projects targeted at .NET 2.0. When I try to build the project, my references to Rhino.Mocks.dll are failing to be used. I see errors like this: DalDiscoveryTest.cs(7,7): error ...