-
Notifications
You must be signed in to change notification settings - Fork 428
Issues with .NET Standard and Click Once #529
Comments
Looking forward to this fix... Not so much implementing the workarounds ;) -- Any ETA? Soon, Summer 2018, etc? |
This doesn't appear to work. System.Runtime is still not getting deployed even after adding the extra target to my csproj.
|
…et/standard#529. The solution now publishes and installed but when run it just fails silently. The follow event logged in the Windows Application log. Application: ClickOnceIssueDemo.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException Exception Info: System.IO.FileNotFoundException at ClickOnceIssueDemo.App..cctor() Exception Info: System.TypeInitializationException at ClickOnceIssueDemo.App.Main()
This work around does not not work. It just moves the problem along so that the application will publish and install but it then will not run. You get an invisible APPCRASH with the following Application Event log. Application: ClickOnceIssueDemo.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException Exception Info: System.IO.FileNotFoundException at ClickOnceIssueDemo.App..cctor() Exception Info: System.TypeInitializationException at ClickOnceIssueDemo.App.Main()In the hope that someone can help with this I have created a simple application and put it here:. I have been unable to determine what file is missing. The Fusion Log Viewer does not show anything and attaching the debugger directly to the exe does not give show any additional information either. I am at a loss how to resolve this. I have wasted a day and a half on this already. The sample application targets .NET 4.7 and shows a main window displaying the time. It uses a .NET Standard 2.0 class library to provide the time. If you clone the repository and open the solution in VS2017 it will run fine. The application is based on a sample provided by Laurent Bugnion of Galasoft for another issue I had related to his newly released .NET Standard version of MVVMLight. [UPDATE] [UPDATE 2] |
@terrajobst it seems it did not fix the issue I compared the output between OnceClick and Non-OnceClick and files below are missing on OnceClick one. And because of that I'm getting the error Any workaround for that? Thanks in advance 🤗
Update Upgrading to target ,NET Framework 4.7.1 seems to have solved the issue for me too. I removed the work-around from the project file and it still seems working |
Actually we are still running into the issue with this ClickOnce deployment even after upgrading to 4.7.1. |
Yes, this workaround won't work when targeting 4.7.1. We are in contact with the ClickOnce team in order to get a fix for this issue. |
This also affects the Desktop Bridge WAP projects. The right files weren't getting copied into the AppX directory. Same list above. |
@terrajobst |
I've tested the described workaround on a net462 WPF clickonce project published from VS2017 - did not work. The app crashes and my log says
when instantiating the first (main) viewmodel of the WPF application. A few weeks ago we successfully published from VS2015 on net46 without any netstandard dependencies, of course. Unfortunately, we did not even see this issue during the upgrades, since it compiles and runs happily. Others have said, that upgrading to net471 might resolve the issue - gonna try now. However, I'm not sure if this is is acceptable, since there is no net471 installer for some windows 10 versions (we're behind company wsus). |
I can confirm that simply targeting net471 would resolve my issue, but that does not work on all company machines, since 471 only installs on some very specific win10 versions not available on our wsus. We give up (restored last working net46 clickonce version without netstandard dependencies) and wait. |
net471 doesn't appear to solve my issue, and I'm also concerned that net471 is limited on the windows versions. We are now very much in a stuck situation. We need to use nuget packages that have dependencies (such as Microsoft.Extensions.Logging), which only has a netstandard1.1 version. Once we pull those kind of nugets into a WPF app that uses clickonce, our deploys fail. Is there any work happening to fix this? |
I am looking into the same deploy issue, and like @nzain said, upgrading to 4.7.1 will limit the windows versions. Hope there will be a fix soon? |
Yes, we are very sorry you are hitting these issues. We have identified the problem and have contacted the clickOnce team in order for them to fix this ASAP. The fix is on track to make it to VS 15.8. |
@joperezr and is there any info about when this vs version will be released? |
Has anyone tried adding these dlls to the project as content ? |
@Shashanka77 no not tried this yet, feel free to try! |
I believe timelines for releases are not defined yet, but I'll try to find out and update this thread. |
@Shashanka77 I just tried the dlls as content files, as it seems to work. It seems that in general Click Once blacklists any assembly that matches one that exists in the .NET Framework, such as System.Runtime or System.IO. Assembly names like System.IO.Compression doesn't exist in the framework, so makes it into clickonce deployments by default. Adding as content files (which I have about 10 that were needed) adds more management, such as when adding or upgrading nuget packages, but it works for now. Really looking forward to that fix. Here's an example of the addition to my csproj file that forces their inclusion into a clickonce package:
|
@joperezr are there any news about this issue? This is real pain for me |
@NArnott What if you use a glob? I had to do something similar, for similar reasons, for the WAP packaging project for Desktop Bridge apps. Adding the entire output directory of the app as content, with the right Link path, did the trick: <Content Include="..\PackageExplorer\bin\$(Configuration)\net461\**\*.dll">
<Link>NuGetPackageExplorer\%(RecursiveDir)%(Filename)%(Extension)</Link>
</Content> |
@onovotny Thanks for the trick. I tried it, and started getting errors from clickonce that files were already installed. Looks like any assembly that is referenced both in the project as a dll, and as content (per your work-around), would end up in the click-once manifest twice, causing it to fail to download on a user machine. Any ideas how to solve that problem? |
I too am having this issue. I see that 15.8 is now released in preview. Has anyone installed it to verify that this issue is fixed? |
For our deployment it seems that installing the latest .net framework (4.7.2) on the client fixes the issue. |
@arthurvb Was it enough to install 4.7.2 on the deployment machine, or did you need to target 4.7.2 in your application? |
Upgrading to .NET 4.7.2 did not work for me sadly, however I have found that going into the Project Properties -> Publish, and clicking Application Files and then one by one setting the assemblies needed to Include instead of Prerequisite worked for me. |
@saulyt only on the machine where the program is run |
I upgraded a machine to .NET 4.7.2 and did not have the missing file error during the clickonce installation, but the program crashed on startup with no error message (just disappeared and was no longer running.) I then installed VS 15.8 Preview and installed again on the 4.7.2 machine and it worked. However, when I tried installing it on a machine with 4.7.1 I once again received the missing files error during installation. It seems that VS 15.8 does not fix the issue (at least if you are not running .NET 4.7.2). |
Just been looking at the fixed issues in VS 15.8 Preview 2 and this issue does not appear to be there. Can someone confirm whether a fix for this issue is scheduled for release with VS 15.8? |
As far as I can tell, unfortunately, ClickOnce team haven't yet been able to produce a fix for this issue. I'll push for somebody on their team to report back to this thread so that we can get an ETA and a state of things. |
@joperezr any progress? |
I was able to get in touch with the ClickOnce team and they say the fix is still targeting 15.8. It just hasn't been on the Previews of 15.8 yet, but it should be there for RTM. |
@joperezr Thanks for the update. Its pretty disappointing this has taken so long to resolve (if indeed it even has been resolved). |
As @joperezr mentioned, it will be included in 15.8, unfortunately we did just miss the deadline for Preview 3. |
@John-Hart So if I understand it correctly, the fix is implemented at this point? |
I cannot find it in preview 4 either? |
This was the issue with 15.5.6 target 4.7.1, after VS update to 15.7.5 today its got fixed with the work around specified on the top of this thread. |
@Janidbest Is really solved the issue? Today I started ClickOnce for a new production release which is scheduled for tomorrow. I guess we all lucky today! |
Adding this to my csproj, after retargeting 4.7.1 doesn't work
Also upgrading to .net 4.7.2 didn't work either. Really looking forward to this fix |
I was having this issue with a 4.7.1 WPF app, but went into the publish settings on the wpf projects properties and then under install mode and settings section clicked the application files button. Found the missing reference which for me was system.net.http.dll which had its publish status as Prerequisite and changed it to Include and this resolved the issue. I am running VS 15.7.5 and seem to be able to resolve the issue with this. |
If you are publishing a WPF / WinForms Application you can go to your Project > Properties > Publish > Application Files > and change Publish Status ( Prerequisite (Auto) to Include). Original Source Stack Overflow Step by Step Process. If you are deploying a Class Library or VSTO addin that's where it becomes complex since you don't have "Publish > Application Files", in which you have to manually modify the Click Once Manifest to include the DLLs, Add the Deployed DLLs to the publish directory, and finally resign it the solution manifest and the application manifest with MageUI. I created an article that is also Step By Step here. |
Has anyone tested if the fix is any of the latest couple of 15.8 previews? edit: I saw on this thread that the fix should be available now on the previews (since mid-July). |
I successfully built a ClickOnce release today with no project edits and a target of .NET Framework 4.7.1 using 15.8 Preview 5. |
I am able to create a ClickOnce package now without any issues in VS2017. I still don't see .NET Core as a prerequisite. Will that be added? |
We have this error (Unable to install or run the application. The application requires that assembly System.Xml.XPath.XDocument Version 4.1.0.0 be installed in the Global Assembly Cache (GAC) first.) only for users with Windows x86. Users with Windows x64 can install and use ClickOnce app without errors |
Is this fix intended to solve dotnet/msbuild#3057 and dotnet/msbuild#3058 ? |
Honestly, I'm not quite sure what I copy/pasted into my project, but it worked. Thanks! In my case, I got an error on Installation that said something like "The application requires that assembly netfx.force.conflicts version 0.0.0.0" |
.NET Core is not a prerequisite for your app to run. Your app will run on .NET Framework, and it only needs the right facades in place in order to work. With the fixes that the ClickOnce team made, these facades will be packaged as well, so it is not a requisite to have .NET Core. |
Closing as this an announcement. For the record, we've started to track issues related to .NET Framework support with this label. |
Summary
There is currently a bug that prevents ClickOnce setups from correctly deploying all the necessary .NET Standard support files. But you can work this around by editing your project file.
Symptoms and root cause
Running the application from inside of Visual Studio succeeds, so does publishing and installing. But when the application is launched, it crashes with with an exception like this one:
The root cause is bug in the way ClickOnce discovers and packages dependencies from the application project.
Workaround
In order to make sure the right files are added to your installer, you need to add a custom target to your project file:
<Import>
element and copy & paste the code from below before the<Import>
element.The text was updated successfully, but these errors were encountered: