Adding reference to ASP.NET Empty Web Site - not showing after adding

daowdos 261 Reputation points
2021-08-01T18:56:21.827+00:00

If anyone can help me with this problem I’ll be grateful -
I want to add to my project - ASP.NET Empty Web Site a reference for other project.
After adding the reference to the App_Code folder nothing is shown inside the Bin folder -

-
119681-adding-ref.png
119530-refrences.png

I hope you can help me!

Thanks

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,248 questions
SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,796 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,219 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Duane Arnold 3,211 Reputation points
    2021-08-01T19:33:33.04+00:00

    The solution should have a reference to the BLL DLL, which should not be set from App_Code. In turn, the BLL has a reference to DAL DLL.

    The only DLL the WebSite project should know about is the BLL.


  2. Cheong00 3,471 Reputation points
    2021-08-02T07:54:22.71+00:00

    There are 2 kind of ASP.NET "Projects".

    "Website" is like the old ASP, they don't need a project file, and the code is only compiled to DLLs on the fly when put to run under IIS. To reference other DLLs you just need to add relevant Reference with "assemblies" section in web.config if they are strong named, copy them to BIN folder if they're not.

    "Web Application", on the other hand, is those project that requires you to have a project file to use, and then will compile the "server side" part to DLLs before deployment. This is the kind of project that use the way to described to add reference.

    ======
    That said, in "Website" project, when you use the IDE to add reference to a strong named DLL, you should be able to see the "assemblies" section be added for you. And for output of your other projects, they should be copied to BIN folder when you deploy the project as well.


  3. Cheong00 3,471 Reputation points
    2021-08-03T09:48:01.417+00:00

    I downloaded your project and see your WebApplication have successfully added reference to BLL and DAL, and then BLL have reference to DAL.

    There's no problem at all and I can compile it successsfully.

    Except your DLL have unrecognized escape sequence that prevents it from being compiled. You should use "\" instead of single "\" in C# strings
    Also there is 2 methods calls to DAL need to be renamed as DAL.DAL.

    The same goes to your Website calls, it should be BLL.BLL.<method_name>()


  4. daowdos 261 Reputation points
    2021-08-05T09:41:45.427+00:00

    @AgaveJoe Hi and thanks again, 'm checking the project from your repo.

    1. I see in the List<Product> GetProductList() you didn't do try catch for error, why didn't you ?

    2) In my project BLL -
    it has to be **(float)**(decimal)ds.Tables[0].Rows[i]["Price"] Other wise it can't compile, why is it not taking decimal value by itself ?

    3) I don't understand why you made this - private static string connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString();

    Instead of this in my code - private static string connetionString = @"Data Source=ELADO\SQLEXPRESS;Initial Catalog=SupplementsStore;Integrated Security=True";

    Severity Code Description Project File Line Suppression State
    Error The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located. C:\Users\Elad Hatan\Desktop\ShopWebSite1-master\WebSite1\Web.config 16

    If I comment the line above there is a Message when running the project - "

    Web server.Port 63579 is in use.


  5. Angelo Alzona 1 Reputation point
    2022-07-08T05:25:24.303+00:00

    Check the list of Reference.

    like here.
    218833-image.png

    then, delete and add it again to the reference.

    218793-image.png

    That's all :)

    0 comments No comments