I recently developed a minor Excel 2010 Add-in in the Visual Studio 2011 beta and tried to deploy the solution right now. I selected the .NET Framework 4 as a prerequisite and setup.exe downloads it, if it is not yet installed on the target computer.
But I am getting headaches when trying to catch the "Tools for Office Runtime" into the dialog "Prerequisites" in the Publish tab when building. The strange thing is: In my Office, there was an old 2010 Visual Studio installation, that HAS this setting, I can select the entry, build it and voilá: The runtime is downloaded.
How can I tell Visual Studio: Look, I need this runtime, please check it before installing it. Because right now, setup.exe installs the add-in and it crashes on the first Excel start.
Futher information:
I use click-once deployment
C# VSTO add-in
Targetting Excel 2010
Edit
I think I found a solution for this:
I copied the VSTOR4 directory from my office PC located at ''C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages'' and placed it on my developer notebook at the same location. Result: not found
I copied it to ''C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages''
I edited my project.csproj to include the following setting:
<BootstrapperPackage Include="Microsoft.VSTORuntime.4.0">
<Visible>False</Visible>
<ProductName>Microsoft Visual Studio 2010 Tools for Office Runtime %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
The question is: Is this really the right way? Will there be problems that I didn't think of right now? Why isn't there an option to just download additional bootstrappers (there is, but for .NET 2.0 and some MDAC component I don't use)?
VSTO deployment just is painful as it is and not straight forward comparing to a simple "MSI Installer, done" procedure. Having to deal with these kind of issues really makes me kinda uncomfortable about the whole add-in architecture, but that's another story for another day.
Although you did it manually, it will work fine. Alternately you can go to project properties, Publish tab and click the pre-requisites button to bring up the pre-requsites dialog where you should be able to see VSTOR40 along with other bootstrapper components. If you don't see a particular one there, two possible reasons could be:
You don't have the bootstrapper package in your C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages folder (replace with v7.0 for VS2010)
Your product.xml (available in the above location) contains incorrect information.
One side note: You should check your product.xml file for HomeSite attribute and make sure you have that set to proper "fwlink" provided by Microsoft for that package. fwlinks are basically persistent web links from where a package can be downloaded by the ClickOnce installer, so that you don't have to distribute it with your product. Use Google to find out fwlinks of different bootstrapper packages.
Related
I'm currently trying to create a C# .NET 5.0 Console Application in Visual Studio 2019, and the option does not appear under project templates as I expect it to.
I downloaded Visual Studio Professional 2019 Version 16.9.4 (from https://visualstudio.microsoft.com/downloads/) and selected all workloads to be installed, then I installed SDK 5.0.202, ASP.NET Core Runtime 5.0.5, .NET Desktop Runtime 5.0.5, and .NET Runtime 5.0.5 (from https://dotnet.microsoft.com/download/dotnet/5.0).
When I go to File -> New -> Project and search for "Console Application", there is no default "Console Application" project template for C#. The closest I can find is "Console Application (.NET Framework)" for C#, VB, and F# and "Console Application" for C++. If I select "Console Application (.NET Framework)" for C#, the latest Framework that I can choose is ".NET Framework 4.8".
Actual Outcome: Project Templates
Actual Outcome: Frameworks
I compared notes with a developer who did not run into this problem, and they see the same framework restriction when they select "Console Application (.NET Framework)" for C#, but is also able to see the project template "Console Application" for C# (without ".NET Framework") and select ".NET 5.0 (Current)" as the target framework as expected. Nothing about what they installed and updated appeared to be noticeably different, our results for the command prompt command "dotnet --info" matched, and they did not have any "Installed products" listed under "About" or "Individual Components" listed under the installer that I was missing.
Expected Outcome: Project Templates
Expected Outcome: Frameworks
I have tried uninstalling and reinstalling everything, exhaustively installing every workload as well as additional individual components that looked potentially relevant, and making sure that the "Tools -> Options -> Environment -> Preview Features -> Show All .NET Core templates in the New project dialog (requires restart)" checkbox is checked.
Does anyone know what step I'm missing that is preventing me from creating a Console Application project template in C# using .NET 5.0?
Background -- This change/broke, issue that Microsoft opted deliberately you can read more here and the issue reported here but you can fix this with the 2 options listed below, i.e. A) enable it OR B) add it to VS via the repair tool
suggest clear VStudio Cache's -- kill dev process & clear cache before re/starting VS
run this cmd as admin in powershell
Get-Process devenv | Foreach-Object { $_.CloseMainWindow() | Out-Null }
Then DELETE ItemTemplatesCache, ProjectTemplatesCache folder ent. prof. etc.. C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE.
Now please Proceed with these Steps/Options
Option 1: you may have to enable this option...
Tools > Options > Preview Features > “Show all .NET Core templates in the New project dialog (requires restart)”.
Option 2: Install via Visual Studio Installer like so..
You can install missing workloads using the repair VS (this will also update the installer) and make sure you check the optional packages you want from the VS Installer tool please see this
after the installer starts check if the .NET Core workload is selected for desktop and console.. like below.. on the right pane you will need to check the correct boxes
Clear Visual Studio Component Cache (& optionally all Your templates)
Now, if you have already followed the above steps, then verifying you selected the checkbox of ".net-Desktop development" on top right is selected or not on Visual Studio installer: delete the cache and restore
i.e. you could restore the template in VS2017/2019 then try it again.
Kill dev process first run this Get-Process devenv | Foreach-Object { $_.CloseMainWindow() | Out-Null }
Please refer to the following steps:
DELETE the ItemTemplatesCache, ProjectTemplatesCache folder Ent. or Prof. version etc.. C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE. & C:\Users\<USERNAME>\AppData\Local\Microsoft\VisualStudio\16.0_93de0ddd
In the command prompt, navigate to the location of devenv.exe. This file is located in \Common7\IDE.
Type/Run this command devenv /installvstemplates and press Enter.
FYI - your templates cache is here, containing folders named after the zip files from your archives in the template folder.
you will need admin privilege's for edits/delete.
//templates cache Microsoft
%AppData%\Microsoft\VisualStudio\{some_version}\ItemTemplatesCache\
//templates path for verification, repair/reinstall or delete
%USERPROFILE%\Documents\Visual Studio 2019\Templates\ProjectTemplates
%USERPROFILE%\Documents\Visual Studio 2019\Templates\ItemTemplates
%ProgramFiles(x86)%\Microsoft Visual Studio\2019\<edition>\Common7\IDE\ItemTemplates\
%ProgramFiles(x86)%\Microsoft Visual Studio\2019\<edition>\Common7\IDE\ProjectTemplates\
Option 3: debugging your env. Template Config folder
Checking/Diagnosing the version:
run this dotnet --version
install the correct core version https://dotnet.microsoft.com/download/dotnet/5.0 more here
this dotnet new -u will tell you which templates are installed, you can uninstall, clear the packages cache, restart and reinstall with the repair tool.
Download and run collect.exe - https://aka.ms/vscollect - and share the log file created in %TEMP%\vslogs.zip with MS on github
FYI - This is what your template folder structure in visual studio should look like.
└───mytemplate
│ console.cs
│ readme.txt
│
└───.template.config
template.json
Eventually clear the MEF component cache, manually or with this extension.
But most likely something is wrong in the user cache at C:\Users\USERNAME\AppData\Local\Microsoft\VisualStudio\16.0_93de0ddd, which includes in particular InstalledTemplates.json and privateregistry.bin.
Try and rename (or delete) the folder, (or one the the two mentionned files to narrow the problem down), while VS is off, and restart VS. Only make sure that you have the proper workloads installed and the .net 5 from VS.
While it can be hard to tell what's exactly the issue with VS or local environment you have, it should be possible to temporary create projects with dotnet cli:
dotnet new console --output <project-dir>
If you would want to add it to an existing solution run
dotnet sln <solution-name>.sln add <project-dir>
The console app project file is very simple, so you can even create it manually, or create a project from any existing template and replace the contents with following asa workaround:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
And maybe one more thing you could try is to run the VS installer as admin or ensure that it can install and access all the required components.
I checked and I am able to create dotnet5.0 console application with visual studio version 16.9.2 and SDK version 5.0.201. I think there is some installation conflict on your end. You can try uninstalling the SDK and reinstalling visual studio or updating it to latest version and downloading latest SDK. Also check if SDK is getting installed on your system under
C:\Program Files\dotnet\sdk[your SDK version]\
After a year of just dealing with it, I FINALLY FIGURED IT OUT.
Go to C:\Program Files\dotnet\templates then open every folder there. Apparently it was a permission issue because I was getting:
[Window Title]
6.0.6
[Main Instruction]
You don't currently have permission to access this folder.
[Content]
Click Continue to permanently get access to this folder.
[Continue] [Cancel]
After selecting Continue for each folder, everything started working.
The error that resulted from running dotnet new --list is what gave me the heads up.
My solution was deleting C:\Users\USERNAME.templateengine\
I have VS 2019 version 16.9.5 when I seen your post. I am using console app for my sample projects. I have tried it and able to achieve what you are looking for. I would recommend to update your VS to 16.9.5 and give it a try.
My VS 2019 version:
Creating Console app in VS 2019 16.9.5:
Finally it has created a console app project with target framework as .net 5.0
While I was trying to Update my Project I was making - I got an error for the first time I've seen:
'An error occurred while signing: SignTool.exe not found.'
I've never seen this before, So I looked up that SignTool.exe is what signs my project for ClickOnce Deployment.
I also read that is it a part of Windows SDK - but when I looked to find where SignTool.exe is - I saw it right there!
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin
I saw no problem, and I've always published my Project all the time - I'm on Version 68. But this is the first time I've seen this - I didn't touch any options that would do this.
Any help?
ClickOnce Publishing Tools are not installed as part of the Typical Installation Options. So you have to install it in advanced mode.
This dialog can be found in Windows 7 by going to Control Panel > Uninstall a program, right-clicking on Microsoft Visual Studio Professional 2015 and selecting Change. A Visual Studio dialog will open up. Select Modify from the set of buttons at the bottom and the above dialog will appear.
Please Click Once application --> Properties --> Signing -> Unchecked the Sign the ClickOnce manifests.
Problem will be solved.
Note: Be aware that this solution removes security from your project. Seek assitance from a more learned colleague before doing so.
SignTool is moved to another location in the last SDK: C:\Program Files (x86)\Windows Kits\8.1\bin\x86
Need to install ClickOnce Publishing Tools during Visual Studio 2015 setup.
You can re-run the Installation from the Programs and Features section; find Visual Studio in the list and click Change.
You can fix this by clicking on installation application of VS. Then click Modify > Mark ClickOnce App and then upgrade your VS. Also i think #Alex Erygin is right. It is a bad solution to Click Once application --> Properties --> Signing -> Uncheck Sign the ClickOnce manifests. This is not a solution. It only circumambulated the problem.
This is a simple fix. Open the project you are getting this error on. Click "Project" at the top. Then click " Properties" ( Will be the name of the opened project) then click "Security" then uncheck "Enable ClickOnce security settings."
That should fix everything.
Click "Project" at the top. Then click " Properties" -> Signing -> Unchecked [Sign the ClickOnce manifests] is now working
Now try to publish the ClickOnce application. If you still find the same issue, please check if you installed the Microsoft .NET Framework 4.5 Developer Preview on the system. The Microsoft .NET Framework 4.5 Developer Preview is a prerelease version of the .NET Framework, and should not be used in production scenarios. It is an in-place update to the .NET Framework 4. You would need to uninstall this prerelease product from ARP.
https://blogs.msdn.microsoft.com/vsnetsetup/2013/11/18/an-error-occurred-while-signing-signtool-exe-not-found/
Lastly you might want to install the customer preview instead of being on the developer preview
None of the answers above talk about disabling ClickOnce. In my situation, I never used ClickOnce for my applications but after I upgraded to VS 2015 it was suddenly enabled and I got the 'SignTool.exe not found' error when I tried to compile.
To disable you go into the properties of your Project (right click) and choose Security | Uncheck Enable ClickOnce security settings.
You can leave the manifest checked in the Signing tab because it has nothing to sign if it's been disabled.
I've confirmed that unchecking the security resolved the compile error on my projects.
I needed Signing hence couldn't un-check as suggested.
Then goto Control Panel -> Programs and Features -> Microsoft Visual Studio 2015 Click Change then the installer will load and you need to click Modify to add ClickOnce Publishing Tools feature.
I did have similar problem. For some reason under
project properties -> Signing -> Sign ClickOnce manifests was enabled.
I unchecked it and the problem went away.
Reinstalling SDK did not help me but installing SDK+.NET 3.5 did from link below:
https://www.microsoft.com/en-us/download/details.aspx?id=3138
Windows 10 users can find signtool.exe in C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64 folder (10.0.18362.0 in my case, or other version).
But first, make sure you've installed Windows 10 SDK
Then, check Windows SDK Signing Tools for Desktop Apps is installed by going to Control Panel > Programs > Programs and Features, choose Windows Software Development Kit - Windows 10.0.18362.1 (in my case, you version may be different), right-click, choose Change, choose options Change then click Next.
I had the same issue/error message just after upgrading Visual Studio Pro 2019 V16.6.0. Solution was to make sure that the signing certificate is valid as mine had expired by a day.
Look in properties and signing to either enter a valid or temporary certificate. To keep the file name the same as before then un-click the security as mentioned above and then delete the key file linked to the programme.
Create a new key file and then add back the security.
Solution Explorer
Your app Right Clik
Propatis
Security
Unchek (Enable ClickOnce Security Settings)
Thats Solve..... __:)
https://i.stack.imgur.com/62nKZ.png See
[enter image description here]
After upgrading build tools in DevOps build agent to visual studio 2019, we started getting the below error for 64-bit build step of a WPF application.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(3975,5): error MSB3482: An error occurred while signing: SignTool.exe was not found at path
I tried all the above answers except the ones to disable signing or signing security and nothing helped.
Disabled the default MSBUILD step
Added a cmd prompt step
The path is
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MsBuild.exe"
Note: Removed amd64 from the path above.
This is still a workaround. I hope Microsoft will fix it in the following release.
For VS 2019 or later (Windows 11)
Option 1 (Recommended) -
ClickOnce Publishing Tools are not installed basic Installation. Therefore you will have to manually check and install.
Go to Visual Studio Installer
Then Click modify
Finally, select Individual components tab, search for ClickOnce Publishing and install
Restart the computer.
Option 2 (Not recommended) -
Click Once application --> Properties --> Signing -> Uncheck Sign the ClickOnce manifests. This is not a solution. A workaround.
Option 3 -
Install Windows 10 SDK. Check Control Panel > Programs > Programs and Features > Windows Software Development Kit
Well, I've been trying to make a C++ DLL in Visual Studio 2015, which took a while since I'm not very good with Visual Studio.
I need to access the .NET libraries, specifically System::Management. (Writing the code was a little harder than it needed to be due to a poor C++ implementation, but at least it has one.)
I fixed obvious errors and finally figured out I had to enable CLR in the project properties and then select the related libraries with References->Add Reference. But after all that, now it's just giving this weird error:
LNK1104: cannot open file 'MSCOREE.lib'
The compiler doesn't show red wavy lines below anything, and the error claims the line is "1" and the file is "LINK", so no help there.
I thought I probably messed up the project configuration somewhere, so I created a new project and moved the code over. The error still happened. If I turned off CLR and commented out the .NET-dependent code, the build succeeded without errors.
So I tried creating a new project from template (Visual C++ -> Win32 Console Application) and then enabling CLR before doing anything else. Then I tried again, selecting different versions of .NET framework.
Finally, I tried creating a project with template (Visual C++ -> CLR -> CLR Console Application) and building it immediately. I mean literally without doing ANYTHING ELSE. It still gave the same error!
LNK1104: cannot open file 'MSCOREE.lib'
What on earth is going on? Am I doing something wrong here, or is VS2015 just broken?
I had the same problem. Installing ".NET Framework 4.6.1 SDK" solved the problem. Pay attention to the version number, take it from your project configuration files
Check in Visual Studio installer 'C++/CLI support' for build tools of your needed version.
Try this,
Right click the project that shows 'LNK1104: cannot open file 'MSCOREE.lib'', then select Properties --> Configuration Properties --> VC++ Directories --> Library Directories --> Add both entries from below separated by semi-colon
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64
This is where your 'mscoree.lib' should be, check if its there before doing this otherwise you might need to install/reinstall the Microsoft SDKs
In some situations the SDK may not install the required files in the LIB folder as described in MSCoree.lib missing from WinSDK. Their solution was to execute a repair of the install. That may not work.
I have successfully ran WinSDKInterop_amd64\WinSDKInterop_amd64.msi resulting in the creation of:
C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\IA64\mscoree.lib
C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\mscoree.lib
C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64\mscoree.lib
I am making an installer using NSIS and my gameplan was to
Build the startup project
Copy the Files created from the bin/(x86) or bin/x64 folder and embed them in the installer
The problem is that some files do not get included. From what I have seen, these files are exclusively Microsoft dlls. Does anyone have any ideas on how I can include them?
My idea is to parse through the csProj file and loop through every file on the Item-Group -> PublishFile node, check if it is in the bin subfolder, if it is not,embed the file in the installer.
Is there a simpler/better way to do this? If not, is there atleast a class(perhaps a DTE class) that represents the contents of the csProj file so I wouldn't need to parse xml? I have looked around and I couldn't find any.
From your original post what I can understand is that, you are building some sort of C# application and want to build a installer for the same.
Now why do you need to pack Microsoft Dlls?
Microsoft do provide every redistributable packages to be installed on end-user computer. You need to analyze what are the packages you need when running your application on a computer that doesn't have Visual Studio installed.
I think you only need .Net Framework and SQL redist packages. And these things can be installed silent during installation. And this is the proer approach.
Is it possible to manually install my word add-in?
Visual Studio is preparing an installation file for word add-in and it worked great but i want to build more complex installation file. if i knew how to do it manually it would be very easy to build my own installer.
Sure its possible.
If you use Visual Studio 2013, you have two common options to deploy your addin.
One is to use publishing, also known as, Click-Once, this basically does all the dirty work for you, and leaves you with an executable that helps you deploy it on your target machines by simply double clicking it.
The other method is to use the InstallShield.
Go to File > Add > New Project > Other Project Types > Setup and Deployment > Installshield ...
You most likely do not have install shield installed, so once you try to choose that project a webpage will pop up, asking you to register (quickly and freely) to download and install Install-Shield limited edition - do it, its quite fast.
When its done, you may add a setup project to your solution.
now this part is very user-friendly, and allows you to build a custom install to your liking.
Notice that the free "limited edition" as they call it, gives you quite a lot of features, so it should be enough for light weight word addin.
Now, placing the focus on the Word Addin, the whole idea of the install is to place about 4 registry values into the deployed machine to point to the dll you compiled, and describe it.
You can find all the information you need by following microsoft's step-by-step guide on deploying an addin. its very fun and simple. really!
https://msdn.microsoft.com/en-us/library/ff937654.aspx
Good Luck !