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

$(__paket__.... variables in csproj breaks website after convert-from-nuget, or paket update #1536

Closed
mlidbom opened this issue Mar 22, 2016 · 11 comments

Comments

@mlidbom
Copy link

mlidbom commented Mar 22, 2016

After running convert-from-nuget on a solution containing a web project I ended up with these two lines in the web csproj file:

<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\build\$(__paket__Microsoft_CodeDom_Providers_DotNetCompilerPlatform_props).props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\build\$(__paket__Microsoft_CodeDom_Providers_DotNetCompilerPlatform_props).props')" Label="Paket" /> <Import Project="..\packages\Microsoft.Net.Compilers\build\$(__paket__Microsoft_Net_Compilers_props).props" Condition="Exists('..\packages\Microsoft.Net.Compilers\build\$(__paket__Microsoft_Net_Compilers_props).props')" Label="Paket" />

Building "works" with this in place but the Imports are apparently not working, No "roslyn" folder is created in the bin folder, and trying to use the website gives the error:

Could not find a part of the path 'C:\Manpower\Manpower.Applications.Intake\Intake.UI.Web\bin\roslyn\csc.exe'.

Since this is a big powershell automated batch migration of many solutions with many web projects I added a bit of code that got this working again (Just replace the variables with the actual file names):

$projectFileContent = $projectFileContent.Replace('$(__paket__Microsoft_CodeDom_Providers_DotNetCompilerPlatform_props).props','Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props') $projectFileContent = $projectFileContent.Replace('$(__paket__Microsoft_Net_Compilers_props).props','Microsoft.Net.Compilers.props')
I was hoping this was a bug in the migration code, and that I was done, but it seems not.
Whenever I run paket update (Or, I'm guessing, any other paket command that changes csproj files) the lines that break the build are reintroduced.

This is a showstopper for us in our migration to paket :( . I would greatly appreciate getting this addressed since I really really want the advantages that paket will give us.

@forki
Copy link
Member

forki commented Mar 22, 2016

yeah convert-from-nuget uses the normal install process to add these imports. So this is at least consistently wrong ;-)

Will take a look later today

@mlidbom
Copy link
Author

mlidbom commented Mar 22, 2016

Great! Thanks for the quick response :)

@forki
Copy link
Member

forki commented Mar 22, 2016

just tried to reproduce. Can you please send me a broken csproj and corresponding paket.references + paket.dependencies to sforkmann @ gmail ?

@inosik
Copy link
Contributor

inosik commented Mar 22, 2016

Seems that it's related to #1487, but in the latest version this should be actually working.

@forki
Copy link
Member

forki commented Mar 22, 2016

yees it's related, but it seems we still generate something that doesn't work.

@inosik
Copy link
Contributor

inosik commented Mar 22, 2016

Wait a minute, roslyn folder? That thing gets created by the install.ps1 script in the package. So the problem here is, that Paket doesn't execute PowerShell scripts. The .props file gets inserted in the right place, but it tries to copy stuff into a non-existent directory.

@forki
Copy link
Member

forki commented Mar 22, 2016

argh. thanks for clarification. yes we don't execute ps1 scripts (same as newer nuget). Is there another way to create that thing?

@mlidbom
Copy link
Author

mlidbom commented Mar 22, 2016

One correction: The roslyn folder is created when you build. Not when you install the package.

I'll see if I can create a minimal repro.

@inosik
Copy link
Contributor

inosik commented Mar 22, 2016

Seems that Microsoft.CodeDom.Providers.DotNetCompilerPlatform.BinFix fixes it with a .targets file instead of a PowerShell script.

@mlidbom
Copy link
Author

mlidbom commented Mar 22, 2016

Seems that it's related to #1487, but in the latest version this should be actually working.

Darn, my migration script caches paket.exe and it was not the latest version.
I just cleared the cache and the behavior changes.

I'm very sorry to have wasted your time with a bug report when using an old version :(

However, Now I get a build error instead:

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.Core.targets(88,11): error MSB4064: The "Features" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property.

I will investigate this a bit and create a new issue if it turns out to be a Paket problem.
Again, apologies for wasting your time :(

@mlidbom mlidbom closed this as completed Mar 22, 2016
@mlidbom
Copy link
Author

mlidbom commented Mar 22, 2016

It does seem to be a bug in paket causing the build failure.
I added issue: #1537

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

3 participants