-
Notifications
You must be signed in to change notification settings - Fork 2.1k
You may need to supply runtime policy #5050
Comments
Could you list your project.json? |
Sure, here it is:
|
BTW one of the Warnings is on the following code line inside a Controller Action:
|
Tried out a sample app with your project file and I couldn't see the warning. Perhaps try cleaning your packages dir (http://docs.nuget.org/consume/command-line-reference#locals-command |
@pranavkm Yes, that solved it. Thanks. |
I manually installed "System.Runtime": "4.1.0" . It worked. |
I am having this issue too, but
Installing |
@phrohdoh, what does your project.json look like? |
Ah I see now that this is about a .NET Core project, mine is not built on Core. <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{93B25D37-7F05-4BDA-8683-00D834A6F825}</ProjectGuid>
<ProjectTypeGuids>{349C5851-65DF-11DA-9384-00065B846F21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>NemerleWebAPI</RootNamespace>
<AssemblyName>NemerleWebAPI</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Services" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Net.Http" />
<Reference Include="LibSlyBroadcast">
<HintPath>..\packages\LibSlyBroadcast.2.0.4.1\lib\net451\LibSlyBroadcast.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NodaTime">
<HintPath>..\packages\NodaTime.1.3.2\lib\net35-Client\NodaTime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="Web.config" />
<Content Include="Global.asax" />
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Controllers\UtcToTimeZoneController.cs" />
<Compile Include="WebApiGlobals.cs" />
<Compile Include="SlyUtils.cs" />
<Compile Include="ConfigSettings.cs" />
<Compile Include="Infrastructure\TextPlainFormatter.cs" />
<Compile Include="Controllers\InterceptController.cs" />
<Compile Include="Controllers\CampaignController.cs" />
<Compile Include="Infrastructure\JsonUtils.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Controllers\" />
<Folder Include="Infrastructure\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties>
<XspParameters Port="8080" Address="127.0.0.1" SslMode="None" SslProtocol="Default" KeyType="None" CertFile="" KeyFile="" PasswordOptions="None" Password="" Verbose="True" />
</Properties>
</MonoDevelop>
</ProjectExtensions>
</Project> |
Before you do anything drastic or laborious, try closing and reopening VS. That solved it for me. |
@phrohdoh I'm not entirely sure what might cause your issue. @DamianEdwards where would this issue go? |
I'd log it in https://github.com/NuGet/Home/issues I think |
Usually I am able to solve this by deleting the DLL files, restart VS and rebuild the Application. But this keeps happening and is really annoying. Any ETA for a solution to this issue? |
@pranavkm Came across the same problem and your solution worked for me as well. Thanks. |
I got the same warning after adding EF to asp.net core.
|
@guybartal I tried your project locally and that don't see this issue. Are you able to consistently repro it after clearing your NuGet caches? See #5050 (comment) for details on how to go about it. Bit of a tangent, I'd also recommend not mixing long term support packages ("Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.0.0, |
Are there any updates to the new netcoreapp1.1 projects using .csproj files? I have been working with them, and am aware they are alpha, but wanted to see if a solution existed? I have tried the restore and tried dotnet restore after clearing the entire nuget cache, but no luck |
@nteague22 what about them? |
In VS Code, I get the same issue of a constant warning to supply runtime policy, that it mismatches the versions. It may be from using SDK 3 with VS Code, and I was checking to see if the csproj format would get attention outside of VS2017 |
What are the repro steps? |
@davidfowl I am using Visual Studio Code with ASP.NET 1.1 and I keep getting the same problem even after cleaning local package cache. Here is my present csproj file:
I added the code line to somehow try to solve the problem:
But does not seem to help ... This problem has been happening in VS 2015, VS 2017 and Visual Studio Code with project.json or .csproj file. Cleaning the cache or deleting the content of BIN folder sometimes solves it for a while but I get it again very soon ... Not sure what triggers it ... |
It looks similar to dotnet/vscode-csharp#967 ? |
But I'm looking for a repro and based on what you wrote, you're using VS2017 RC right? If you have a separate project.json repro, can you provide that as well? You shouldn't need the System.Runtime package reference, it's redundant. |
@davidfowl In this case I am using Visual Studio Code not VS 2017. And I am using the .csproj not the project.json. I am also using the following version of dotnet tools:
Addind the System.Runtime reference was just an attempt to solve it. |
@itn3000 Is right, I wondered if it was Omnisharp or a tooling mismatch from SDK 3. I had been using the csproj just like the others |
@Monte-Christo, closing and reopening the VS worked for me. |
just need to restart VS |
1- Delete the content of \bin\Debug |
@agokrim, worked for me thanks! |
For anyone using VS 2017, in my .NET Core .csproj file, I had an empty
Builds successfully after removing that |
As @BenjiZombie pointed out, when specifying custom Actually, when you remove |
So are we saying the default for VS is to turn off these warnings on all projects? If so, isn't that a sign of a problem? Why do these warnings occur? Is there an explanation somewhere as to the meaning of these warnings (in the context of these projects)? I've looked at the doc for these warnings, but that doesn't tell me what sort of gremlins I can expect from ignoring them indefinitely. |
On an ASP.NET Core 1.0 RTM project I keep getting the following Warning:
Any idea what might be wrong? Do you need more information?
The text was updated successfully, but these errors were encountered: