Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find compilation library location for package (From legacy website project) #508

Open
fedegarciarod opened this issue Nov 14, 2022 · 2 comments

Comments

@fedegarciarod
Copy link

Describe the bug
I'm getting the following error: "Cannot find compilation library location for package". I know that in the FAQ section there is a solution to that adding a few properties into the csproj file. The problem is that my web project doesn't have this file to configure, I have the razorlight dependency added in another project that is being called by the web one. I did add the configurations to csproj on this project.

When I try to render the template form the unit test project we have, the template gets rendered correctly. But when I do it through the service layer I have in my legacy web app, Im getting the error.
The website project is net 4.8 and the project where razorlight is added is 4.8/ net standard 2.0.

Does anyone know a possible solution to my problem? Is it possible to make this scenario work?

To Reproduce
Project A: website project with 4.8 with a handler that references project B.
Project B: DLL project 4.8/2.0 that has razorlight and renders a simple template

Information (please complete the following information):

  • OS: Windows 11
  • Platform .NET Framework 4.8
  • RazorLight version 2.3
  • Are you using the OFFICIAL RazorLight package? yes
  • Visual Studio version: Microsoft Visual Studio Professional 2022 (64-bit) - Current
    Version 17.2.3
@jzabroski
Copy link
Collaborator

jzabroski commented Nov 15, 2022

So your project structure looks like:

Project A [ASP.NET MVC Classic *Website*] TargetFramework=[net48]
|
 \ Project B [Class Library] TargetFrameworks=[net48, netstandard2.0] 
  |
  \ [Package Reference] RazorLight Version=[2.3]

Is Project A using the new Project System csproj file format? If it's not, then I am not sure the flags in the FAQ will do anything. There is a thread somewhere on GitHub where the open source community has figured out how to add various project capabilities to ASP.NET Classic net48 projects so that they can use the new project system csproj file format. For example, you need to convert the Project-level node and also add the following:

  <ItemGroup>
    <ProjectCapability Include="DotNetCoreWeb" />
    <ProjectCapability Include="SupportsSystemWeb" />
    <ProjectCapability Include="LegacyRazorEditor" />
  </ItemGroup>

But you also need to take into consideration how you deploy your website, so you are not home free just yet.

@jzabroski
Copy link
Collaborator

  • Visual Studio version: Microsoft Visual Studio Professional 2022 (64-bit) - Current
    Version 17.2.3

BTW, current verison is 17.4.0. It seems to be way faster than the version you are on. It wont solve this problem for you, though, but it will help with running unit tests, etc. faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants