Using Visual Studio 2008 Web Deployment projects - getting an error finding aspnet_merge.exe - asp.net

I recently upgraded a VS2005 web deployment project to VS2008 - and now I get the following error when building:
The specified task executable location "bin\aspnet_merge.exe" is invalid.
Here is the source of the error (from the web deployment targets file):
<Target Name="AspNetMerge" Condition="'$(UseMerge)' == 'true'" DependsOnTargets="$(MergeDependsOn)">
<AspNetMerge
ExePath="$(FrameworkSDKDir)bin"
ApplicationPath="$(TempBuildDir)"
KeyFile="$(_FullKeyFile)"
DelaySign="$(DelaySign)"
Prefix="$(AssemblyPrefixName)"
SingleAssemblyName="$(SingleAssemblyName)"
Debug="$(DebugSymbols)"
Nologo="$(NoLogo)"
ContentAssemblyName="$(ContentAssemblyName)"
ErrorStack="$(ErrorStack)"
RemoveCompiledFiles="$(DeleteAppCodeCompiledFiles)"
CopyAttributes="$(CopyAssemblyAttributes)"
AssemblyInfo="$(AssemblyInfoDll)"
MergeXmlDocs="$(MergeXmlDocs)"
ErrorLogFile="$(MergeErrorLogFile)"
/>
What is the solution to this problem?
Note - I also created a web deployment project from scratch in VS2008 and got the same error.

Apparently aspnet_merge.exe (and all the other SDK tools) are NOT packaged in Visual Studio 2008. Visual Studio 2005 packaged these tools as part of its installation.
The place to get this is an installation of the Windows 2008 SDK (latest download).
Windows 7/Windows 2008 R2 SDK: here
The solution is to install the Windows SDK and make sure you set FrameworkSDKDir as an environment variable before starting the IDE. Batch command to set this variable:
SET FrameworkSDKDir="C:\Program Files\Microsoft SDKs\Windows\v6.1"
NOTE: You will need to modify to point to where you installed the SDK if not in the default location.
Now VS2008 will know where to find aspnet_merge.exe.

I just ran into this same problem trying to use MSBuild to build my web application on a server. I downloaded the "web" version of the SDK because the setup is only 500KB and it prompts you for which components to install and only downloads and installs the ones you choose. I unchecked everything except for ".NET Development Tools". It then downloaded and installed about 250MB worth of stuff, including aspnet_merge.exe and sgen.exe
You can download the winsdk_web.exe setup for Win 7 and .NET 3.5 SP1 here.

Related

VSCode Omnisharp server A .NET 6 SDK for x86_64 was not found

Omnisharp does not seem to recognize my installed .NET sdk (version 6.0.408).
I have tried manually adding this path via settings to Omnisharp: SDK path i.e.:
C:\Program Files\dotnet\sdk\6.0.403
I have also tried reinstalling the SDK and even VSCode.
This does not seem to solve the issue however, and I am unable to run my asp.net application on VSCode. Running dotnet run from the terminal is fine.
TLDR: Both .NET SDK versions and Visual Studion versions needed to be x64.
Here was the exact error I was seeing in the Output Window:
[ERROR] A .NET 6 SDK for x86_64 was not found. Please install the
latest x86_64 SDK from
https://dotnet.microsoft.com/en-us/download/dotnet/6.0.
[ERROR] Error: OmniSharp server load timed out. Use the
'omnisharp.projectLoadTimeout' setting to override the default delay
(one minute).
When I realized there was a mismatch between my .NET SDKs and Visual Studio Code in terms of being x86 and x64, I did the following:
Deleted the bin/obj folders and .vscode folders in my VS Code project.
Uninstalled my .NET SDKs via Windows (Setings > Apps).
Uninstalled Visual Studio Code via Windows (Setings > Apps).
Installed .NET 7.0 x64 and .NET 6.0 x64.
Opened PowerShell and ran dotnet --info to make sure my .NET runtime and SDK were appearing correctly.
Installed Visual Studio Code x64.
Used PowerShell and cd'd to my project folder. Did a dotnet restore. Then launched Visual Studio Code using code . command.
I could then use the most current version of the VS Code extension (v1.25.2).
Uninstalling and then installing the VSCode extension C# for Visual Studio Code solved the issue for me.
I had the same problem and just solved it. Copy and pasting this from a Youtube comment I just finished writing, so it might sound funny out of context, but the good bits are in there. Hope it helps.
Installed dotnet 7.0, but then it said dotnet 6 was missing...
So I deleted the script asset, exited Unity, went back to their website and installed Net 6.0.403
Error still happened.
I'll note this seemed to push a script compiling error out to Unity in the inspector window, as well.
Deleted the script asset again, exited Unity again, then uninstalled both dotnet 7 and dotnet 6.
Then I reinstalled dotnet 6.
Into unity, made a new script, opened it, and this time no error message about missing net 6.
I just started yesterday. Literally. So if my solution is trash, I'll laugh with you lol. Best of luck.

Building net5.0 solution on TeamCity agent results in "reference assemblies not found" error

I have recently upgraded our .Net Core 2.2 application to .Net 5.0. I'm now trying to upgrade our TeamCity build agent, so it can build this solution.
Installed the .Net 5.0 SDK on the build agent, and restarted the machine.
Installed the latest Community edition of Visual Studio on the build agent as well.
When I try to run a build on the agent using "dotnet msbuild", it shows this error message:
[Building CodeEngineQueryBuilder4] C:\Program Files\dotnet\sdk\5.0.202\Microsoft.Common.CurrentVersion.targets(1216,5): error MSB3971: The reference assemblies for ".NETFramework,Version=v5.0" were not found. You might be using an older .NET SDK to target .NET 5.0 or higher. Update Visual Studio and/or your .NET SDK.
More info:
RDPed onto the build agent and run "dotnet --info" on the command line, which gave me ".Net SDK Version 5.0.203"
I did find directory "C:\Program Files\dotnet\sdk\5.0.203" on the build agent, so it seems .Net 5.0 is installed.
The build agent runs Windows 8.1.
The TeamCity installation is on the latest version.
What am I missing here?
In the end, I found that I had to change the system environment variable MSBuildSdksPath
to make it point at the new .net5 Sdk directory.
In my case, I repointed it at:
C:\Program Files\dotnet\sdk\5.0.203\Sdks

Issue to install core3.1 VSBuildTools offline installer 2017 using workload

When we trying to install the offline installer which is generated using below workload getting exited with errorlevel 1 . Any advise please?
.\vs_buildtools__140882496.1541481122.exe --layout .
--add Microsoft.VisualStudio.Workload.MSBuildTools
Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools
Microsoft.VisualStudio.Workload.WebBuildTools
Microsoft.VisualStudio.Workload.NetCoreBuildTools
Microsoft.Net.Component.4.5.2.TargetingPack
--lang en-US
Error
Something went wrong with the install.
If the issue has already been reported on the Developer Community, you can find solutions or workarounds there. If the issue has not been reported, we encourage you to create a new issue so that other developers will be able to find solutions or workarounds. You can create a new issue from within the Visual Studio Installer in the upper-right hand corner using the "Provide feedback" button.
================================================================================
Package 'Microsoft.Net.4.7.2.FullRedist,version=4.7.3062.3' failed to install.
Search URL
https://aka.ms/VSSetupErrorReports?q=PackageId=Microsoft.Net.4.7.2.FullRedist;PackageAction=Install;ReturnCode=16389
Details
Command executed: "C:\ProgramData\Microsoft\VisualStudio\Packages\Microsoft.Net.4.7.2.FullRedist,version=4.7.3062.3\dotNetFxLatest-x86-x64-AllOS-ENU.exe" /q /norestart /KeepAUPaused /ChainingPackage Visual_Studio_15_Setup /CEIPconsent /log "C:\Users\Administrator\AppData\Local\Temp\dd_setup_20200103140616_004_Microsoft.Net.4.7.2.FullRedist.log"
Return code: 16389
Return code details: Unknown error (0x00004005)
Log
C:\Users\Administrator\AppData\Local\Temp\dd_setup_20200103140616_004_Microsoft.Net.4.7.2.FullRedist.log
Impacted workloads
.NET desktop build tools (Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools,version=16.4.29511.114)
MSBuild Tools (Microsoft.VisualStudio.Workload.MSBuildTools,version=16.0.28516.191)
Web development build tools (Microsoft.VisualStudio.Workload.WebBuildTools,version=16.4.29409.204)
Impacted components
.NET Framework 4.7.2 development tools (Microsoft.Net.ComponentGroup.DevelopmentPrerequisites,version=16.3.29207.166)
.NET Framework 4.7.2 targeting pack (Microsoft.Net.Component.4.7.2.TargetingPack,version=16.0.28517.75)
C# and Visual Basic Roslyn compilers (Microsoft.VisualStudio.Component.Roslyn.Compiler,version=16.0.28714.129)
MSBuild (Microsoft.Component.MSBuild,version=16.4.29429.68)

