Referencing .NET 2.0 but end result uses .NET 3.5

I'm using DevStudio 2005 and I have a project that references
System.dll ver 2.0.50727 and I accidentally compiled code that used an
overload that only exists in version 3.5 because my intellisense
showed it.
I tried to compile it on another machine that never had the .NET 3.5
install and it wouldn't compile and the intellisense had that version
of the overload yet both references looked identical; looking at ver
2.0 of System.dll
The method in question was WaitHandle.WaitOne.

..NET 2.0
	WaitOne()
	WaitOne(Int32, Boolean)
	WaitOne(TimeSpan, Boolean)

..NET 3.5
	WaitOne()
	WaitOne(Int32)
	WaitOne(TimeSpan)
	WaitOne(Int32, Boolean)
	WaitOne(TimeSpan, Boolean)

I used the one that just takes an int.

How can I guarantee that I only use .NET v2.0 dlls if the references
are obviously lying???  I don't want to accidentally compile it
against 3.5 and then put it on a machine that doesn't support that
version and wonder why it won't run.

0
Israel
3/12/2010 3:23:33 PM
dotnet.general 306 articles. 0 followers. Follow

5 Replies
721 Views

Similar Articles

[PageSpeed] 44

On Mar 12, 5:23=A0pm, Israel <israeldip...@hotmail.com> wrote:

> How can I guarantee that I only use .NET v2.0 dlls if the references
> are obviously lying??? =A0I don't want to accidentally compile it
> against 3.5 and then put it on a machine that doesn't support that
> version and wonder why it won't run.

Reinstall?  You are screwed, sorry to say.  This happens when you have
several versions of VS --a real pain.

RL
0
RayLopez99
3/12/2010 3:38:39 PM
Israel wrote:
> I'm using DevStudio 2005 and I have a project that references
> System.dll ver 2.0.50727 and I accidentally compiled code that used an
> overload that only exists in version 3.5 because my intellisense
> showed it.
> I tried to compile it on another machine that never had the .NET 3.5
> install and it wouldn't compile and the intellisense had that version
> of the overload yet both references looked identical; looking at ver
> 2.0 of System.dll
> The method in question was WaitHandle.WaitOne.
> [...]
>  How can I guarantee that I only use .NET v2.0 dlls if the references
> are obviously lying???  I don't want to accidentally compile it
> against 3.5 and then put it on a machine that doesn't support that
> version and wonder why it won't run.

You should be able to set the "exact version" property for the reference 
to force a specific version to be used.  That will unnecessarily 
restrict your application to older versions of the assemblies, but I 
think in VS2005 that's as close as you can get.

A better approach would be to use VS2008 or later, which allows you to 
set the project to target a specific version of .NET, without actually 
forcing a dependency on a specific DLL version.

