Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / May 2006

Tip: Looking for answers? Try searching our database.

Setup project is using incorrect codeBase property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gil Lund - 19 May 2006 03:21 GMT
I have 3 DLL's that are using COM interop to communicate with a VB6 DLL.  
When I create a setup project for this solution to install on other machines
everything looks great and the DLL's are working great...until I try to call
a custom struct inside one of the DLL's and then I get the "Assembly cannot
find one of it's references..." error.  I found that the setup program
installed the following entry in the registry for this structure.  This entry
is in addition to the standard COM reference entry.  The problem is that the
codeBase key of this struct record is not the codeBase I specified when
running the setup.msi to install these DLL's and therefore it's not found.  I
can fix the problem by manually correcting the codeBase entry but I need to
have the setup program work correctly.  Any ideas on how I can configure the
setup program to stop using two different codeBase keys for the same DLL?

[HKEY_CLASSES_ROOT\Record\{0F94C157-4F0C-3A32-A1F5-1ACC74171A27}\1.0.0.1]
"CodeBase"="file:///C:/Documents and Settings/Gil/My
Documents/LEI/290b-BoeingSparTool/Visual Studio
Projects/290b-LaSHDataAccess-Jerry/112305/LaSHDataAccess/obj/Release/LaSHDataAccess.DLL"
"Class"="LaSHDataAccess.DataAccess+ToolEventStruct"
"Assembly"="LaSHDataAccess, Version=1.0.0.1, Culture=neutral,
PublicKeyToken=475da81253b912e1"

Signature

Gil

"Gary Chang[MSFT]" - 19 May 2006 10:50 GMT
Hi Gil,

Thank you posting!

>I found that the setup program installed the following entry
>in the registry for this structure.  This entry is in addition to
>the standard COM reference entry.  

Since you do not add those registry reference entries to your setup
project, can you find those entries in the resulting installation package
(.msi file)'s Registry table?

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Gil Lund - 19 May 2006 17:08 GMT
Thanks for the response Gary. Can you point me to the procedure to evaluate
the msi file registry table?  I saw a program called msiexec when I googled
but could not easily see how to use it.

Signature

Gil

> Hi Gil,
>
[quoted text clipped - 19 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Gary Chang[MSFT]" - 22 May 2006 06:42 GMT
Hi Gil,

You can use the platform SDK utility ORCA.exe to open your installation
package(.msi).

The ORCA setup program is included in the Platform SDK package, when you
install the PSDK, make sure to select the Microsoft Windows Installer SDK.
After you installed the Platform SDK, you can find the ORCA setup
program(Orca.msi) in PSDK's bin directory.

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Gil Lund - 29 May 2006 18:40 GMT
Gary,  I installed orca.exe and reviewed the registry table.  The VS setup
project is indeed adding the "Record" entries with the incorrect CodeBase key
hardcoded to my dev environment.  The CodeBase for the DLL in which my struct
lives looks like it's getting the right entry with a pointer to the component
that will be resolved during install time (See inprocServer32 record).

Record\{170F76A2-4005-337E-9E7E-EC0ECA7E1238}\1.0.2152.42197
CodeBase= file:///C:/US Motion/LaSH Former/LaSHCore/obj/Debug/LaSHCore.DLL

CLSID\{56306667-621D-42BD-8C5F-607563E8C4C1}\InprocServer32
CodeBase=[#_7D0F977CED2FAA4A76A946529868AD3F]

The struct in which these wierd "Record" reg entries are being created is
typed below.  Does the attribution have this impact?  Why Does the

CLR need both the COM interop reg entry and the "record" entry to run this
code.  When I call a method that does not use this struct and

view how the references are resolved I see that it uses the inProcServer32
codebase.  When I call a method that uses this struct the CLR

uses the "Record" codeBase key to resolve and throws an error because the
DLL is not installed to this directory.

   <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
   Public Structure HeaderStruct
       Public FormDataHeader_ID As Integer
       Public Operator_ID As Integer
       <MarshalAs(UnmanagedType.BStr)> _
       Public ProgramName As String
       <MarshalAs(UnmanagedType.BStr)> _
       Public LMSerialNumber As String
       <MarshalAs(UnmanagedType.BStr)> _
       Public ProductSerialNumber As String
       <MarshalAs(UnmanagedType.BStr)> _
       Public WorkOrder As String
       Public DateFormInitiated As Date
       Public CreateDate As Date
   End Structure

Any ideas on where to look next?
Signature

Gil

> Hi Gil,
>
[quoted text clipped - 17 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Gary Chang[MSFT]" - 30 May 2006 07:31 GMT
Hi Gil,

Thanks for the response!

Since the VS setup project auto generate those registry entries for that
struct, it may be as expected. But I am not very experienced about the .NET
interop issues, I suggest you can consult this issue in our related
dotnet.framework.interop newsgroup.

Back to your setup project, if you directly delete those problematic
registry entries in the Registry table, is it OK?

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Gil Lund - 30 May 2006 16:01 GMT
Gary,   What's the best way to cross-post this in the interop forum?  Can I
just link a reference to this post?  I am not a seasoned blogger in this area.

Signature

Gil

> Hi Gil,
>
[quoted text clipped - 19 lines]
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Gary Chang[MSFT]" - 31 May 2006 04:31 GMT
Hi Gil,

I suggest you post a stand-alone question to that newsgroup--e.g. why the
.dotnet framework will generate the problematic CodeBase registry entry for
that specific struct, is there any problem with the struct declaration...

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.