19May Beta Days Afternoon
Well the afternoon was better and worse. We had a crash of Visual Studio and some “do you want to send Microsoft the details of this error” screens.
Mike Downen:
Program Manager, CLR
CAS – Code access security.
Identity is where the code is coming from or what is the strong name of the exe…
You can set a access restriction on the domain or strongly typed name to grant certain permissions.
It looks like Clickonce will allow you to be asked if you are going to trust this application or it can be signed by a trusted certification.
Look for the publish tab. This asks where you are going to publish it etc.
Avalon is also using Clickonce, which will use 2.0 of the framework. This will help in distribution.
There is now a tool that helps you figure out what security your code will require to run.
Permcalc is the exe – it is on the security pane in VS.NET 2005.
It really “walks your call graph” to see what is needed by your code. This will also generate the xml needed for the manifest.xml.
As a note you can allow file IO permissions to a certain folder. Permcalc wont do this normally, so you will need to modify the xml yourself.
Debug in Zone allows you to test your app within a defined zone so that you can test within a security context.
Claudio Caldato:
CLR performance.
Claudio displayed a slide that talked about making performance part of your culture as well as budgeting planning etc. I think this really shows that he has a great idea how getting something like performance into the minds of the programmer is a challenge. Performance, being part of QA (at least in my mind and position) is something that cannot be accomplished without the entire team, from the CEO to the Developer being involved and having BUY IN. It isn’t that developers need to be convinced that performance and QA are their goals and necessary, it is that it needs to be part of the nature at the company.
Garbage Collection:
Generation 0
Object still referenced are compacted and keep alive they are then placed in generation 1
Generation 1 and 2 are defined as anything that has lived past generation 0and 1 respectively… Collecting Generation 2 is very expensive.
Large object heap is separate. Anything that is over 85K will go here.
Two types of GC
Workstation GC and the Server GC. Algorithms are different for each type. The server GC is used on servers with more than one processor etc.
GC us self tuning. It will tune itself for your application, environment and use.
Things to reduce GC time (improves performance):
1. Set object to nothing (NULL)
2. Implicit Boxing Don’t place integers into array lists (in 1.1 or lower).
3. Pin young object. Sockets buffer is pinned in memory. It cannot be moved. GC will not be able to move it and GC(0) heap will be fragmented.
4. Don’t use GC.Collect!!
5. Use dispose() when possible. .Dispose and NOT .fininalize
Finalize method is called on object. That object is moved to the finalizer que. Next go around the GC will clean up the que (this takes time) causes memory blocks in the clr profiler not the right triangles that we want.
Use dispose pattern. Implement Idisposable, call gc.suppressfinalize, hold few objFields, dispose early when possible use ‘using’ (C#) ??
CLR profiler:
App using concatenation:
Tell it you want to profile the application. It takes a while to run.
Allocated bytes: 1.7Gig – how much we used in the app
ReAllocated bytes 12M – GC had to move this memory
GC was called 3,000 times in the application.
App using stringbuilder:
Allocated bytes: 21M – how much we used in the app
ReAllocated bytes 200K – GC had to move this memory
GC was called 40 times in the application.
Dispose Vs. Finalizer:
App using finalize:
Allocated bytes: 9M – how much we used in the app
ReAllocated bytes 3.5M – GC had to move this memory
GC was called 70 times in the application.
App using dispose (by using using): (just call dispose)
Allocated bytes: 8.9M – how much we used in the app
ReAllocated bytes 10K – GC had to move this memory
GC was called 70 times in the application.
It looks like you want a right triangle with on each collection with the hypotenuse on the left.
Jay Roxe:
My.?? Is new.
My.Application
ClickOnce does not need 2.0 on the webserver. It does need 1.1 at least.
- I got a Channel9 guy for asking this.
I plan to offer my audio application and allow anyone to upload. Problems with this are that the ftp username and PWD wont go well in the app even if ofuscated.
For now I can easily ensure my wife’s laptop has the latest exe buy uploading it to the site.
You can install from a CD or from web or UNC.
MenuStrip is cool and you can include the default items.
Right click on project and publish…
The CAS will allow me to specify the temporary location to which I am going to save the WMV file temporarily.
.NET framework installation needs to be installed by an admin. My application will not.
The clickonce application will ask you in add/remove application if you want to remove or just rollback.
My.Computer.ports, .audio look cool.
RegFree COM
Just include it in the project as per normal.
The use it,
He was using me.everything in VB. Do we really need to do this?
MSDN refactor is free from a 3rd party… go to msdn.com devsoft??

