-
Dec 5th, 2014, 07:18 AM
#1
Template with DLL Reference
I am working on creating a new starting point(template) for all of our new applications so that as much as possible they have the same look and feel. The template has reference to a common DLL we have written. I am able to export the template without issue.
When I create a new project based on the template the path to the DLL is missing which causes a bunch of errors.
The prior attempt at creating this standard template has a DLL and when I export it and then use it doesn't have the same issue. I am having difficulty spotting the difference.
-
Dec 5th, 2014, 02:58 PM
#2
Re: Template with DLL Reference
Originally Posted by dbasnett
I am working on creating a new starting point(template) for all of our new applications so that as much as possible they have the same look and feel. The template has reference to a common DLL we have written. I am able to export the template without issue.
When I create a new project based on the template the path to the DLL is missing which causes a bunch of errors.
Does the problem manifest itself on the machine/account used to develop the template, or only on other accounts?
When you say the path is missing, do you mean that the "<HintPath>" tag in the .vbproj file is missing?
-
Dec 5th, 2014, 03:17 PM
#3
Re: Template with DLL Reference
Originally Posted by TnTinMN
Does the problem manifest itself on the machine/account used to develop the template, or only on other accounts?
When you say the path is missing, do you mean that the "<HintPath>" tag in the .vbproj file is missing?
Same machine, same account.
When I create the new project from the template the path in the references section of the project properties says, "<The system cannot find the reference specified>"
-
Dec 5th, 2014, 04:01 PM
#4
Re: Template with DLL Reference
The only way that I could reproduce that type of error is if the template source project references a class library from a secondary project within the same solution. Does that ring a bell?
-
Dec 5th, 2014, 04:50 PM
#5
Re: Template with DLL Reference
Originally Posted by TnTinMN
The only way that I could reproduce that type of error is if the template source project references a class library from a secondary project within the same solution. Does that ring a bell?
I have a project that produces the DLL. The template project has a reference to that.
-
Dec 5th, 2014, 05:17 PM
#6
Re: Template with DLL Reference
All I can suggest at this point is to unzip the template and take a look at the ProjName.vbproj file with a text editor to figure out where it is trying to find the DLL. It is just an Xml file.
Look for a ItemGroup block that looks something like the one below. This one has an absolute path, but they can also be relative.
Code:
<ItemGroup>
<Reference Include="NativeMethods">
<HintPath>E:\My Documents\Visual Studio 2008\Projects\NativeMethods\NativeMethods\bin\Debug\NativeMethods.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
-
Dec 8th, 2014, 01:35 PM
#7
Re: Template with DLL Reference
Originally Posted by TnTinMN
All I can suggest at this point is to unzip the template and take a look at the ProjName.vbproj file with a text editor to figure out where it is trying to find the DLL. It is just an Xml file.
Look for a ItemGroup block that looks something like the one below. This one has an absolute path, but they can also be relative.
Code:
<ItemGroup>
<Reference Include="NativeMethods">
<HintPath>E:\My Documents\Visual Studio 2008\Projects\NativeMethods\NativeMethods\bin\Debug\NativeMethods.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
The problem is that the hint path has a relative path instead of an absolute path. The path in the reference is absolute.
-
Dec 8th, 2014, 02:36 PM
#8
Re: Template with DLL Reference
Originally Posted by dbasnett
The problem is that the hint path has a relative path instead of an absolute path. The path in the reference is absolute.
I do not know how to force the template wizard to use absolute paths. It is probably easiest to just edit the path yourself, save it, and re-zip the template files.
See: Manually Updating an Existing Template
-
Dec 8th, 2014, 04:43 PM
#9
Re: Template with DLL Reference
Originally Posted by TnTinMN
I do not know how to force the template wizard to use absolute paths. It is probably easiest to just edit the path yourself, save it, and re-zip the template files.
See: Manually Updating an Existing Template
In the .vbproj file for the project that creates the template I changed the HintPath to have the absolute pathname of the DLL. I then created the template and when I used it, the resulting project had the correct path.
I created a new project and added the same reference. When I looked at the HintPath is had the absolute value. So the question is how did the original path get hosed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|