I am trying to put my sharepoint code in an external library. Once I reference the dll in my project and when I do a deployment, I get an error saying that Could not load file or assembly. Can anyone tell me what should I do when creating my class library? what references do I have to include?
thank you for your help.
Creating the class library project. Create your class library project: In Solution Explorer, right-click on the ClassLibraryProjects solution file and from the context menu, select Add > New Project.
Create a library in SharePoint or SharePoint Server 2019 1 Go to the team site where you want to create a new document library. 2 On the menu bar, select New, and then select Document library. 3 Enter a name for the new library. 4 Select Create.
On the Configure your new project page, enter ClassLibraryProjects in the Solution name box. Then choose Create. Add a new .NET class library project named "StringLibrary" to the solution. Right-click on the solution in Solution Explorer and select Add > New Project.
Navigate to the web part solution folder, and open the ./package.json file. Add an entry to reflect the library entry and its version to the dependencies section (you can find this in the package.json file of the library solution you're created earlier) as follows:
You should both sign your class library and include it into your package. in order to include a library into a package go to package designer and click Advanced then add your library to the package from there via Add Custom Assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With