-
Notifications
You must be signed in to change notification settings - Fork 32
MSBuild Fails Build #55
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
Comments
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "StackifyLib, Version=2.0.2.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.5.2". To resolve this problem, either remove the reference "StackifyLib, Version=2.0.2.0, Culture=neutral, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". I cant upgrade my project framework, please update a nuget package that targets .net framework 4.5.2 |
Is this output from a build server? If so, what .NET Developer packs are installed? |
No, it's an output from a custom msbuild command line (made by our team) |
I think is something related to nuget nuspec file. I've copy the dll from net450 and added to project. msbuild works when referenced manually |
Are you referencing any PCL or NetStandard libraries? I've had no issues with 4.5, 4.5.1, 4.5.2, or 4.6... |
If you'd be willing to share your csproj file that fails to build it would make this much easier... |
I'm running VS15 with ASP.NET MVC 5 and installed stackifylib from nuget . My web app is targeting .net framework 4.5.2, it's builds and deploys ok from VS15 but when i try to deploy using msbuild it fails - it's the same csproj file |
Are you building from VS15 and msbuild from the same machine? I'm guessing not. |
Its a server machine, we have installed VS15 on the server and it fails. |
packages.config Currently referencing the stackifylib without nuget msbuild runs ok.
But when i was referencing from nuget it was failing
note that csproj specify net451 the msbuild error is CS0103 like if i have not referenced the dll but it does compile in VS (dev machine and server machine) |
I have done a little sample https://we.tl/SJWdnXRDxM |
Appreciate the repro example, thanks! First thing I did was attempt msbuild (no command-line options) on the project and I indeed ran into build errors. While looking over the project I noticed some unresolved references (Note: I'm using VS2015 to open it). I was unable to build even in VS. I removed StackifyLib nuget and then re-installed it, which restored the references. After I jumped back to msbuild which also completed successfully. The only physical change to the project was the addition of "DependsOnNETStandard true" to the csproj. I had to add this manually. Please try this, note you will have to remove and re-add StackifyLib nuget...
See this thread for specifics... I believe this is an issue due to our dependency on Microsoft.Extensions.Configuration to support DotNetCore apps run on full framework. We do have some work queued around the root issue in the future, but I don't have a timeframe to provide. |
Using the example in the link i was able to open the solution and builds ok inside "VS 2015 Update 3" I did the change you mentioned in csproj, removed and installed again the StackifyLib and msbuild still failing for me.
heres the full log from msbuild it shows for me
|
Please remove StackifyLib and try a pre-2.0 version... |
msbuild works with the 1.25.4 version but i still have a lot of warnings |
solution/project targeting .net framework 4.5.2
msbuild .net framework 4.6
stackifylib 2.0.2 from nuget
msbuild is failing to build: error CS0103: The name 'StackifyLib' does not exist in the current context
command line parameters:
SET MSBUILD="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
SET MSBUILD_CONFIG=/p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=local /t:Rebuild
SET MSBUILD_DOTNET_VERSION=/p:FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6"
SET MSBUILD_VS_VERSION=/p:VisualStudioVersion=14.0 /p:GenerateBuildInfoConfigFile=false
%MSBUILD% %PATH_BUILD%<projectname>.csproj %MSBUILD_CONFIG% %MSBUILD_VS_VERSION% %MSBUILD_DOTNET_VERSION%
The text was updated successfully, but these errors were encountered: