Missing dependencies when publishing net46 to Azure #801
Comments
@anurse can you take a look? |
@Tratcher I'll try and take a quick look but I'm a bit tight on available bandwidth right now :). @hultqvist Would you be able to grab your full |
I can confirm the same issue here, and the fix works too. Thanks @hultqvist. |
What exactly did you pick? There's 2 options .NET Core and .NET Framework. |
I did .NET Core, but ended up targeting net46 since I decided to use SendGrid. |
Can you try the repro steps choosing .NET Framework instead of .NET Core? The template is slightly different. |
It looks like it doesn't have a project.json file, so it'd really defeat the purpose. |
@charles-smith The template for an "ASP.NET Core app on .NET Framework" should have a |
@anurse David's question said to not use .NET Core, did I miss something? |
@charles-smith just confusing naming. There's a template for Asp.Net Core on .NET Framework. |
I've tried the other project forms today and out of the box all net461 works. Actually I can now remove the dependencies I added previously and it still works.
However now the core version does not work anymore.
I have no idea what to add for Might this be an Azure issue since I've not updated my tools as far as I know. |
@charles-smith Yeah, apologies for the confusion. ASP.NET Core works on both .NET Core and .NET Framework. David wanted you to try ASP.NET Core on .NET Framework (see this diagram for some clarification) |
No problem. I finally got a chance to check it, and it worked without a hitch. |
@anurse - I just hit something similar after I published a project targeting net46 created from template to Antares: I see two errors:
and
The project.json looks like this:
How do I troubleshoot this? |
@davidebbo - is it possible to turn on Fusion log on Antares? How do I trouble shoot issues like above? |
Before trying fusion logs, can you check whether the relevant DLLs were in fact properly deployed? If not, then it's more of a deployment than runtime issue. Getting fusion log would probably require getting onto the VM. |
@davidebbo - the application seems to be deployed properly. I tried a few apps and all that target net451/net452/net46 failed this way. Apps targeting netcoreapp1.0 (standalone because 1.0.0 shared runtime is not installed) work just fine. |
Not sure. I guess we only tested .net core. Maybe let's wait till RTM is out and take it from there is it still repros? |
why does this matter if I target desktop clr? |
Ah you're right. I've never tried ASP.NET Core with Desktop CLR, so I know very little about it. Scenario wise, are there reasons to use it instead of .NET Core? I seem to recall @davidfowl telling me to mostly just focus Azure Web App support on .NET Core. Do you have a ready-to-push repo that demonstrates the issue with Desktop CLR? |
I can imagine that you may want to target net46 if the application is using APIs not available in .NET Core. As for the application - I just installed the latest (yetserday's) version of the tooling created a web app from the template and deployed it to an existing website I had. |
I think I figured this out and made it work. I manually deleted all the files I had in wwwroot and redeployed the app and it started successfully. So maybe it feels I had leftovers from previous app(s) that were picked up incorrectly. This might be an issue with webdeploy because I had the option to remove the files at destination checked: |
Please share a repo to remove any potential difference in what we try. Make sure that it repros the issue after git pushing it to a fresh site. |
Just saw your comment about removing additional files. Does the issue only occur when switching from Core to Desktop? i.e. if you start with clean site and target Core, I assume all is well? |
I will try it again to see if I can repro this. Targeting .NET Core worked just fine. |
Sorry, I meant "if you start with clean site and target Desktop, I assume all is well?" |
Yes, this seems to work too. @vijayrkn tried it as well and it worked for him so I kind of expected my issue to be environmental. |
Ok, so it seems there is no real issue here. Just left over files causing trouble when switching stack. |
Yes. Looks like it. At most, webdeploy did not clean the site properly and I am going to verify this. |
Can we close this bug? |
Yep. |
Hello, Any fix? |
@jose-cf - Can you please share a repro project? What kind of a project is it? Is it a webjob/ASP.NET on full framework?
|
@vijayrkn I tried with a toy example, same result. It is not ASP.NET. It is a simple .NET 4.6 assembly.
I added assembly redirect to 4.0.2.0, still tries to find 4.0.1.0. |
I just ran into this exact same issue as @jose-cf, however, I'm not publishing to Azure; simply publishing locally (/publish). Everything works when run from Visual Studio. Published executable is broken and reports: Console .NET Framework 4.6.2 Update: I then added the nuget reference to System.IO.FileSystem to the console app. Everything then worked fine in VS and the Published artifacts. Really odd behavior and most likely a bug somewhere; perhaps in the auto-add of binding redirects? |
@Cephei I think .NET Standard < 2.0 is quite abandoned... seems Microsoft only putting effort in 2.0. 2.0 even in preview has much better support for libraries dependencies. |
Steps to reproduce
Create a new dotnet core WebApplication project in Visual Studio 2015.
Modify project.json to only target
net46
:Result
Locally the project worked both in IIS Express and stand-alone.
Then I published it to a web app in Azure, the result was
When logging was activated two exceptions was found.
First one about missing assembly
System.IO.FileSystem.Watcher
, when that was addressed the message below was logged.Workaround
After adding dependencies to the two missing files in project.json the published project worked in Azure.
The text was updated successfully, but these errors were encountered: