|
Is it possible, if so how, using Visual Studio 2005 and write code against v1.1 of the .NET framework?
I need to convert an MFC C++ project to C# but using v1.1 of the .NET framework. I would rather not have to re-install VS 2003, but if there is no other way then so be it...
|
|
|
|
|
Hi,
Andy H wrote: Is it possible, if so how, using Visual Studio 2005 and write code against v1.1 of the .NET framework?
No way!
Robert
|
|
|
|
|
Can anyone help me take a back up of sql express database to export to sql server 2000
regards
Hari
|
|
|
|
|
I am working with the new FlatAppearance class under the
System.Windows.Forms.Button control in 2.0 and am creating a flat button. I
set the button FlatStyle to Flat and the FlatAppearance.BorderSize to 1.
When I run the app the border is exactly 2 pixels and not 1.
Is there anolther property you are suppose to set on the control or is this
simply a bug?
Thanks,
Anton
|
|
|
|
|
Hi,
I need some basic low level details of what happens when you ngen a .NET assembly.
Lets take a c++ code which when compiled creates a binary executable. On executing this binary, the OS allocates memory for the process and executes it. No concept of runtime or CLR here. Everything is present in the binary.
I read the MSDN and understand that .NGEN creates a native image of the code and avoids JIT compilation while execution by the CLR. Hence, at the end, I understand that the ngen creates binary code for specific processor.
If the native code (binary) is ready then why cant the OS take care of executing it and why the .NET runtime has to do the execution?
What does the CLR do then for a ngended assembly ?
I seem to get confused with this concept.Please clarify.
Thanks,
Mani
|
|
|
|
|
When NGen compiles your IL into a native assembly is still uses the CLR and the .NET framework class libraries. Also there would be a problem with updates to the .NET framework. For example if there was a security hole in the console.writeline method and you installed a patch for it then all the apps that use that method would not be updated and would require re-Ngening.
Here are some pros and cons to NGening.
PROS:
Improved application startup time: Since there is no JIT compilation.
Reducing the apps working set: Best if the app is going to be loaded into mutliple AppDomain or processes at the same time. Although the working set will still be less if not being used in multiple appdomains/processes.
CONS:
NGen files can get out of sync: updates to the hardware or .NET Framework will cause this.
Load-time performance hit: NGen files have the memory address references statically calculated. If for some reason it cannot be loaded at its preferred base address then it will require rebasing (Windows will have to relocate the file and fix up memory address references.)
Slower runtime performance: Ngen cannot make as many assumptions about the hardware and OS as the JIT can. The JIT can perform many more optimizations than NGen
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Hi,
Captain See SharpSlower runtime performance: Ngen cannot make as many assumptions about the hardware and OS as the JIT can. The JIT can perform many more optimizations than NGen
Is this always true, also when NGening the assemblies directly on the target machine?
Robert
|
|
|
|
|
So, if I have a stand alone .NET application in a system, Ngening those .NET assemblies is recommended or not.
Please clarify.
|
|
|
|
|
He is Cool wrote: So, if I have a stand alone .NET application in a system, Ngening those .NET assemblies is recommended or not.
You would definitly not NGen an assembly if it is a server application as the performace hit would only be on the first request. In general you should not NGen an assembly unless you have a very good reason to and in most cases there is no reason to. One reason to NGen an assembly would be to reduce the working set and improve startup performance but usually the overall runtime performance of your app would not be as good as if it were JITed.
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Robert Rohde wrote: Is this always true, also when NGening the assemblies directly on the target machine?
Yes. NGened asemblies run about %5 slower than a JITed assembly.
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Hi ...
I was wondering if there is a library that i can use from vb or c# .net in order to implement a custom internet gateway (with or without ICS).
I want to block/permit or limit connection bandwidth of a specific mac address etc.
thanks...
|
|
|
|
|
Hi all
I currently get the following error randomly in my software application - Native Exception Error: 0xc0000005.
This is a .NET Compact Framework 1.1 application for PocketPC 2002. I am using a Symbol PDT8037.
I am also using OpenNetCF 1.4.
It is all written in C#.
There are some calls to the Win32 library. E.g. setting the time on the PDA.
Also I use Symboll DLLs to access the inbuilt barcode scanner. Would these be Native code?
I am not using SQL CE.
My understanding of a Native Exception Error means that native code, e.g. C/C++ is using an address space and hasn't cleaned itself correctly. Then managed code, e.g. C#, is later accessing that same address space. Then CRASH!
Is this correct or am I totally on the wrong track?
Does anyone else get these errors?
This mainly happens 90% of the time in our Products screen which utilises the barcode scanner. I don't want to be quick in blaming Symbol though in case it is my own code.
I couldn't find too much information on the Internet. One strategy I implemented was to disable ALL native code (including the barcode scanner). However the crashes still occurred, albiet less frequently.
I'm at a loss. Can anyone help?
Mark C Eaton
|
|
|
|
|
0xc0000005 is an access violation, quite often caused by dereferencing a null pointer.
|
|
|
|
|
Hi Luc
Thanks for the reply.
Unfortunately in my case it may not be that simple?
As an example, for my Products screen, this can happen when they add a product or even save.
An end user can even close this screen and save successfully, go to another screen, then the dreaded Native Exception Error.
The above is all handled by managed code, C#. When disabling the unmanaged code I still get these Native Exception Errors, although they seem to be less common - so in this instance I'm not using any pointers.
These crashes are random and intermittent. There seems to be no pattern. I have about 35 end users working with this software and for some they don't get any of these Native Exception Errors. Others will get this error once a week. Still others will get it 3 times a day!
They all use the software as much as each other as I keep tabs on their usage.
Hope this makes sense.
Mark Eaton
|
|
|
|
|
Hi Marc,
if the problem occurs even when the application is running without using unmanaged code
at all, it is a mystery. If some unmanaged code is involved, a crash (even a delayed one)
is possible when a fundamental mistake is present such as:
- dereferencing a null pointer
- using incorrect calling conventions resulting in stack problems
[DllImport("kernel32.dll", CallingConvention=CallingConvention.StdCall)]
- not pinning the managed objects
- and, of course, all kinds of bugs in the unmanaged code itself.
I would suggest putting try-catch constructs around every PInvoke call, and
logging all exceptions in order to track down the problem(s).
Hope this is useful to you.
Luc Pattyn
|
|
|
|
|
Hi Luc
Thanks for the quick reply.
I hope there isn't bugs in the unmanaged code as it is 3rd party software.
But one thing you suggested that I'm not doing enough is try/catch blocks around the unmanged code.
I will also double check the calling convections.
I don't understand "not pinning the managed objects". What does this mean?
Thanks again for you help.
Kind regards
Mark Eaton
|
|
|
|
|
Hi Mark,
when passing a managed object's pointer to unmanaged code, you better make sure the object
does not get moved around by the garbage collector while in use by unmanaged code.
The following code snippet illustrates this:
// pass a managed byte array to an unmanaged C/C++ function:
public int Read(byte[] data, int len) {
try {
// check boundaries (bad len would cause an exception !)
data[0]=0;
data[len-1]=0;
// pin the array in memory, get its base adr
GCHandle dataHandle=GCHandle.Alloc(data, GCHandleType.Pinned);
int dataPtr=dataHandle.AddrOfPinnedObject().ToInt32();
int result=nativeCall(dataPtr, len);
dataHandle.Free(); // release the pinned array
return result;
} catch (Exception exc) {...log.and.return.errorcode...}
}
The above is the design pattern I often use for passing arrays to unmanaged C code.
Best regards,
Luc Pattyn.
|
|
|
|
|
Hi Luc
This hasn't even occurred to me. I appreciate the code example as well.
If you have any other suggestions I am happy to hear them.
Unfortunately it will take some days to get my code fully tested but I will try everything you suggested.
Kind regards
Mark Eaton
|
|
|
|
|
I Have a window 2003 server machine. I Installed visual studio.NET 2003 on my machine.
In Microsoft visual studio .NET 2003 a error is occured ,
when I want to create a new project in ASP.NET Web
Application visual studio .net has dected that the web
server is runing ASP.NET version 1.0.
The web application you are creating or opening can be
configured to be complaint with ASP.NET 1.0 .
however , the application will not able to use new
features from ASP.NET 1.1 .
So I can't work on my machine for Dot Net .
Plz sugess me for this .
Thanks all off u .
nilesh
|
|
|
|
|
Is IIS installed and running?
Mike Lasseter
|
|
|
|
|
Bah, I've been working on this forever now and I can't seem to find why this error happens.
Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'Ingramtest.Order(1359c91a-86bf-d041-3a7a-ef48ebb10fa7)'.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 198894a5-41a3-407a-bc2f-2e492cc9ed03
Shape name: Send_7
ShapeId: efb1d8a7-4fa2-4f3d-b135-7119a999de7d
Exception thrown from: segment 1, progress 36
Inner exception: Exception occurred when persisting state to the database.
Exception type: PersistenceException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void Commit()
The following is a stack trace that identifies the location where the exception occured
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXXlangStore.Commit()
at Microsoft.XLANGs.Core.Service.Persist(Boolean dehydrate, Context ctx, Boolean idleRequired, Boolean finalPersist, Boolean bypassCommit, Boolean terminate)
at Microsoft.XLANGs.Core.ServiceContext.PendingCommit(Boolean ignore, XMessage msg)
at Microsoft.XLANGs.Core.ExceptionHandlingContext.PendingCommit(Boolean ignoreCommit, XMessage msg)
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.SendMessage(Int32 iOperation, XLANGMessage msg, Correlation[] initCorrelations, Correlation[] followCorrelations, SubscriptionWrapper& subscriptionWrapper, Context cxt, Segment seg, ActivityFlags flags)
at Microsoft.XLANGs.Core.PortBase.SendMessage(Int32 iOperation, XLANGMessage msg, Correlation[] initCorrelations, Correlation[] followCorrelations, SubscriptionWrapper& subscriptionWrapper, Context cxt, Segment seg)
at Ingramtest.Order.segment1(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Additional error information:
A batch item failed persistence Item-ID 2c1195f7-fb56-4043-86b6-4aeeae7f8dd5 OperationType MAIO_CommitBatch Status -1061151960 ErrorInfo An error occurred when accessing the part data or one of its fragments. The part data or fragment may not exist in the database. .
Exception type: PersistenceItemException
Additional error information:
Failed to publish (send) a message in the batch. This is usually because there is no one expecting to receive this message. The error was An error occurred when accessing the part data or one of its fragments. The part data or fragment may not exist in the database. with status -1061151960.
Exception type: PublishMessageException
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
WM.
What about weapons of mass-construction?
|
|
|
|
|
I found the problem, at least I think I did.
The problem ocurred when I copied a message so that I had two messages of the same type. Removing the duplicate solved the problem.
But now there's a different problem, but I will contact MS about that, since there's a hotfix for it
WM.
What about weapons of mass-construction?
|
|
|
|
|
what is GAC(Global Assembly Cache)
Does any one know what is meant by digitally signing an assembly.
I any of you can provide useful link, i will be thankful to that person.
Warm Regards,
Mushq
|
|
|
|
|
The Global Assembly Cache is a location which the .NET Framework looks in for shared assemblies (used by more than one program). It looks here first for assemblies which have a strong name, which is a name that includes the version number, culture, and a public key token which identifies the publisher of that assembly. If not found in the GAC it will then fall back to the application directory and directories under it in the same way as for non-signed assemblies.
To ensure that the assembly has not been tampered with, it is digitally signed. This means that public-key cryptography has been used to attach a digital signature to the assembly. A hash (a fixed-size value generated by a one-way function which is highly likely to be unique to a particular input file) is generated, then that hash is encrypted with the publisher's private key to form the signature. On the end-user's system, the publisher's corresponding public key can then be used to decrypt the signature and compare it with re-computing the hash value. If they match, the assembly has not been altered and can potentially be assigned a level of trust as appropriate.
The public key token is a hash of the public key data, used because it is significantly shorter than the public key itself. If I recall correctly, the public key itself is actually attached to the binary since it is required for checking the signature.
Note that although this is a public/private key pair is used, this does not mean the key used has to be part of a public key infrastructure. You don't need to buy one from a Certification Authority, as you do with SSL or Authenticode code-signing certificates - you simply generate a key pair using the sn.exe utility.
|
|
|
|
|
I am using .net CF with PPC 2003 and SQLCE 2.0. I am having trouble getting a simple pull of a table to the emulator. I am getting an HRESULT error 28037. I am not sure what to do. Here is a clip of the code. Does anyone have an idea?
thanks,
Saurabh Gupta
Software Engineer
|
|
|
|