Please I have a problem. sorry if question title are not recognized well, I can't upload full-image during my reputations.
Edit: I need something like that maybe
https://github.com/RicoSuter/NuGetReferenceSwitcher
or
https://github.com/0UserName/NuGetSwitcher
but above repos are not updated to VS 2022? please any help?
Edit: Looks like other people asks about that issue: https://github.com/dotnet/sdk/issues/1151
Shortly, I need to make a Class Library project can modify/edit in my side only. Other people only use DLL reference or Nuget package.
What I need to do?
- I need to create a main project that used across me as public source and other people as DLL only not debuggable.
- In my side the class library project must seen if I choose MSBuild configuration (Debug mode) not Nuget DLL. but I need to modify whole core source. Then republish it again as Nuget to allow other people to use it privately.
- I guess the whole gape in main project .csproj file. I need to modify it to allow Configuration to switch between Nuget build that visible to other developers and Debug that only visible at me. When choose it the
<ProjectReference>
should load and should become visible at my solution. - You can ignore Github things I mentioned. A repo can be private/public wihtout problem.
Problem Short Description:
- I have main project in solution A. (Must be GIT public for other people)
- I have class library in solution B (Which maybe used in 2 main projects) (Must be GIT private repo for me only)
- I need the class library source only visible for me not other people. they just see Package or DLL.
- The main project are public Git repo, while class library are private Git repo.
- In my case I need to setup a 2 types of MSBuild configuration. (Debug/) and (Nuget/ )
- the other people only allowed to use which are private nuget package and they must not debug the class library.
- I need only me to use (
Debug/<ProjectReference>
) -> So I can change class library directly and build Nuget package for other people without PDB file,etc included.
What I try to do? What topics I read?
- I Following topics I follow: Use local source code of NuGet package to debug and edit code (@Mr Qian comment)
I create two solutions. First (FooProject Executable), Second(FooClassLibrary)
I modify the FooProject.csproj and add following lines
<ItemGroup Condition="'$(Configuration)' == 'Debug'"> <ProjectReference Include="..\..\FooClassLibrary\FooClassLibrary\FooClassLibrary.csproj"> <Project>{a2329af5-316e-4339-8b56-d78aba72e919}</Project> <Name>FooClassLibrary</Name> </ProjectReference> </ItemGroup> <ItemGroup Condition="'$(Configuration)' == 'Release'"> <Reference Include="FooClassLibrary"> <HintPath>..\..\FooClassLibrary\FooClassLibrary\bin\Release\FooClassLibrary.dll> </HintPath> </Reference> </ItemGroup>
Edit:
I fix issues in above .csproj code. Now class library referenced with two MSBuild configuration (Debug and Release). But I don't add Class Libray in FooProject solution in Debug MSBuild.
Should now I create two solutions *.sln files? one for FooProject and reference with FooClassLibrary as DLL for non-modifying debugging? And second FooProject solution (FooClassDebuggingAndEdit.sln) that reference project to FooProject?
Here's a two solutions *.rar link https://anonfiles.com/rdm8A4I2x9/TwoSolutions_rar
I don't know why a solution should also reference the ClassLibrary project or it can't modified when do <ReferenceProject>
in FooProject. I got following error message when debug:
Do I need change something?