You have several problems, as Richard Deeming noted you can't use the load that way, you'll need to use Reflection.
Also, it looks like you intend to assign the result of the load into the variable referenced by the .Item1 object of the Tuple.
What your code actually does is try to assign into the .Item1 property of the Tuple.
Tuples, once created, cannot be changed. The .Item1 property is get-only.
You might be better off changing the DBList to hold delegates that actually do what you seem to want to happen.
publicstatic List<Action> DBList;
DBList.Add(() => A = load<<Car>>("A"));
DBList.Add(() => B = load<Boat>("B"));
foreach (var loader in DBList)
publicstatic List<T> load<T>(string tablename)
I have a web service where I need to create a very large bitmap 15,000 x 15,900 x 32bpp. Code fails on my machine (Parameter is not valid exception). On the IIS server, I can create about 85 or so before I get the Parameter is not valid exception. I do NOT keep all 85 in memory if that was your next question .
Workflow is pretty much:
1) Get image request
2) Create 15,000 x 15,900 x 32bpp bitmap
3) Do stuff to it
4) Convert it to 1bpp and return the bytes
I've changed my code around so I call Dispose() on the various Graphics objects every step of the way the second I don't need them anymore, but no luck. The bitmap in Step #2 has to be 32bpp.
Originally I had 10,000 x 10,900 bitmaps and I could process a whole set without crashing (710+). Unfortunately, QA requested the bitmaps to be 15,000 x 15,900. Trying to see how far I get by dropping to 14,000 x 14,900.
I suspect this has to do with the Large Object Heap fragmentation?
One of the recomendations I've seen on the net is to just create a single 15,000 x 15,900 object and re-use it.
Not sure how that would work in a web service. Each simultaneous request needs a 15,000 x 15,900 bitmap of its own.
Saw there is something in .NET 4.5.1 to compact the large object heap... might try that next if the 14k images don't work.
Check your project, are you compiling it for x64, or using AnyCPU? In order to make it be a 64 bit app, everything must be set to x64, or AnyCPU and running on a 64 bit box. Then make sure that the process is a 64 bit process.
I am not sure if there is an easy way to compile the codes. I have created 1 exe and 4 dlls.
The exe relies (depends) on 4 dlls ('a', 'b', 'c', 'd').
Illustration is as shown below:
exe -> 'a' -> 'c' -> 'd'
-> 'b' ----^
The 'd' dll is the lowest level. The 'd' is referenced in 'c' dll. and so on. Also that 'a' and 'b' dlls are referenced in exe.
Now when making changes in 'c' dll, I would compile the exe but the 'c' dll remains previous version, not updated when compiling the exe. I would have to compile each dlls ('a', and 'b') then the exe so that the updated 'c' dll is passed over to the exe.
Now for the question is there the easy way to compile those dlls at once? Thanks!
<edited>: Forgot to add that I'm using Visual Studio 2010
If you right click on a project in the solution explorer, there's a menu item "Project Dependencies[^]". There you can set which projects a project depends on, and a right compilation order will be figured out based on that.
Found it.. but not sure how to add items in project dependencies. The thing is that the those dlls are seperated (independent) in other folders... I think I need to put those dll projects in the exe project.
I am looking for code in asp.net for making user log out if he have open application in multiple tab and log out from one tab then from remaining tab also user should log out how to achieve