.net-3.5

Sending Multiple Words to Another Program

How would I output a sentence with VB.NET? Example: Your program and Internet Explorer are open, your program outputs "http://stackoverflow.com" and presses "{ENTER}", and it will go to the page. Example: An auto-talking bot for MSN. ...

How to use proxy class generated by WSDL in web service?

Disclaimer: My experience/knowledge of web services is very limited. There is an existing web service WSDL that I have reverse engineered with wsdl.exe to create a C# proxy class. Using Visual Studio 2008 I created a default web service template. How do I reference the generated proxy class so that it will work in the web service? ...

in C#, Is there anyway to determine a class's members at runtime?

Suppose I have a class named foo, and it has 3 public members foo1, foo2, and foo3. Now suppose I'm writing a function that takes an instance of class foo as a parameter, but when I'm writing this function I have no idea what public members it has. Is there a way for me to determine at run-time that it has public members foo1, foo2, fo...

How to make an application HAVE a form but not BE a form?

I want my C# .NET application to have a form but not be a form. When I normally startup a windows forms application, it's like the form is the master of everything else that follows: static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.R...

Windows Forms unhandled error pop up message

I have a windows forms application (.NET C# 3.5)... that is throwing an error.. but I have 2 scenarios: Client: on the client side.. the error is logged into a log.txt file.. AND an error pop up message appears See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ***** Ex...

Debugging Silverlight when hosted in a web project?

This is probably a basic question. I have two projects: A web application project, that has a webpage that hosts a Silverlight application, as well as a web service A Silverlight application project, the one hosted in the above web application If I debug the Silverlight application, it wants to run this with a generated web page, wh...

Error while running the code after migrating

I have a application in asp.net2.0 with C#. I have migrated my application in .NET 3.5 & I am receiving the below error. Could not load file or assembly 'Microsoft.Build.Framework' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. Please let me know how I can s...

Issue with linq2sql with this specific stituation

Software used: Visual studio 2008 professional with services pack 1 Sql Server 2005 Standard Edition (9.00.4266.00) Windows XP SP3 I have these 3 tables: GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Table_2]( [table2id] [int] IDENTITY(1,1) NOT NU...

C#: Copy Section of 2D-Array

Hi, i'm working on a Client-Server Game with a tilebased map. If the user changes the visible section of the map (i.e. scrolls in any direction) i query the server for info about the new section giving X, Y, Width and Height. The Map info is stored as 2D array MapTile[,] (MapTile is a simple Struct) When the client requests a new se...

Error: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0

I am getting this error that is related to ReportsViewer. I need to eliminate all references to this library. So where do I need to start deleting the references? Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your c...

How does the new UserPrincipal.LastLogon Property function in DirectoryServices.AccountManagement?

Hi, I am trying to use the new System.DirectoryServices.AccountManagement library to search the Active Directory and get the LastLogon times for users. I am using code that is very similar to the code found here: http://www.codeproject.com/KB/system/usingAccountManagement.aspx I create a PrincipalContext object using a statement like:...

disable a checkbox in gridview

I have a gridview in which the first column in a checkbox. The grid displays one or more records that are returned from the database upon user search (the grid is populated in a proc called "protected void DisplayGridData()"). If the "inactive" column of that record is "1", I would like to have the checkbox disabled. How can I accomplish...

Why do I need to reference this assembly, even though its not being used

Hey everyone, I've got an architecture like the following: Data (Class Library that handles our Entity Framework stuff) Components (Middle tier class library that references Data library) WebOffice (Web Application that references Components library, but NOT Data library) Now, I have the following snippet of code (this lives inside ...

.net 4.0 migration

Can a .net 3.5 c# project reference a .net 4.0 assembly and compile with it? What about run time? What about 4.0 compiling / running with 3.5? EDIT: in particular, I have a 3rd party .net assembly. It has extension points: I register my dll in app.config and it calls me (probably via reflection). Can I implement my dll in .net 4.0? wh...

The Explicit Cast Operator, Generics, Inheritance and Interfaces

This doesn't seem to work. Is it possible? public interface IInterface1 {} public interface IInterface2 { } public interface IMyT1 : IInterface1 {} public interface IMyT2 : IInterface2 {} public abstract class BaseClass<T1, T2> : Interface2 where T1 : IInterface1, where T2 : IInterface2 { protected T1 T1Obj {get;set;} publi...

Windows 7 taskbar icon not displayed in .net 3.5 application

My application is in .net 3.5 its icon appears fine on the Windows 7 taskbar when I am running the application. But, when I pin my application to the taskbar, the icon dispappears and is replaced with the default windows "no icon" image. I tried making a 48 bit image for my .ico but that didn't solve the problem. ...

A site built in .NET 3.5 to target 4.0, when server runs 3.5

I have a legacy .NET site that has been around since the 1.1 days. As I've upgraded my VS, I've upgraded the target framework as well. Currently the site is running 3.5. I just got VS10 and it is asking me to upgrade the site to 4.0. However, my (shared) server is still running 3.5 and I can't upgrade it. Is it safe to upgrade the site t...

ValidationGroup on control instead of validator?

I have a ValidationGroup declared for my validator and button. But I see that there is this property for the textbox as well... do I need to assign this? What is the purpose of a textbox having a ValidationGroup when it is supposed to be the validator controls that have this? ...

How to invoke an event automatically when a function is called?

I have this kind of code: public class Foo { public SomeHandler OnBar; public virtual void Bar() { } } Foo is a base class and therefor other classes might inherit from it. I would like the OnBar event to always be fired when Bar() is called even if it's not called explicitly inside Bar. How can it be done? ...

How can I use a VS Setup Project to install "Any CPU" code properly on either 32-bit or 64-bit Windows?

We have a large suite of products that include: Desktop apps written in VB6. Desktop apps written in .NET. Windows services written in .NET. ASP.NET web apps written in .NET. ASMX and WCF services written in .NET. All the .NET code is written in VS2008, targeting .NET 3.5 and "Any CPU". We could target specific processors, but would ...