ASP.NET Core 2.1 Preview 2 App Not working on Azure App Service

I've been running my ASP.NET Core 2.1 Preview-1 app on Azure since this release became available. I had installed the ASP.NET Core runtime extensions through the portal and it's been working fine.
Now that Microsoft released ASP.NET Core 2.1 Preview-2, I installed the upgrade to the SDK. Updated my Nuget packages so that I have the preview-2 versions of everything. See my csproj file below:
I also removed the ASP.NET Core Runtime extensions from Azure App Service for my app which was showing 2.1 Preview-1. Instead installed ASP.NET Core 2.1 run times for x86 and x64 separately -- see below:
Compiled the app and published it to my Azure App service but I'm getting errors. First I got the 502.5 error. Now, I'm getting:
The specified CGI application encountered an error and the server
terminated the process.
What am I missing here?
UPDATE:
As the answer suggested, I set my target to x86 (to play it safe) -- see below:
I removed the extension and the individual x86 and x64 run times and installed only the x86 with support for ASP.NET Core 2.1 preview-2 -- see below:
I restarted the app several times and I'm still getting 502.5.
I then tried to do a self deploy through CLI command line by issuing the following command:
dotnet publish -c Release -r win10-x64
And I get the following error:
C:\Program
Files\dotnet\sdk\2.1.300-preview2-008530\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(125,5):
error : The RuntimeIdentifier platform 'win10-x64' and the
PlatformTarget 'x86' must be compatible.
Does this mean I have the x86 version of the SDK installed and I must target x86?
I didn't have half the trouble that I'm going through now going from ASP.NET Core 2.0 to 2.1!!!!
UPDATE 2:
Just ran dotnet --info in Kudu console. If I'm reading this correctly, I don't have the correct runtime.
Update 3:
I think this screen shot confirms what I was saying.
Update 4:
I installed x86 version of ASP.NET Core 2.1 Runtime -- see below:
When I run dotnet --info in Kudu console, I get the following which confuses me. I'm still not seeing the version I was expecting to see:
And when I hit the URL, I'm still getting 502.5 and the same message in Kudu console when I run dotnet MyApp.dll telling me that the correct version of the runtime is not found.
How will I get the correct version in there? I thought installing it through the portal would do it.
We've managed to publish ASP.NET Core 2.1 RC1 webapp to Azure app-service using "self-contained" deployment mode.
Platform target: Any CPU
Here are the package references from our .csproj:
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0-rc1-final" PrivateAssets="All" />
<PackageReference Include="Microsoft.AspNetCore.AzureAppServicesIntegration" Version="2.1.0-rc1-final" />
The steps I took to get this working:
Remove the 2.1-preview1 ASP.NET Core Runtime Extension.
Check the application settings to see if you're running under 32-bit or 64-bit.
Install only the matching (32- or 64-bit) ASP.NET Core 2.1 Runtime.
Restart the web app.
Restarting is important - before restarting the .NET Core tools were the wrong version and I would also get 502.5 errors.
As you've installed both 32- and 64-bit runtimes I'd try removing the one that your application doesn't need and restart the web app.
I had the same problem. Finally after 2 hours I fixed it.
Here is my configuration:
Extensions:
Console dotnet --info command:
Console kudu dotnet --version command:
a) Remember to restart your app after install extension.
b) Clear your wwwroot folder from old files and publish again.
I got my project working on asp.net core 2.1 Preview 2 on Azure.
I did the following steps;
Deleted the old asp.net core extension from Azure app service Extension
Using kudus deleted all the files in wwwroot folder of the site.
Installed asp.net core site extension from Azure as shown in the picture below and restarted the app service
Before deploying to Azure, the publish configuration option used is as depicted in the picture below,
That's it.
Try adding a global.json file in your project folder with this content:
{
"sdk": {
"version": "2.1.300-preview2-008530"
}
}
Restart your app after that to be on the safe side.
Here's the only thing that seems to have worked for me.
I did a self-contained deployment using
dotnet publish --self-contained -r win10-x64 -c Release
I then had to do a manual deployment -- in my case using FTP.
I really would like this issue to be resolved but if it's not resolved by my next deployment, I'll do the zip deploy. Because my app has a ReactJs frontend, there were thousands of files to deploy and FTP was not a lot of fun!
Because this approach doesn't depend on what's installed or not installed on Azure App Service, it's a much more straight forward solution.
I still want to be able to simply click Publish in Visual Studio though!
UPDATE:
I just did a zip deployment and I'm still getting the errors I was getting before even though zip deployment was successful. So, something is still not right!
I had a problem with a complex website, so I created a simple one with just the App file set at the same version:
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.3" />
</ItemGroup>
and then, taken from Tim Diekmann's example, I did nothing apart from changing the Deployment Mode in the Azure publishing configuration Settings to Self-Contained - and that worked.

Any luck with building ASP.NET 5 beta 7 application on VSO?

I'm trying to build ASP.NET 5 beta 7 application on VSO. And I getting following error:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DNX.PackageManager' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.DNX.PackageManager'
I know about this issue:
https://github.com/aspnet/Announcements/issues/51
So I tried to install latest WebTools using PowerShell script but "access denied".
Any ideas how to build beta7 app in VSO? Or just wait unit VSO build server will be updated with latest tools?
In order to build ASP.NET 5 beta 7 project successfully, the Microsoft ASP.NET and Web Tools 2015 (Beta7) – Visual Studio 2015 needs to be installed.
However, this web tool is not available on hosted build server, that is the reason why you get the "FileNotFoundException" error message (please check this link for the details what are installed on hosted build server: http://listofsoftwareontfshostedbuildserver.azurewebsites.net/). Additionally, you're not allowed to install any software to hosted build server, so, you get the "access denied" error message.
So, in order to build ASP.NET 5 beta 7 project successfully, instead of using hosted build server, you need to set up to use your own on-premise build controller. Check this link for the details: https://msdn.microsoft.com/library/ee330987
This is a result of the tooling changes for Visual Studio 2015 and VSO not having the latest tools installed in its hosted build controller (specifically, Microsoft.Dnx.PackageManager doesn't exist and should actually be Microsoft.Dnx.Tooling). To get around this, besides hosting your own build controller, you can fall back to the command line tools dnu build and dnu publish:
dnu build "src\{YOUR.PROJECT.FOLDER}" --configuration "release"
dnu publish "src\{YOUR.PROJECT.FOLDER}" --configuration "release" --out "your\output\directory\to\publish\to" --runtime "dnx-clr-win-x86.1.0.0-beta7"
I have this mostly detailed on my blog here: Deploying ASP.NET 5 Beta 7 Through Visual Studio Online
This should only be a temporary issue, as one can only assume Microsoft will be updating their tooling. When that's complete, you should be able to go back to the normal Visual Studio build step.
Seems that you've renamed PackageManager incorreclty. Just find where you have reference to 'Microsoft.DNX.PackageManager' and change it to 'Microsoft.DNX.Tooling'

Resources