C
C#

✅ using from another csproj

✅ using from another csproj

VVeQox11/19/2023
Currently i have 2 projects, an api app and a worker service app And both use the same models. Is there a way to put the models in a libary project and the 2 other projects include them? Without me needing to write the models twice per project?
BBuddy11/19/2023
Yes
VVeQox11/19/2023
And how would i do that, been searching online but cant find anything on that topic (mightve searched for the wrong things)
BBuddy11/19/2023
If you use Visual Studio Community then just right-click the solution and just create a new project. Add all the libraries you need and then start implementing the models, then right-click the projects and press add reference then just add it from shared project reference
BBuddy11/19/2023
No description
VVeQox11/19/2023
and if i dont use vsstudio when
ZZacharyPatten11/19/2023
1. use source control if you are not already doing so 2. create a C# library project 3. copy your shared code into the library and remove the duplicates currently in each project 4. add a project reference from your current projects to the new library project if you are not using visual studio, then you can just edit the .csproj files to add project references. just add
<ItemGroup>
<ProjectReference Include="..." />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..." />
</ItemGroup>
where ... is the relative pat to the .csproj of your library project you need to put that inside the <Project>...</Project> node in the .csproj
VVeQox11/19/2023
k this worked pog ❤️

Looking for more? Join the community!

C
C#

✅ using from another csproj

Join Server
Want results from more Discord servers?
Add your server
Recommended Posts
Javascript not working on my MVC projectI'm learning front end tutorials at the moment so I'm totally new to designing websites. _Layout.csis there a way to get the colocation center connected to with C# ?I wanna get information about the colocation center exactly how Cloudflare warp gets it in the prefexaml and x:Class - issue (CS1061)I got a project wich some of you helped me with allready, tho there is still one issue I coudn't resCan't fire click blazor ui button```cs @page "/members" @namespace Blazor.Web @attribute [StreamRendering] <PageTitle>Members</PageTHelp Minecraft Console Client scripting(https://github.com/MCCTeam/Minecraft-Console-Client Link to MCC) is there a way to make a C# scrip✅ Bypass ASP.NET Required authenticatorIm trying to return Forbid (403) to the user if a resource already exists it all works fine but the Issues trying to create new error typesHello everyone. I'm trying to create my own extensible error type, based on the RFC 7807. ```c# puI have a Visual-Studio Proj. in .NET Framework and need help fixing the "CS0120" error it throws up.Basically I want to make an App which you just run and it will automatically, by pressing just one bplease help!!! (winforms c#)Does anyone know how can i make the user move the last drawn shape on a picturebox (the picture box WPF ScrollViewer issuesHello, I have the problem that the scrollviewer in C# (WPF) does not work properly. I haven't define✅ Quick - Unity "using" directiveReally quick question guys, when trying to use methods from other scripts in Unity, let's say the ot✅ .Split() Returning Spaces Between Words in String[]Hi. I have an string array `string[] strArr` of words in format `[word1, word2]` and so on - just a I want to compile a program myself with less filesI was working on a open source project, and I want to compile the program myself so I setup a github✅ Finding Processes but it displays as invisibleSo I am making a system monitor, and I ran into a problem where when I click the button to display t✅ Getting artifact from GitHub Repo ends in SSL_ERROR_SSLHello guys, working on a console app to more or less download artifacts from our private GitHub Repo✅ DB ErrorHey guys, I am working on a project and I am trying to connect it to a DB. I am following the instruCalculate Field Offset Based On Members' NameI'd like to know if the offset calculation is correct. the input used is as follows```cs private coFollowing a video to create power ups, but its not picking them up and I dont know why.Heres the code. I dont know whats wrong with it, from what I can tell its exactly the same as the vConverting int to double to output with decimalsHello again! i got a little problem with converting int to double, i dont get it to output the decimDb ConnectionGood afternoon guys, I need some help setting up the database connection for my project. I have th