|
Hi Keith,
I got the config setup from an example I found online, that seems to work. All my interfaces are implemented. Everything is in the same dll FrankensteinFramework.dll. Inside it I have a namespace for Laboratory called Frankenstein.Laboratory.Interfaces. Inside there I have a method called IAddNewLabTest.
The concrete implementation is done in Frankenstein.LAboratory.DTO namespace, in the method AddNewLabTest, which implements the interface. I'm still getting the same error. I've tried a number of things and can't seem to get this working.
Thanks,
Bill
|
|
|
|
|
Bill Warner wrote: Everything is in the same dll FrankensteinFramework.dll.
Try:
<register type="Frankenstein.Laboratory.Interfaces.ILabTest, FrankensteinFramework" mapTo="Frankenstein.Laboratory.DTO.LabTest.AddNewLabTest, FrankensteinFramework" name="FrankensteinFramework"/>
Note that name defines the name of the mapping not the assembly, it is possible to resolve more than one type to more than one interface, name is used to disambiguate.
Hopefully the above should work, I think it is right given your description of the file/class structure. Setting these things up for the first time are always a PITA.
|
|
|
|
|
Amen to PITA my brother. I made the changes and still getting the same error:
{"The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)":null}. I'm assuming that the issue is in the config. Maybe I'm missing something else. My code errors on :
IUnityContainer container = new UnityContainer();
var section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");
section.Configure(container);
var transform = container.Resolve<ILabTest>("AddNewLabTest");
I did see that the MApToName, TypeName and Name were all populated correctly in the Registrations section of my Unity configuration section object. Am I barking up the wrong tree?
|
|
|
|
|
Bill Warner wrote: Am I barking up the wrong tree?
Nope. The line you quote is where the the type information is loaded which is consistent with what you've said in terms of errors. Something is probably wrong with the type definitions , without having access to the project it is hard to tell what though.
One thing that is a common gotcha is that you need to reference all dependant assemblies as well, let's say FrankensteinFramework references Log4Net.dll, then you'd have to reference Log4Net.dll plus all its dependancy tree too. Not doing this won't cause a compile time error (one of the drawbacks of DI) so it'll build even though you don't have the references you need.
The final thing (OT, this isn't your current problem) is that, given:
<register type="Frankenstein.Laboratory.Interfaces.ILabTest, FrankensteinFramework" mapTo="Frankenstein.Laboratory.DTO.LabTest.AddNewLabTest, FrankensteinFramework" name="MappingName"/>
you need:
var transform = container.Resolve<ILabTest>("AddNewLabTestMappingName");
You'll hit this if (hopefully when) you get any further. It also illustrates what the name is for.
[Edit]
Corrected some of the very poor English wot I wrote.
|
|
|
|
|
Well I got it working. It's Miller time. This did the trick:
Thanks a ton for your your help!
There's a neat project that demos this at:
http://www.codeplex.com/Download?ProjectName=unity&DownloadId=40036[^]
<unity>
<typeAliases>
<typeAlias alias="LabTestInterface" type="Frankenstein.Laboratory.Interfaces.ILabTest, FrankensteinFramework"/>
</typeAliases>
<containers>
<container>
<types>
<type type="LabTestInterface" mapTo="Frankenstein.Laboratory.DTO.LabTest, FrankensteinFramework" name="FrankensteinFramework"/>
</types>
</container>
</containers>
</unity>
|
|
|
|
|
|
Could you please give me a link or a pdf for C# windows application form making over visual studio 10
thanks
$@$ Code ur Code @$@
|
|
|
|
|
|
|
Thankx
|
|
|
|
|
Hi,
I am trying to upload a file from my laptop to remote development server. It keeps coming back with either 404 error or 405 error. I am able to download a file with no issues at at all.
all I have is a form with a button on it, and clicking on button invokes the below.
I get the message, "Upload Complete" but the file does not exist on the remote server.
private void button3_Click(object sender, EventArgs e)
{
WebClient wcUpload = new WebClient();
NetworkCredential myNwc = new NetworkCredential("username", "password");
wcUpload.Credentials = myNwc;
wcUpload.UploadFile("http://<dev server>:85", "POST", "C:\\projects\\ProgressBar\\file_0122.csv");
MessageBox.Show("Upload complete!!");
}
|
|
|
|
|
What page are you uploading to? Default.aspx?
Is it a 404 or a 405? One would mean your page doesn't exist, the other would mean your "POST"-ing something that expects a "GET" (or the other way 'round, I keep forgetting)
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you for your reply.
I am just trying to upload a simple .csv file from my project.
|
|
|
|
|
vanikanc wrote: I am just trying to upload a simple .csv file from my project.
So I noticed. Again, to which asp-page (the one with the upload-control)? Default.aspx?
And, is it a 404 or a 405-error? They're kinda different, so you'd better check.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
The "Upload complete" doesn't mean a thing it'll only not show if something throws an error beforehand. UploadFile only thows in the following circumstances:
- The Address or Filename being null
- The URI formed by combining BaseAddress, and address is invalid.
- fileName is null, is Empty, contains invalid characters, or does not exist.
- An error occurred while uploading the file.
- There was no response from the server hosting the resource.
- The Content-type header begins with multipart.
None of which apply to your code. You might get better explanation of what is happing by reading the returned byte array:
byte[] responseArray = myWebClient.UploadFile(....);
string response = System.Text.Encoding.ASCII.GetString(responseArray)
In any case, it looks like the server won't allow posts to the root which is why you are getting the 405. It might also be worth checking something is listening on port 85, and it isn't being blocked by a firewall.
|
|
|
|
|
Hi, I would like to capture the browser url , selected with a mouse click
|
|
|
|
|
Since there is no single method to do this acrossed all browsers, you're going to have a rather difficult time doing this.
|
|
|
|
|
Hi everyone
I am a novice on C# and please tell /redirect me how can I use menu strip control to make a tab control. The tab control provided in C sharp has very limited capabilities in terms of customisation and its text cannot be aligned vertically when its tab strip is vertically aligned.
|
|
|
|
|
|
Jagatpreet wrote: The tab control provided in C sharp has very limited capabilities in terms of customisation
That's because it's part of a programming-language. If you want something fancy, you build it. It's not lego's
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Well I've passed the course Introduction To Programming in the last semester, now i am enrolled in the course Object Oriented Programming.
Actually i want to learn C# (also java)
What You Say About C# And Programming in C# .. ??
Last year a competition on programming is organized by my university where the students from different universities participated, but at that point when the groups are busy to solve the problems i note that those who program in C# is a little bit better in all aspects then C++ coders.
In My University computer sciences students just hands on C++ . . .
I keenly Awaiting Your Suggestions Also Please Recommend Some Self Studying Books On C#..
|
|
|
|
|
You have already asked this in QA please do not cross post.
|
|
|
|
|
Learn C# from a book and then practice as much as possible.
Difficult to advise a book since one cannot know the books in your region.
|
|
|
|
|
insane coder wrote: but at that point when the groups are busy to solve the problems i note that those who program in C# is a little bit better in all aspects then C++ coders.
Given what you posted I question your ability to accurately judge that.
You might also keep in mind that the problems that the students were asked to solve might have been more suited to solutions in C#.
insane coder wrote: Actually i want to learn C# (also java)
As much as possible pick one language and stick with that for a while. You don't need to become an expert but it is better to have a better understanding of programming in general before attempting to tackle multiple languages.
|
|
|
|
|
You shouldn't attempt to learn Object Oriented Programming until you've tried at least five non-OOP languages.
|
|
|
|