-4

I have two C# Applications

  1. TestApp is a console app which call a method decrypt included in AppCrypt
  2. AppCrypt contains this method and needs to log (write on a file)

So far I can modify TestApp and I saw the result on my console but my goal is to edit the code of AppCrypt

I am using VS for both.

Question 1) I cannot find where is written the place where I link the DLL of AppCrypt

Question 2) I can build AppCrypt but I cannot generate a new DLL because I am getting this message

enter image description here

I found on SO that I should add a project Console App or a Winform but I just need to use that function without having a proper app so I dont know if it is my case.

I have built the DLL but it does not seems to be linked in my console app which is TestApp, how can I verify that it is linked?

eeadev
  • 3,662
  • 8
  • 47
  • 100
  • 2
    You can _build_ a DLL, you just can't _run_ it directly. You need some other project type (test, console, win, web, etc.) that _uses_ the library. – D Stanley Sep 12 '17 at 12:45
  • 1
    `I just need to use that function without having a proper app` Thats not how DLL works. – Luke Sep 12 '17 at 12:45
  • A Console application at least has a `Main()`. Running a DLL doesn't make much sense unless you know exactly what to run inside the DLL. I mean, there are a number of classes and methods into your DLL and Visual Studio doesn't know what you want to do with that. – derloopkat Sep 12 '17 at 12:49
  • 1
    "*I cannot find where is written the place where I link the DLL of AppCrypt*" In Visual Studio `Solution Explorer` (at your right) expand References node. These are saved into your project file. – derloopkat Sep 12 '17 at 12:52
  • @derloopkat, thank you there is a triangle in there how can I link my dll, I am very new to it – eeadev Sep 12 '17 at 12:54
  • @eeadev, you can make quick progress by going on line and watching Youtube videos about Visual Studio and basic Console and Class Library projects. – derloopkat Sep 12 '17 at 12:56

1 Answers1

2

You are getting that error cause most probably you have set your class library project as Startup project in your solution. Whereas you should set the Console app as your start up.

How to Set a project as StartUp: Right click on your project name and from context menu select Set As Startup Project

Rahul
  • 76,197
  • 13
  • 71
  • 125