Visual Studio 2010 Web deployment project file error - visual-studio-2010

I am trying to build a web development project in VS2010, but although all the individual projects build the web deployment project returns the following error.
C:\Program Files (x86)\MSBuild\Microsoft\WebDeployment\v10.0\Microsoft.WebDeployment.targets(1520,9): error MSB3462: Either MetabasePath or VirtualPath must be specified.
The .Net framework for the main web project is set as .Net 3.5.
Has anyone seen this error before as googling it returns very little.
EDIT: this project was upgraded from VS2008

Related

Visual Studio for Mac trying to find .NET Full Framework in build properties

Visual Studio for Mac (Version 8.8.7 (build 18)) is unable to upgrade netcoreapp3.1 asp.net mvc project to .net5.0 target framework. It throws below error:
/usr/local/share/dotnet/sdk/3.1.405/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(5,5):
Error NETSDK1005: Assets file 'App.Mvc/project.assets.json' doesn't
have a target for '.NETFramework,Version=v5.0'. Ensure that restore
has run and that you have included 'net50' in the TargetFrameworks for
your project. (NETSDK1005) (App.Mvc)
It will create a net5.0 mvc project from scratch alright but upgrade fails with the error. I've also tried to move all the files over into a new net5.0 from my netcoreapp3.1 project and somehow it converts the new project to .net full framework again. There's no clear indication as to what's causing this issue.
Ok I figured it out. I had a global.json pointing to version 3.1.*. Had 5.0.102 and it worked.

Visual Studio 2017 : Broken reference to project (CS0006)

In Visual Studio 2017 I have a test project that gives me an error about not finding the reference to my ASP .NET Web Application (Core 2.2.1).
Error CS0006 Metadata file 'C:\Users\olof\Source\Repos\Learning\ASP
Core\Integration
Tests\IntegrationTestExample1\IntegrationTestExample1\bin\Debug\netcoreapp2.1\IntegrationTestExample1.dll'
could not be found Integration.Tests
C:\Users\olf\Source\Repos\Learning\ASP Core\Integration
Tests\IntegrationTestExample1\Integration.Tests\CSC 1 Active
The error appeared after I updated my Web application from ASP 2.1 to 2.2. After the update I had 2 folder in my web applicationĀ“s debug folder: netcore2.1 and netcore2.2. I Removed the old one, but put it back after I got the error - but still the error remains.
I tried to rebuild and do a clean build several times on both projects but with no success.

Mixed targets in VSTS build

We have an aspnet-core application which consists of several .net standard libraries, two aspnet-core mvc applications and, exceptionally, a .net framework console application.
These all build successfully, both in solution in Visual Studio, and also individually using msbuild/dotnet build commands.
We are now trying to implement continuous integration/build with VSTS.
We have found that the aspnet-core web applications build successfully, but the .net framework console application fails with multiple error messages like the following:
2017-12-24T07:20:26.4090447Z C:\Program
Files\dotnet\sdk\2.0.3\Microsoft.Common.CurrentVersion.targets(1988,5):
warning MSB3245: Could not resolve this reference. Could not locate the
assembly "Xxx.Core, Version=1.1.0.0, Culture=neutral,
processorArchitecture=MSIL". Check to make sure the assembly exists on disk.
If this reference is required by your code, you may get compilation errors.
[d:\a\1\s\WinApps\ListBuilder\ListBuilder.csproj]
C:\Program Files\dotnet\sdk\2.0.3\Microsoft.Common.CurrentVersion.targets(1988,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.EntityFrameworkCore, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [d:\a\1\s\WinApps\TelemListBuilder\TelemListBuilder.csproj]
The console application follows the same folder structure as the web applications but seems unable to find any of the referenced packages.
Our Agent queue is Hosted VS2017.
We have two VSTS tasks: Restore and Build from the asp.net core build template.
If necessary we would be happy if we could exclude the console app from the build.
Since there are general .net framework project and .net core project and you want to build them together, you need to use Visual Studio Build task.
So, remove .Net Core Restore and .Net Core build tasks and add NuGet Tool Installer (4.3.0), Nuget restore and Visual Studio Build tasks (Visual Studio Version: Latest or Visual Studio 2017)
If you want to generate the deployment package during the build, you can specify MSBuild arguments like this:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)"

How to avoid msbuild publishing referenced project?

I have a Visual Studio 2013 solution (called Twins) with 3 projects:
Class Library (Lib)
WCF Service Application (WCF)
ASP .NET MVC Application (Site)
References
Site references WCF and Lib.
WCF references Lib.
I am trying to build and publish (WebPublishMethod = FileSystem) Site and WCF from the command line using msbuild.
This works for WCF project (split over multiple lines for clarity):
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
.\Twins.sln /t:Wcf
/p:"VisualStudioVersion=12.0;PublishProfile=wcfprofile;DeployOnBuild=true"
This fails for Site project:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
.\Twins.sln /t:Site
/p:"VisualStudioVersion=12.0;PublishProfile=siteprofile;DeployOnBuild=true"
Short error message
The value for PublishProfile is set to 'siteprofile',
expected to find the file at
\Twins\Wcf\Properties\PublishProfiles\siteprofile.pubxml'
but it could not be found.
Detailed error message
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4331,5):
error :
The value for PublishProfile is set to 'siteprofile',
expected to find the file at
'C:\Users\USERNAME\code\Twins\Wcf\Properties\PublishProfiles\siteprofile.pubxml'
but it could not be found.
[C:\Users\USERNAME\code\Twins\Wcf\Wcf.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(4338,4):
error :
PublishProfile(siteprofile) is set.
But the $(WebPublishMethod) does not have a valid value.
Current Value is "".
[C:\Users\USERNAME\code\Twins\Wcf\Wcf.csproj]
In Visual Studio I can right click on Site, select publish, select the sitepublish profile and only the site is published.
How do I build and publish the Site project from the command line just like I can do from inside Visual Studio? (Whether or not the WCF project is also built/published is not important.)

While Creating setup showing Error in visual studio

I am working on visual studio 2010. I am trying to Rebuild my setup project but I am getting these 3 error(s):
1: An error occurred generating a bootstrapper: Unable to finish updating resource for C:\Users\IBS Support\Desktop\Evalet Without Printer & Stored Procedrure\1\EVallet-Desktop\EvaletSetup\Debug\setup.exe with error 80070005
2: General failure building bootstrapper
3: Unrecoverable build error
I am using MS Visual Studio 2010, version 10.0.30319.1
(.Net FrameWork Version 4.5.50709)
This post should help you.
Quote from the post:
This happens because The .NET framework version required by the setup project is different than the .NET framework version targeted by the application.
To verify this:
In Solution Explorer, select the setup project.
On the View menu, point to Editor, and then click Launch Conditions. Click .NET
Framework.
In the Properties window, change the Version property to the version of the .NET Framework that you want the setup project to check for and install.
Hope this helps?

Resources