Of course, another option if you must use VS2005 is simply to make sure 
you are doing your development work in the same environment that you're 
targeting.  If you can't dedicate a separate machine for that purpose, 
you could use a VM.  Windows 7 includes XP Virtual Mode (well, you have 
to download it, but it's free), which you could use for that.

Pete
0
Peter
3/12/2010 4:56:29 PM
On Mar 12, 11:56=A0am, Peter Duniho <no.peted.s...@no.nwlink.spam.com>
wrote:
> You should be able to set the "exact version" property for the reference
> to force a specific version to be used. =A0That will unnecessarily
> restrict your application to older versions of the assemblies, but I
> think in VS2005 that's as close as you can get.

Actually that doesn't seem to work.  I set "Specific Version" on the
System reference to True and rebuilt it and it was perfectly happy to
use the .NET 3.5 version even though I specified the 2.0 version and
Specific Version =3D True

0
Israel
3/12/2010 6:19:04 PM
On Mar 12, 1:19=A0pm, Israel <israeldip...@hotmail.com> wrote:
> Actually that doesn't seem to work. =A0I set "Specific Version" on the
> System reference to True and rebuilt it and it was perfectly happy to
> use the .NET 3.5 version even though I specified the 2.0 version and
> Specific Version =3D True

The System.dll that ended up in the debug folder was the same either
way; version 2.0.50727.3053 but it's like that version actually has
3.5 APIs in it on my machine but not on other people's machines???
On my machine I can only find 2 System.dlls - one in C:\WINDOWS
\Microsoft.NET\v1.1.4322 and one in v2.0.50727.  If I look at
installed programs I see:
..NET FW 1.1
..NET FW 2.0 SP 2
..NET FW 3.0 SP 3
..NET FW 3.5 SP 1

0
Israel
3/12/2010 6:31:11 PM
I guess it turns out that the System.dll under the "2.0" folder was
replaced for 3.5
so the original version was 2.0.50727.1433 but if you have .NET
installed then it's 2.0.50727.3053

Therefore once you install 3.5 there's no way to ever go back to 2.0
even though it seems like you should.  The problem I have with this
type of versioning is that our install only checks that a machine has
2.0 installed because that's what we thought we needed.  Now it really
needs to check that 3.5 is installed but hopefully they don't continue
this pattern into future releases.
0
Israel
3/12/2010 7:29:53 PM
Reply:

Similar Artilces:

Lookup based on criteria in 2 columns
Hi, I am trying to use a vlookup or other function to return the value in the amount column based on the location and date. Here is a sample of my data: Location Date Amount 101 9/15/8 10 101 9/16/8 20 101 9/17/8 15 102 9/15/8 50 102 9/16/8 75 102 9/17/8 67 For example if I wanted to return the amount for location 102 on 9/15/8, what formula would I use? I tried using variations of vlookups but had no luck. Thanks, =SUMPRODUCT(--(A2:A50=102),--(B2:B50=DATE(2008,9,15)),C2:C50) -- Regards, Peo Sjo...

Rollup 2 and Office 2007
I already have Roll Up 1 and the Office 2007 compatibility patch installed. If I now install roll up 2 will I have to reinstall the office 2007 compatibility? yes -- Regards, MS CRM Certified Professional http://microsoftcrm3.blogspot.com Chat with me on MSN / Gmail / Skype : ID Is :.. mscrmexpert@gmail.com "LLoyd" wrote: > I already have Roll Up 1 and the Office 2007 compatibility patch installed. > If I now install roll up 2 will I have to reinstall the office 2007 > compatibility? ...

Using expression builder object
Hi, I'm developing a wizzard in Access which builds import templates for various data sources to a fixed set of tables. In step 3 the users must be able to build an expression ; for instance Left([Fieldx],20) . Now I would like to have a command button on my form which calls the Access expression builder to allow the users to use this to build the expression. This expression will then be stored in a text box linked to the templates table. Anybody know how to call and use this object from VBA code? -- Kind regards Noëlla DoCmd.RunCommand acCmdInvokeBuilder I th...

Outlook 2003 keeps crashing #2
I get this message when I look in System information. Outlook keeps crashing quite often. I cannot for example delete two messages without outlook crashing. My colleagues do not have this problem. We are using the Microsoft mail exhange server. Faulting application outlook.exe, version 11.0.5510.0, stamp 3f1380f0, faulting module mso.dll, version 11.0.5606.0, stamp 3f334cce, debug? 0, fault address 0x003b6e16. Does anyone has a solution?=20 Best regards/ Bj=F6rn 1) I would definitely apply Service Pack 2for Office 2003 + applicable critical security updates. 2) Have you tried starting O...

Microsoft POS #2
I have a group of customers that I am working on setting up A bundled POS system for. I have looked at RMS and Microsoft POS. The customer's are small bulk food stores. They package all of the bulk food in various containers and weigh it with a Hobart scale producing a label with an system 2 price enbedded barcode. These are UPC A formats. They are for the most part simple single store installs and donot require the complex RMS system. I have setup the Microsoft POS version 2.0 and found it will work perfect for these customers. The only problem when you programed the system you l...

Using part of a cell in a chart title
I have a chart which should get a title. However, this should be partly be used from a cell e.g. "counted with 5%" 5% should be taken from the cell and used in the title. Is this possible? Hi, Yes it's possible but all of the chart title needs to be in the cell. So you may need to use a helper cell and concatenate text and value. http://www.andypope.info/tips/tip001.htm Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Nicole" <Nicole@discussions.microsoft.com> wrote in message news:5CB7A971-AA7F-4C34-BB42-7DC283AA2958@micro...

Copy entire row where CellValue=0
I need to loop through the collumn and search for value that is more then 0. When I find it I need to copy whole row and paste it 2-3 rows below the table. I tried to select the collumn and search the selection but for some reason I copy and paste only one row. Thank you for any help. Hi as a starting point: http://www.rondebruin.nl/copy5.htm -- Regards Frank Kabel Frankfurt, Germany "OxanaB" <OxanaB@discussions.microsoft.com> schrieb im Newsbeitrag news:8628F791-CF2D-480A-9EBF-6C31BCEF0293@microsoft.com... > I need to loop through the collumn and search for value tha...

pop3 #3
My outlook express hasnt been working since I got my new Dell computer. It says that the "POP3" isnt connected so i cant receive or send e-mail!!! HELP!! How do i fix this problem? I've tried calling Dell and Microsoft and have waited hours on the phone and have not gotten any assistance! Who is your ISP/mail host? Seems like you might want to contact them for support. I presume you can get to the Internet just fine.... rose wrote: > My outlook express hasnt been working since I got my new > Dell computer. It says that the "POP3" isnt connected so > i ca...

Filter recordset using query results
Hi all I have a form based on a query called [qry Quarterly Planning], it lists all Itineraries on the system. On this form you can filter records by specifying a Start and End Date for the [ReviewDate] and/or [Specialist]. It is a subform on a main unbound form, lets call this Subform1. Along side this I have another subform (Subform2) which displays ReviewDates that exist against an Itinerary. In other words Subform1 has a start date of an activity and if the activity lasts longer than 1 day, then the additional dates are stored in Subform2 (ItineraryDates). Currently when I...

How do I use traffic lights in excel
I am wanting to use traffic lights in excel that change colour based on the result of a variance cell, ie if the result of the cell is 10 make the traffic light green, if it is 20 make the traffic light amber, if the result is 30 make the traffic light red. How do I do this? Shorty Format>Conditional Formatting>Cell Value is: Note: you can add up to 3 conditions(4 if you count default) Gord Dibben Excel MVP On Wed, 22 Dec 2004 16:35:03 -0800, Shorty <Shorty@discussions.microsoft.com> wrote: >I am wanting to use traffic lights in excel that change colour based on the &g...

Sorting Data #5
Is there formula or anyway to be able sort the below data into a format that I could create a pivot table on? I spend to many hours doing this every month. Invoice #: 12345 Invoice Date: 1/16/1950 A/P Code: ABC Due Date: 1/16/1950 Total Payable: $100.00 Reference: Freight: Account #: 1234 Description: Name Reference 1 Amount: $100.00 Account #: 4321 Description: Name Reference 2 Amount: $100.00 Account #: 9876 Description: Name Reference 3 Amount: $100.00 Any help would be much appreciated!! You need to show a Before and After version. You still might not get any help, but your ...

dates #5
Is there a formula to ad a numeric value to the name of a month. I am running a query in excel (pulling from an external source) and would like to sort as teh table refreshes by month and year. I have code to to do the refresh and the sort, but it sorts in alphabetical order. I was thinking a formula could place a numeric value to the month (1 = Jan, 2 = Feb, etc) and I can sort based on that. Is there an easy formula to do this. Thanks in advance Your easy formula could be: =MATCH(A1,{"Jan","Feb","Mar","Apr","May","Jun"...

Please ignore #2
Testing a posting problem -- Jim Bunton ...

Using Visio HTML output within frames
Hi, I want to include visio HTML output in a frame of another html file. Unfortunately it is not working. I understood the problem is in vml_*.htm files. It is due to, the target arrtibute(pointing to _parent) in v:shapetype tag and href attribute (pointing to #) in v:shape tag. These attributes should point to "_top" and "<target-html-file>#" respectively inorder to work. I want to change these options while saving .vsd as web page? I would appreciate if you can help me in this regard. <v:shapetype id="VISSHAPE" target="_parent" coor...

2 register ruinning together on one z report
Is this possible, to have two registers running on one z report ? We have a small store and would like to setup a second register as a backup, temporary addition ( during rush hours) Since we are a small show i do not need to have a separate register reports. Can two registers ring up all sales together as one ? How can i set this up ? No, you can't do that. You might be able to use the Register Analysis report available in SO Manager Utilities/Crystal Reports to get something close to a single Z though. Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.c...

Outlook freezes after sending one email after upgrading 4.0
We just upgraded from 3.0 to 4.0 this weekend. All client machines have had the desktop client upgraded and 2 have the same issue. One is XP with Outlook 2003 and the other is Vista with Outlook 2007. Open opens and the CRM addin initializes correctly. As soon as you compose and send an email, Outlook locks up and you have to kill the process in task manager to close Outlook. I've had the same problem and have tried all I can think of...how did you fix this issue? Thank you. "Sander" wrote: > We just upgraded from 3.0 to 4.0 this weekend. All client machines have...

Newbie Question: Using Web Services
Hello All. I've been trying to implement Infopath with CRM with no success. I've tried the example, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmbscrm1_2/html/mbs_crminfopathcrmintegration.asp, to no avail. I have followed the example to the letter, but find the information about publishing the Web Service to the server to be somewhat lacking. Admittedly, I am not a programmer, and I am continually running into an error in line 54: xmlDoc.LoadXml(objQuery.ExecuteQuery(objBizUser.WhoAmI(), strAllAccountsFetchXML)); Has anyone else ...

McAfee 8.5.0i on access scan slows down MS Dynamics CRM web client
Our organization's McAfee 8.50i slows down MS Dynamics CRM v4 - on premise web client considerabley when loading forms and data. Besides completely disabling McAfee, does anyone know how to configure McAfee (or configure CRM) to ignore CRM related form and data loads. When disabling the oncaccess scan, or when disabling the scriptcan - it improves lookups from 8-9 seconds to 4-5 seconds. However, the organizatin policy is to have these enabled. What to do? We have the same behavior, and went we reported to Microsoft says that no solution has, then we buy and install Microsoft Securi...

Upgrade CRM 4.0 Professional to CRM 4.0 Enterprise
When I enter the CRM license code in the Deployment Manager to upgrade to Enterprise I get a message "The license code entered is not valid for upgrade. Make sure you have entered the license code correctly, and then try again". Do I have to reinstall CRM 4 to install Enterprise? Hi, what is your current installation? Professional? Have you entered trial version license keys ? /Aamir Current is Professional. I got the key from our MSDN subscription which didn't indicate a trial license. I was able to install the Enterprise edition on a test server using the same key w...

matching contents #2
E1 thru E10 contains sequentially-sorted data. B1 thru B6 contains sequentially-sorted data which matches SOME (but not ALL) of the data in Col A. For example. B E 1 1 1 2 3 2 3 4 3 4 5 4 5 6 5 6 10 6 7 7 8 8 9 9 10 10 I need to move the data in the cells in Col B next to the cells in Col E that have the same contents. For example: B E 1 1 1 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 8 8 9 9 10 10 10 Besides dr...

Workbook_Open Help #2
Hello Frank, Here's the code Private Sub Workbook_Open() ' Call Unhide_Sheets ' Sheets("CONTROLPANEL").Select Range("A1").Select Call Splash End Su -- Fabl ----------------------------------------------------------------------- Fable's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=218 View this thread: http://www.excelforum.com/showthread.php?threadid=26252 Hi and there's no application.screenupdating=false statement in your unhide procedure? -- Regards Frank Kabel Frankfurt, Germany "Fable" <Fable.1d07w...

Outlook Express 5 #2
On loading, error message "MSIMN caused an invalid page fault in module DIRECTDB.dll at 017f:7dbf3070.." Appeared to coincide with display config change? Ask in an Outlook Express forum. This is an Microsoft Office Outlook forum. Outlook Express is family of Internet Explorer and Outlook of the Office family. Here is the link for the right forum http://communities.microsoft.com/newsgroups/default.asp?icp=InternetExplorer Good Luck! -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tip of...

CRM 1.2 12-02-05
I have installed MS CRM 1.2 on a SBS 2003 server. Problem is I can only start the application if I log onto the server usind the server administrator account. If I try to access using a domain users account I just get a page cannot be displayed error, could somebody please help... Have you added the appropriate domain users as crm users using the deployment manager? "Redders" <Redders@discussions.microsoft.com> wrote in message news:D80FF8B4-78F1-4334-ACB5-2F772F0CF3B6@microsoft.com... > I have installed MS CRM 1.2 on a SBS 2003 server. Problem is I can only start >...

Send/Recieve error #3
I had few viruses in my computer that I cleaned up. Ever since, I face send/recieve error in my pop3 email account. I think I deleted a driver or somthing. Any idea? ...

reason codes #2
I'm having a big problem tracking discounts in RMS. Whenever something is discounted up front, a reason code is set. There are several I use for discounts. However, when I try to do an Item Movement History report and select based on those reason codes, I never get any matches. When I do an item history report for a few weeks, I notice that the only reason codes that are displayed are the ones pertaining to inventory adjustment. It seems that reason codes associated with discounts do not display in this report. HELP! I need these to display to track discounts (and also store use)! ...