so that visual studio will be able to search for function inside it and developpers able to look directly at the source code (without being able to edit it of course).
If I aware of you correct, you want to access the code in the nuget package but could not edit? If yes, you can try to create symbol packages which allow consumers to step into your package code in the Visual Studio debugger.
The way we do it (and works):
Create "*.symbols.nupkg".
Deploy symbol package to SymbolSource server.
Configure IDE, Package consumers can add https://nuget.smbsrc.net/ to your symbol sources in Visual Studio.
Add required Library to project using NuGet (from our SymbolSource server).
Debug.
For the detail info, you can refer to Creating symbol packages.
If these packages are not suitable for publishing on NuGet Gallery/SymbolSource, you can put the *.nupkg and *.symbols.nupkg files on a NuGet local feed on a network share. For the detail for this method, you can refer to the similar issue:
Is it possible to host both regular and symbols packages in a NuGet local feed on a network share?
Besides, in this condition, you do not have to worry about developers going to edit the source code, because all packages are downloaded to local packages folder, edit would not affect the source code on network share until you re-publish it.
Update Detail:
You should add a breakpoint and press F11 to step into the source code:

Update check the source code in dll by F12:
According to the MSDN documentation:
The debugger looks for source files in the following locations:
>1. Files that are open in the IDE of the Visual Studio instance that launched the debugger.
>2. Files in the solution that is open in the VS instance.
>3. Directories that are specified in the "Common Properties" / "Debug Source Files" page in the properties of the solution.
>4. The source information of the .pdb of the module. This can be the location of the source file when the module was built, or it can be a command to a source server.
So if you want to access the source code in dll file by F12 directly, you should add the source code in the solution. You can create a new project in the solution to house the source files and add this project as reference project. This will clutter up your solution/project, but since it will be checked into source control, all team members will automatically be able to debug into the source files.
Besides, ReSharper should be recommended, you can enable it by going to ReSharper / Options / External Sources, and move up "Sources from symbol files". Then in the tab "Sources from symbol files", click "Advanced" and there you can map source folders.