|
I have a website - MyWebSite - that uses the following class library projects within its solution as tiers: BusinessObjects, DataAccess, DataInterface.
I have a service - MyService - that uses the same tier structure in its own solution.
MyWebSite has a reference to MyService.dll which resides in its bin directory.
I have a Tester console app that resides within the MyService solution to test MyService. The Tester console app executes MyService successfully.
When I copy MyService.dll to the bin directory of MyWebsite.dll shouldn't MyService.dll be a compilation of itself + the tier class library solutions that it references by default? In other words, shouldn't it be sufficient to just copy over the single MyService.dll without the additional dlls generated by its referenced projects?
For some reason the MyService referenced projects aren't found when I copy over MyService.dll to the MyWebsite bin directory.
|
|
|
|
|
Member 3919049 wrote: shouldn't it be sufficient to just copy over the single MyService.dll without the additional dlls generated by its referenced projects?
No. Think about it. Dropping an assembly into the bin does compile anything.
You need to add a reference to the assembly or project.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Here's some more info - MyWebsite and MyService have the same tier structure of BusinessObjects, DataAccess and DataInterface.
MyService is not finding a BusinessObject reference.
However, I can add that BO reference to MyWebsite and this fixes the MyService error.
However, the BusinessObjects definition in MyService should be isolated from the BusinessObjects definition in MyWebsite.
Am I supposed to accomplish this through strong-naming the contents of MyService?
|
|
|
|
|
Please stop what you are doing and pick up a basic book about developing ASP.NET applications. Most books I've seen cover the basic 3-tier design and how to add references.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks Mark - I've done 8 years n-tier dev in ASP.NET so I'm familiar with adding references.
The problem here is that MyWebsite has a dll reference to MyService and MyWebsite and MyService have the same tier structure.
So when MyService is trying to access it's BusinessObjects project the runtime is actually trying to access to BusinessObjects project of the WebSite.
I went ahead and applied a strong name to all of the projects in MyService and then copied the new MyService.dll to the MyWebsite bin directory.
When MyService runs in MyWebsite the following error is now returned:
Could not load file or assembly 'DataInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=68dd866efa467a61' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
So it looks like MyWebsite runtime now recognizes that MyService is trying to load its own DataInterface project. However, it looks like MyWebsite runtime still tries to load its own DataInterface project but the runtime throws an error b/c it recognizes that the assemblies don't match.
Any suggestions on what I should do now?
|
|
|
|
|
Member 3919049 wrote: I've done 8 years n-tier dev in ASP.NET
Then you shouldn't be asking such stupid questions. These are questions from a newbie.
One tip, but after eight years you should know it, clear the asp.net temp folders.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
My MyService project has references to BusinessObjects, DataInterface and DataAccess projects within its solution.
If I copy over the MyService.dll to MyWebsite it looks like (the way MyService is deployed/configured) I will have to copy over all of the additional dll's for projects referenced in MyService.dll.
For example, if I copy the MyService BusinessObjects.dll to the GAC then MyWebsite finds the dll and uses it.
I'm thinking that there must be a way to include all of the dependent dlls within MyService.dll as opposed to requiring that 4 dlls be copied to MyWebsite in order to use the functionality within MyService.dll.
So how can I get all of the dll dependencies into a single MyService.dll?
|
|
|
|
|
|
Hi Mark - It looks like you earn MVP points no matter what you post (like your last post) cha-ching! automatic MVP point!
I respect your professional goals but if you know how to combine multiple dlls into a single dll and you can share that information then that would really be more inline with this thread. Thanks!
|
|
|
|
|
|
It looks like ILMerge does exactly what I need it to do.
Examples were kinda hard to find so I'm including one below. This command will take your MyMain.dll and package it with all of the child dlls into a new dll named MyMain.dll so it's transparent to the consumer of your dll:
ilmerge /out:MyMain.dll ./dlls/MyMain.dll ./dlls/BusinessObjects.dll ./dlls/DataAccess.dll ./dlls/DataInterface.dll
Nice tool!
|
|
|
|
|
I am trying to run this for auto complete.
Everything is working fine, but getting error
Return From m In country Where m.ToString.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) Select m Take (count).ToString.ToCharArray
Public Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As String()
Dim country As String = ("India", "UK", "Indonesia", "Japan", "Sri Lanka", "Singapore")
' Return matching movies
Return From m In country Where m.ToString.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) Select m Take (count).ToString.ToCharArray
End Function
Please suggest what needs to be corrected.
|
|
|
|
|
Do you think telling us what error you are getting might be helpful?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30198: ')' expected.
Source Error:
Line 76:
Line 77: Public Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As String()
Line 78: Dim country As String = ("India", "UK", "Indonesia", "Japan", "Sri Lanka", "Singapore")
Line 79: ' Return matching movies
Line 80: Return From m In country Where m.ToString.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) Select m Take (count).ToString.ToCharArray
Source File: C:\Documents and Settings\balwinder_singh\My Documents\Visual Studio 2008\WebSites\correction\Default.aspx.vb Line: 78
This is the error I am getting .
|
|
|
|
|
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30198: ')' expected.
Source Error:
Line 76:
Line 77: Public Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As String()
Line 78: Dim country As String = ("India", "UK", "Indonesia", "Japan", "Sri Lanka", "Singapore")
Line 79: ' Return matching country
Line 80: Return From m In country Where m.ToString.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) Select m Take (count).ToString.ToCharArray
Source File: C:\Documents and Settings\balwinder_singh\My Documents\Visual Studio 2008\WebSites\correction\Default.aspx.vb Line: 78
Made some changes still no clue about error.
|
|
|
|
|
Maybe this?
Dim country() As String = ("India", "UK", "Indonesia", "Japan", "Sri Lanka", "Singapore")
|
|
|
|
|
I have tried this also still the same.
I have added the script manager and the autocomplete to the textbox.
The command is actually to auto suggest when the enduser types alphabet.
Say in case he types ind the webpage should suggest India Indonesia.
I think there is some problem with the command used below but couldnt figure out what needs to be changed.
Dim country As String = ("India", "UK", "Indonesia", "Japan", "Sri Lanka", "Singapore")
' Return matching country
Return From m In country Where m.ToString.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) Select m Take (count).ToString.ToCharArray
|
|
|
|
|
Didn't see it in the copy/paste, but your country array also is using parenthesis instead of curly-braces...
Dim country() As String = {"India", "UK", "Indonesia", "Japan", "Sri Lanka", "Singapore"}
|
|
|
|
|
Perhaps you were wanting something like this?
Module Module1
Sub Main()
Console.WriteLine(getCountry("In"))
Console.Read()
End Sub
Function getCountry(ByVal prefixText As String)
Dim country() As String = {"India", "UK", "Indonesia", "Japan", "Sri Lanka", "Singapore"}
' Return matching country
Return (From m In country Where m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) Select m).First()
End Function
End Module
|
|
|
|
|
Try using the auto complete with a web Method! adding <webmethod()> up of
the function
<WebMethod()>
Public Function blabla(ByVal prefixText As String, ByVal count As Integer) As List<String>
Dim country As String = ("India", "UK", "Indonesia", "Japan", "Sri Lanka", "Singapore")
Dim Qry = (From m In country Where m.ToString.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) Select m).Take(count)
Return Qry.ToList
End Function
I don't remember 100% Vb but it may work good luck
and don't forget the
ServiceMethod="blabla"
ServicePath="MyPage.aspx"
in the Extender
|
|
|
|
|
I created a asp.net website .
I then added a masterpage to it and then a webform to which I added the masterpage file.
It Builds Fine but has following runtime error:
"Content controls have to be top-level controls in a content page or a nested master page that references a master page."
I didn't add anything to the masterpage or content page !!
|
|
|
|
|
Based on your last couple of posts you need to stop what you are doing and read more about masterpages and how to use them
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
Where can I get information on nested masterpages ?
Has anyone tried implementing them and what are it's pros cons?
|
|
|
|
|