Solving error “Microsoft.NETCore.App 1.0.0 does not support framework .NETFramework,Version=v4.6.1”

前端 未结 2 1127
青春惊慌失措
青春惊慌失措 2021-01-02 00:08

I have an ASP.NET Core 1.0 complete application running using net461 references. Now I am trying to add another framework - netcoreapp1.0. For this

2条回答
  •  误落风尘
    2021-01-02 00:32

    I referenced .net core class library in .net 4.6.1 by changing the following.

    Before I was getting this error when trying to reference the .net core from .net 4.6.1

    Fix:

    Original

        {
        "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0",
          "type": "platform"
        },
        "Interop.SHDocVw.dll": "1.1.0",
        "Microsoft.mshtml.dll": "7.0.3300.1"
        },
    
        "frameworks": {
        //"net461": {},
        "netcoreapp1.0": {
          "imports": [
            "dotnet5.6",
            "portable-net45+win8",
            "net461"
          ]
        }
       },
    
        "scripts": {
        "prepublish": [ "bower install", "dotnet bundle" ]
        }
       }
    

    Corrected

        {
         "dependencies": {
            "Interop.SHDocVw.dll": "1.1.0",
            "Microsoft.mshtml.dll": "7.0.3300.1"
         },
    
        "frameworks": {
            "net461": {
            },
            "netcoreapp1.0": {
            "dependencies": {
                "Microsoft.NETCore.App": {
                "type": "platform",
                "version": "1.0.0"
                }
            },
            "imports": [
                "dotnet5.6",
                "portable-net45+win8",
                "net461"
            ]
            }
        },
    
        "scripts": {
            "prepublish": [ "bower install", "dotnet bundle" ]
        }
    }
    

提交回复
热议问题