|
Through some fun in the binary. Let's actually use Windows 2000 as the example as Windows XP knows a bit more.
An executable contains an Import Address Table which the operating system loader fills in with the addresses of all DLLs that the executable references. It does this recursively with any DLLs that those DLLs depend on. Once it's finished doing this process, it then jumps to the Start Address that's listed in the executable's header.
.NET applications have their Start Address field set to the address in the Import Address Table that the instruction to call _CorExeMain in mscoree.dll points to. So the program effectively starts up in _CorExeMain.
mscoree.dll is one of the very few components of .NET that is shared between all versions. The version present is always from the newest version of .NET installed. It implements a pretty simple policy by default: if the application was built with .NET 1.1 and .NET 1.1 is installed, .NET 1.1 is used. Otherwise, .NET 2.0 is used. What mscoree.dll actually does is load mscorwks.dll from the specified version's folder and hand the program off to that.
You can override the policy by adding a configuration file (MyApp.exe.config, if the program is MyApp.exe) and setting the <supportedRuntime> element to say which version of .NET should be used. I've used this for an unmanaged program to control the version of .NET used for COM components.
Incidentally, ".NET 3.0" is just a set of new classes. The runtime, mscorwks.dll, is not updated after .NET 2.0 (except for .NET 2.0 SP1).
It gets even more complicated for 64-bit operating systems, which are .NET-aware. Here, if the executable is compiled with /platform:x64, it gets a PE 2.0+ header indicating that a 64-bit process is required, and the 32-bit OS will reject it. If compiled with /platform:x86, it gets an original PE header indicating a 32-bit process (and a flag is set in the CLR header). However, an executable compiled with /platform:anycpu is compiled with an original PE header but runs in a 64-bit process on 64-bit Windows. I think this can only be done by the CreateProcess code recognising that it is a .NET executable and choosing to create a 64-bit process rather than a 32-bit one.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Thanks so much. I've got the rough idea, but is there any relevant materials on MSDN available?
|
|
|
|
|
Hi,
I have developed an application in C#.Net,
where Im converting Html file to word.
I have two images embedded in html file.The converted word file shows the images also.
But if delete the images from the disk (path), the images will not be displayed in word file.Please provide solution for this ??
Reagards
Shiva
|
|
|
|
|
I need to make my c# app always executing. I tried using RunAppAtTime but it didn't worked well.
Is there another way to do this?
thanks
Ale
|
|
|
|
|
That depends on what you mean by "always executing". If the application is supposed to be running for the lifetime of a user being logged in, you launch the app from either the All Users or the individual users Startup folder. If the app is supposed to be running so long as Windows is running, then you write your application as a Windows Service (no user interface allowed!)
|
|
|
|
|
How shall i read windows address book using .net framework ?
if possbible give sample code.
|
|
|
|
|
There is no support in the .NET Framework to specifically read an address book file.
Try Googling for "vb.net windows address book" for possible solutions and libraries that do what you want.
|
|
|
|
|
Here is an issue that is driving me crazy. If someone has an idea, I'd love to hear it:
When I try to set a reference to a dll that was not built on my machine (in C#, either .NET 2.0 or 3.5), I get a yellow !-mark in the explorer and the project will not build. It has no problem with dll's built on this machine. It doesn't matter what the other machine was... it won't take them.
Here are the warnings I get when the build fails:
The referenced component 'whatever' could not be found
and
Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'C:\whatever.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
If I just copy the same dll to another machine, and add a reference to it, the project builds fine. So there is nothing wrong with the dll.
If I actually copy a project from another machine into this one, with the references already set and include the dll's, it will build on my machine without a problem. If I remove the reference (on my machine) and then try to add it back, I get the error.
Also, dll's built on this machine will run fine on another.
So the issue is apparently not in the dll, but in whatever is setting the reference in the project. Does the dll contain some information that is unique to the machine it's from? Is this being processed incorrectly when the reference is trying to be sent?
Thanks for any ideas,
Bob.
|
|
|
|
|
Bob West wrote: If I actually copy a project from another machine into this one, with the references already set and include the dll's, it will build on my machine without a problem. If I remove the reference (on my machine) and then try to add it back, I get the error.
Really? Is that because you have identical paths where the DLL can be found?
Could be that your local project is corrupted. I might consider the following:
- delete the folder from the local drive
- create a new folder for the project off a different branch on the local drive
- Get the project from source control into that new folder
- build the project
- Try adding the reference to the project.
led mike
|
|
|
|
|
Thanks for your reply.
I tried that. No joy.
I think it is not really the project, it is something on the machine. What I am trying to isolate is what it is.
I reversed what I had done before, and copied a project that didn't build on machine #1 over to machine #2. The dll whose reference could not be set was in a folder of the project so it went over intact to the other machine. Then the project successfully built on machine #2, without my trying to change the reference or anything!
If I bring in a dll from any outside source (that included some eval software I looked at this weekend), I can't set a reference to it on machine #1. Their sample code wouldn't build either. But it build on Machine #2.
I thought I might have a corrupt VS file or something on machine #1. But it would involve both VS 2005 and 2008, so I am not real sure of that.
Bob.
|
|
|
|
|
Could be a security issue. Try using the .NET framework configuration tool (mscorcfg.msc). In 1.1, it resides in the framework version folder (under Windows), but in 2.0 it has been moved to the SDK (under Program Files). Search your disk for it and use the latest version you find.
You can also use the command-line caspol.exe tool (in the current framework version folder).
Using either, make sure the location (the other machine) where the DLL is located is fully trusted.
Note that this is just a thought - I've never seen the problem you describe but I've had problems running stuff off network shares and it was fixed this way.
--
Peter
|
|
|
|
|
Hello,
I try to explain you my situation :
I've got a web application (vs2008 and fw 3.5),I've also got a file.txt I've added under App_GlobalResources called resistrationBody.txt, my questions are :
1) how can I read this file from resources (not being this file a .resx file)
2) can I localize it as it can be done with .aspx.en.rex file?
Thanks
Paolo Ponzano
|
|
|
|
|
Hy there, I have a problem. i want to see how winforms made the ResourcePickerDialog (the one that appears when you set an Image at design-time). I found out that the class is in the assembly Microsoft.VisualStudio.Windows.Forms, but i can't seem to find the assembly anywhere, except GAC.
Does anyone know how can I disassemble an assembly installed there? I have reflector and ildasm, but they can't open assemblies from GAC.
Thanks very much.
|
|
|
|
|
Reflector can do it. File->Open Cache...
|
|
|
|
|
Hi,,
I have an MSDN Licenese and I searched for downloading Visual Studio 2008. My manager told that I need to install Visual Studion 2008 Developer Edition. So when I searched in the MSDN site, I could see there is an Visual Studio 2008 Development Edition? Does it contain the TFS and Team Explorer also for check-in and check-out of source code?
Plss reply asap. Thanks for any help.
Regards
meeram395
Meeram395
|
|
|
|
|
Why not ask your manager ?
There is standard, professional, express and team edition. If you use VSTS, you need the team edition. Otherwise, if you use VSS or something else, Standard or Pro will be fine.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
When I am opening my website thru http://localhost/MyWebSite,it is asking to enter windows login id and password.It was not happening earlier.
Even after entering id and password its not working.Is it an issue with IIS settings?Any body knows reasons and solution for this.
Regards,
Montu76
Hello There
|
|
|
|
|
you have to allow anonymus(sp?) access to the web site in the directory security tab of the properties in IIS, then it should work fine. you can also try setting the IUSER account password in IIS by un checking the "allow IIS to control the password" box and typing something in...be aware that doing so does have other effects that seem to randomly take effect.
|
|
|
|
|
Hi,
I checked and did the same earlier also,still same issue.
my http://localhost is itself not opening.
Regards,
Siddharth Somni
Hello There
|
|
|
|
|
Hi,
I checked and did the same earlier also,still same issue.
my http://localhost is itself not opening.
Regards,
Montu76
Hello There
|
|
|
|
|
To open http://localhost and not http://localhost/somesite/somepage.aspx you have to have directory browsing turned on for the default website in IIS, its off by default as you wouldnt want random users to browse the directories of your website. If you are using WIN XP you'll only have the default site but have a bunch of virtual directories under it which(if you're running asp) will need applications configured for them..in the home directory tab of their directories propertys in IIS just hit the creat button under Application Settings, Home Direcory is also where you set the Directory browsing permissions. You can also set the default page in the Documents tab, it has a few in there by default, but if you dont have one of those in your website's dir then it will just try to directory browse unless that permission is off. Hope this helps.
|
|
|
|
|
The first beta release of Service Pack 1 for both Visual Studio 2008 and .NET Framework 3.5 are available.
With Service Pack 1, Visual Studio 2008 introduces a large assortment of new features for targeting Windows, Office, and the Web.
Developers building .NET-based applications will enjoy improved performance in the WPF designer, new components for Visual Basic and Visual C++, as well as an MFC-based Office 2007 Ribbon. Web developers will see continued improvement in the client-side script tooling including JavaScript IntelliSense. Additionally, full support for SQL Server 2008, the ADO.NET Entity Framework and performance improvements for the IDE make Service Pack 1 a great release across the board.
Visual Studio 2008 Service Pack 1 includes:
- Improved designers for building WPF applications
- Full support for SQL Server 2008
- The introduction of the ADO.NET Entity Designer
- Visual Basic and Visual C++ components and tools (including an MFC-based Office 2007 style 'Ribbon')
- Improvements to Team Foundation Server to respond to customer feedback on version control usability and performance, improved e-mail integration with work item tracking and full support for hosting on SQL Server 2008
- Improvements for Web development including richer JavaScript support, enhanced AJAX and data tools, and Web site deployment
The .NET Framework 3.5 Service Pack 1 includes:
- Performance increases between 20-45% for WPF-based applications - without having to change any code
- WCF improvements that give developers more control over the way they access data and services
- Streamlined installation experience for client applications
- Improvements in the area of data platform, such as the ADO.NET Entity Framework, ADO.NET Data Services and support for SQL Server 2008's new features.
In addition, Service Pack 1 for the .NET Framework and Visual Studio 2008 includes a number of new features:
- Windows Presentation Foundation (WPF) and Visual Designer Changes
- .NET Framework 3.5 Client Profile
- New ADO.NET Data Features
- Team Foundation Server Improvements
For more information and links to downloads, see the MSDN site Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 Beta Downloads. You’ll also find details about known compatibility issues in certain releases of Expression and Silverlight. For more information about what you'll see in the new releases, see Visual Studio 2008 and .NET Framework 3.5 Service Pack 1 Beta.
|
|
|
|
|
OK, please be gentle, I am a newbie to any form of windows coding.
I am attempting to build an application that places some files on a remote server defined as a UNC path.
Now if the path is pre-authenticated on the xp client all works well. But if the password has changed or never been pre authenticated of course I get an System.IO.IOException: Logon failure: unknown user name or bad password.
So the question is.
How the heck do I authenticate from my c#.net app against the remote server to establish a successful connection.
I would have thought the UNC file path could have contained the user credentials, But alas I cannot find it despite searching through the mountains all the search engines generate
|
|
|
|
|
try "IWshRuntimeLibrary". if you have username password of remote server you can map a network drive. Actually it is a win32 library but you can find how to use it from c#.
hope this help.
|
|
|
|
|
Do you know a component or package in .NET that enable synchronize between folder located in FTP server and between local folder?
In addidtion, how many connection can I open simultaneous (using threads) in such synchronization package?
|
|
|
|