.net-3.5

Remove version number from reference (avoiding "Could not load file or assembly..." error)?

In my class library, I am referencing DLL's from my website's bin folder. Sometimes the DLL's in the bin folders get updated, then I get the error of: Could not load file or assembly 'MyAssembly.Sub, Version=3.7.2096.3, Culture=neutral, PublicKeyToken=dfeaee3f6978ac79' or one of its dependencies. The located assembly's manifest de...

How can I create a Package on a memory stream

Is it possible to create a System.IO.Packaging.Package on a memory stream. I'd like to avoid the file system and do everything in memory if possible. However, the only way to create a Package is to call Package.Open which accepts a stream. However, if the stream is empty, this fails. Any clue? ...

ExecutionEngineException when calling method on decoupled WMI provider

I've run into a problem where calling a method on a decoupled WMI provider (developed using the WMI Provider Extensions in .NET 3.5) throws an ExecutionEngineException when running more than one instance of my application. Has anyone run into this limitation before or am I doing something wrong? I created a (simple) WMI provider and pub...

Reporting in VS 2008 with Excel as datasource

I have certain data in Excel file which is dynamic. I wanted to make use of Reporting which is available in VS 2008. I wanted to create a report which can be exported to multiple formats like(PDF, XML, Image, etc) and the datasource will be an excel file. How do I achieve that? I created an Office project with Excel worksheet(with certa...

Passing recursive collection through WCF

I want to pass a fairly generic set of data through a WCF method. The data is basically just a hierarchical set of key/value pairs, but it's nested to an arbitrary level. I originally considered passing it though as a single string and doing XML or JSON or similar encoding/decoding at either end, but since the WCF transport is XML anyw...

How to bootstrap .NET 3.5 SP1 with msbuild? following found instructions doesn't work...

I'm trying to use msbuild GenerateBootstrapper task to distribute a .net application with the framework, without the need of internet connection to install it. I've found many posts that all lead to the same instructions in here: Enable Samesite for the .NET Framework 3.5 SP1 bootstrapper After following the instructions, I still can...

Output html to page in inherited PageBase class

I've inherited (no pun intended) an old ASP.NET 1.1 project that is now .NET 3.5. It is designed with base class that inherits from PageBase. All of the subsequent aspx pages inherit from this custom pagebase. It currently works by generating a bunch of html text in LiteralControls for the headers and navigation bars and dropping it into...

Why is "someString += AnotherString = someString;" valid in C#

I was writing some code today and was mid line when I alt-tabbed away to a screen on my other monitor to check something. When I looked back, ReSharper had colored the 3rd line below grey with the note "Value assigned is not used in any execution path". var ltlName = (Literal) e.Item.FindControl("ltlName"); string name = item.FirstName...

What is the best OAuth2 C# library?

It seems like many app providers are using OAuth2 to allow API access, such as Twitter and Facebook. Does anyone use a good library to do OAuth2 processing that is general enough to use across all applications? ...

Mysql Connector .Net is taking more than 40 mins to update database model

Hello Everyone, I am using MySql Connector 6.2.3 with Visual Studio 2008 and i have a database with 119 tables, which is constantly growing. When i want to update the entity framework model "Update Model from Database" option from visual studio it is taking more than 40 mins to update, that is killing my productivity. Is this happening...

Calculating Total Count of Items in List<T> for multiple KeyValuePairs in Dictionary<string,List<string>>

I have a Dictionary<int,List<string>>. I have multiple KeyValuePairs so int the first KeyValuePair the List may have 10 items in it, the second KeyValuePair may have 100 etc. I need to work out the total count for all items in each list so in my example above I would have a result of 110. ...

Import CSV Files

Hi everyone! I need to import multiple csv files, compressed in a zipped folder. I am using Visual Studio 2008/SQL server 2005. I am thinking either create some kind of File upload .net control OR allow users to copy files to a network share, then run some kind of import utility to import data into SQL server. The tricky part for me ...

Comparison of a generic type with it's default value, without a generic class constraint, gives a compile time error.

I just ran into this situation and i thought it was a nice opportunity to use the default keyword. But it doesn't compile and i can't think of why. The example below illustrates my problem: public class Test<TDataSource> { public IQueryable<TDataSource> DataSource { get; set; } public bool GetOneOrDefaultResult() { ...

How to find the origins of a Threading.ThreadHelper.ThreadStart() method

I have a .NET 3.5 client/server application that is accessed via RDP on a local network running on a windows 2003 server. When using one portion of the product, the screen freezes periodically when none of the code I've written is actually executing. I've run a profiler on the server using the latest source code, etc. and when the dela...

Url Routing is not working on IIS 6

Url Routing is not working on IIS 6. (using System.Web.Routing Namespace) If i am running through VS 2008 then its working fine. if i made virtual directory on IIS 6 then its not working. its giving error 404 - file not found... Thanks ...

csharp program error

I am new in .net.i renamed a file & got these errors.Please fix that error. Error 2 'ASP.emp_mgt_aspx.GetTypeHashCode()': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sha\e2a448be\2d96a300\App_Web_x-ppfs2v.8.cs 1782 Error 3 'ASP.emp_mgt_aspx.ProcessRequest(Syst...

Real world OOP tutorial (for .net)

I am looking to learn OOP design and development. I would like to know if there are any real world tutorials out there (I googled but didnt find what I was looking for). For example I am developing an inhome application (something like an HR application) So I would have a person object, that would be inherited to become an employee, a...

How to avoid prefix removal from namespace in XSLT transformation in .Net?

Hi I'm having the raw xml with <XMLNS:NS1 ...........> And after transforming its giving me the proper output but the xml nameSpace is getting modified as <XMLNS "url"> And does not have that NS1 prefix anymore.. so can you hrlp me how to keep the prefix when doing a XSLT transformation? ...

Minimize on FormClose prevents computer shutdown

I have a simple Form-Based .NET application. In this I capture the FormClosing Event to prevent the closing of the application, instead I minimize it. The application should always be open. Here is the code I use: private void Browser_FormClosing(object sender, FormClosingEventArgs e) { e.Cancel = true; this.WindowStat...

Using an interface vs. MVVM light Messenger for data requests

I've got a plugin that needs access to certain information in order to populate its GUI elements properly. However, this plugin should not know about all other plugins, so I want it to request this information from the application. In situations like this, I always create an interface for data exchange, and then pass this interface to ...