Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2008 > C# 2008 aka C# 3.0
|
C# 2008 aka C# 3.0 Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 6th, 2008, 10:25 PM
Friend of Wrox
 
Join Date: Sep 2007
Posts: 169
Thanks: 7
Thanked 2 Times in 2 Posts
Default What am I doing wrong- Generating .dll

Hi

I am trying to take some C# class files and generate them into a dll. The only way I figured out how to do this was by making a class library.

I then added the files I wanted to this class library and built the project. I then went to my bin directory and took the .dll it made.

I stuck it into my projects(the project I want to use this .dll with) bin folder and then went add->references and added it in by browsing for for it.


It worked but now I noticed that when I debug my project and go to a line that class any of the class in it and hit F11 it actually goes into the .dll

So I might have:

MyLibrary test = new MyLibrary()

test.getStudentCount();

that would say be my method. Now when I would put a debug line in there and it go their and I hit F11. It would go actually into it.

I thought .dlls could not be opened up so what is going on?

 
Old December 7th, 2008, 01:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Since VS 2005, the default settings for BOTH Release builds and Debug builds of your assemblies allow the run-time to attach a debugger.

The default Release build attaches the following attribute to your assembly:

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Igno reSymbolStoreSequencePoints)]

The default Debug build attaches:

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Disa bleOptimizations | DebuggableAttribute.DebuggingModes.EnableEditAndCo ntinue | DebuggableAttribute.DebuggingModes.IgnoreSymbolSto reSequencePoints | DebuggableAttribute.DebuggingModes.Default)]

The run-time can attach a debugger to assembiles running in either of these debugging modes.

If you want an assembly that the run-time can’t attach a debugger to, right click your project file and select properties, click the Build tab, then the Advanced button. In the Advanced Build Settings dialog under Output --> Debug Info, select ‘None’. This will generate an assembly with no DebuggableAttribute, and a debugger won’t be able to attach to it. The VS default setting for Debug builds is ‘full’, and the default setting for Release builds is ‘pdb-only’. Generally, you will want to hold on to .pdb files for your Release builds too, though. Hence the default. No one will be able to step into your class libraries anyway unless they can first step into a source code file that references them. But you being able to step into your class libraries when working with your own source code is a good thing.

HTH,

Bob


 
Old December 7th, 2008, 04:56 PM
Friend of Wrox
 
Join Date: Sep 2007
Posts: 169
Thanks: 7
Thanked 2 Times in 2 Posts
Default

Thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Install problems - VS 6.0 on XP SCRRUN.DLL PDM.DLL jeff4444 Visual C++ 0 December 6th, 2006 08:48 PM
How to convert .NET dll to COM dll used by VB 6.0 gvprashanth .NET Framework 1.x 0 December 4th, 2006 05:05 AM
The database dll crdb_oracle.dll could not be load Yeliz Crystal Reports 0 October 18th, 2006 08:12 AM
DLL & Excel - keep having to reset DLL reference! James Diamond Pro VB 6 2 May 25th, 2004 03:37 AM
warning generating dll with IDataObject AitorHM C# 0 November 19th, 2003 02:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.