-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 reference assemblies for .NET 3.5 or lower using core msbuild #1333
Comments
I think the problem is that there aren't any reference assemblies for .NET Framework 3.5. The only thing in my |
This comes down to code in There are some (probably avoidable) registry calls there, but the biggest obstacle seems to be that finding the v3.5 (or whatever) runtime depends on locating the current runtime ( There may be another way to locate a framework (looks like |
What's the work-around for people who need to build such projects on VS 2017? I just ran into this today, and the only thing I could figure out was to compile on a separate machine with only VS 2015 installed. |
@KevinH-MS It sounds like you're seeing something different from this issue--as originally reported, projects build fine using |
I see. I think that's the answer to my question... 😄 (don't use |
Issues a pain when you're trying to generate a multi-target nuget package; Admittedly I'm
etc https://github.com/BcryptNet/bcrypt.net/blob/master/src/BCrypt.Net/BCrypt.Net.csproj Hell, it might be that after all these changes and dotnet versions I need to set fire to my PC and start afresh to get things to build 🔥 |
Right now the only options I see are:
I guess legacy support is a lower priority than other things for now. Ideally (IMO) there would be targeting packs on NuGet for each framework version, making it easier to target .NET Framework from the dotnet SDK. |
Our use case at work: targeting net20 is important for us as we have to make some of our libraries work on old Windows Server 2003 systems. We can't upgrade them right now. And we don't want to install anything (say, newer .NET framework versions) to avoid risks of breaking the systems. We love dotnet tooling, but while this issue is not fixed, we'll have to stay on the full msbuild for this use case. |
Any updates on this issue? |
@schotime I've been using RTW since it came out last week and this seems to be resolved. |
@ChrisMcKee In core MSBuild or full MSBuild? |
It works in vs for me, but not calling dotnet build manually. |
@Thealexbarney Windows, so full. I'm not sure you could target .net 2 on non-win platforms as it would lack the required build targets. 2/3.5/4/4.5/4.6 predating it all. You're back in mono-land there. |
Also seeing this. Can build in VS2017, but
|
@drewnoakes use msbuild |
…on of the dotnet CLI tooling contains a bug causing the build of this target to fail, breaking CI builds. See dotnet/msbuild#1333 for more information.
I'm getting the error with .NET 2.0. I'm trying to do |
@JoshClose you can directly call
For version suffixes, add |
How can I change the package output location? Sorry, I'm no too familiar with msbuild. |
|
I got this working by adding the following to the <PropertyGroup>
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
</PropertyGroup> Unfortunately, the "normal" path UpdateThis can now be addressed using the Microsoft.NETFramework.ReferenceAssemblies NuGet package. Click through to the "Project Website" for documentation. |
@bradwilson Did you ever find a resolution for this? I'm in the same boat. |
@JohnHBrock No. There is no solution. |
@bradwilson This seems to work OK, but I haven't had time to thoroughly test it: <ItemGroup>
<Reference Condition=" '$(TargetFramework)' == 'net35' " Include="System.Web" HintPath="$(WINDIR)\Microsoft.NET\Framework64\v2.0.50727\System.Web.dll" />
</ItemGroup> This includes System.Web.dll as a dependency in the overall project by pulling it from the .NET 2.0 directory, and, combined with the @NightOwl888 workaround, seems to make EDIT: A possible problem I've found with this approach: There are two versions of System.Web.dll under |
@JohHBrock have you tried to copy files and directories from 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5*' to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v3.5'? |
…et/msbuild#1333) - therefore removed net35 target (to be discussed if ok)
The plan to address this is to use an updated Since this can be done without MSBuild changes, I'm going to close this. |
The new .NET CLI (`dotnet`) cannot build projects that target `net35`, because it cannot locate the required reference assemblies. Since we're planning to drop support for .NET Framework 3.5 anyway, it is not worth finding a workaround for this problem--let's just remove that target framework now. References: * dotnet/msbuild#1333
The new .NET CLI (`dotnet`) cannot build projects that target `net35`, because it cannot locate the required reference assemblies. Since we're planning to drop support for .NET Framework 3.5 anyway, it is not worth finding a workaround for this problem--let's just remove that target framework now. References: * dotnet/msbuild#1333
dotnet/sdk supports targeting .NET 3.5 just fine if you use desktop msbuild, but it fails to find the reference assemblies using core msbuild. Both desktop and core work fine for NET4.0+.
Steps to reproduce
Create a new project with
dotnet new
Change the
TargetFramework
tonet35
or lowerAdd
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
to the .csprojdotnet restore
dotnet build
I've been seeing this issue since the move to msbuild. Targeting .NET 3.5 and lower works in the Preview 2 release SDK. All the relevant targeting packs are installed.
Expected behavior
A successful build
Actual behavior
Fails with the error:
... error MSB3644: The reference assemblies for framework ".NETFramework,Version=v3.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. ...
Environment data
dotnet --info
output:.NET Command Line Tools (1.0.0-preview3-004056)
Product Information:
Version: 1.0.0-preview3-004056
Commit SHA-1 hash: ccc4968
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Moved from https://github.com/dotnet/cli/issues/4626 for @Thealexbarney.
Moved from dotnet/sdk#369 for @piotrpMSFT
@rainersigwald
The text was updated successfully, but these errors were encountered: