dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.71k stars 1.06k forks source link

Assembly not found: Microsoft.CSharp #6319

Closed guardrex closed 4 years ago

guardrex commented 8 years ago

Steps to reproduce

My portable test app won't run this evening. I'm getting a missing assembly exception.

If you need a repro, let me know, but this app is akin to the cli-samples MVC app.

I noted that the build was failing for dotnet cli, but that shouldn't matter, correct? I mean the Download link is going to link last good build of dotnet cli, right? [EDIT] I rolled back my dotnet cli to -2851, and the problem persists.

Expected behavior

Compiles/publishes + runs

Actual behavior

The rc3-24128-00 version appears when using the aspnetvnext feed. When using other feeds, I get the same exception, just with a different version of the package requested.

Error: assembly specified in the dependencies manifest was not found -- 
package: 'Microsoft.CSharp', version: '4.0.1-rc3-24128-00', 
path: 'lib/netstandard1.3/Microsoft.CSharp.dll'

[EDIT] Suspiciously similar: With a dotnet new project, merely adding a dep on "Microsoft.AspNetCore.Diagnostics": "1.0.0-*" produces a ...

C:\dotnetnew\bin\Release\netcoreapp1.0\publish>dotnet .\dotnetnew.dll
Error: assembly specified in the dependencies manifest was not found -- 
package: 'System.Buffers', version: '4.0.0-rc3-24128-00', 
path: 'lib/netstandard1.1/System.Buffers.dll'

... so it looks like some kind of general regression.

The problem is isolated to portable apps. Self-contained apps are :rocket:, as usual.

Environment data

[EDIT] Continues to occur with -002983. [EDIT] Continues to occur with -002966.

.NET Command Line Tools (1.0.0-preview2-002959)

Product Information:
 Version:            1.0.0-preview2-002959
 Commit SHA-1 hash:  0366576dba

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64
"dependencies": {
        "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
        "Microsoft.Extensions.Logging.Console": "1.0.0-*",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
        "Microsoft.AspNetCore.Mvc": "1.0.0-*",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
        "Microsoft.NETCore.App": {
            "type": "platform",
            "version": "1.0.0-*"
        }
    },
    "frameworks": {
        "netcoreapp1.0": {
            "imports": [ "portable-dnxcore50+net45+win8+wp8+wpa81" ]
        }
    },
guardrex commented 8 years ago

@piotrpMSFT Any idea on this one ...

Error: assembly specified in the dependencies manifest was not found -- 
package: 'Microsoft.CSharp', version: '4.0.1-rc3-24201-00', 
path: 'lib/netstandard1.3/Microsoft.CSharp.dll'

My portable test app (without changes) was publishing and running a week or two ago; but over successive dotnet cli versions recently, it's failing with this request for CSharp.

It's a very simple little MVC portable test app. Here's the entire project.json ...

{
    "authors": [ "GuardRex" ],
    "buildOptions": {
        "preserveCompilationContext": true,
        "emitEntryPoint": true,
        "warningsAsErrors": true,
        "debugType": "portable",
        "compile": {
            "exclude": [
                "wwwroot"
            ]
        },
        "copyToOutput": {
            "include": [ "Views", "wwwroot", "Logs" ]
        }
    },
    "dependencies": {
        "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
        "Microsoft.Extensions.Logging.Console": "1.0.0-*",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
        "Microsoft.AspNetCore.Mvc": "1.0.0-*",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
        "Microsoft.NETCore.App": {
            "type": "platform",
            "version": "1.0.0-*"
        }
    },
    "frameworks": {
        "netcoreapp1.0": {
            "imports": [ "portable-dnxcore50+net45+win8+wp8+wpa81" ]
        }
    },
    "publishOptions": {
        "include": [ "Views", "wwwroot", "Logs" ]
    },
    "scripts": {
        "postpublish": "guardrex-publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
    },
    "version": "1.0.0"
}
guardrex commented 8 years ago

I've been playing with this a bit, and there is some kind of mis-match between the dep graph of published output and the installed SDK. This is in spite of downloading the latest SDK and installing it. If I run the VS Code debugger, the app runs. If I try to run it manually dotnet .\testshared.dll it breaks with this exception. Anyway ... no other complaints, so I think this is a local problem here.