Quantcast
Channel: MSBuild forum
Viewing all 2763 articles
Browse latest View live

VS2019: Choose - When Condition=" '$(Configuration)'=='MyConfig' " not working anymore

$
0
0

I have a configuration named "local". This configuration compiles and links all my custom libraries with my application:

 <Choose>

   <WhenCondition="'$(Configuration)' == 'Local'">

     <ItemGroup>

       <ProjectReferenceInclude="..\..\..\..\Komponenten2\Idw.MvcLib\trunk\_apl\Idw.MvcLib.csproj">

         <Project>{751101e1-6d1d-4450-b647-8042ddd1d187}</Project>

         <Name>Idw.MvcLib</Name>

       </ProjectReference>

       <ProjectReferenceInclude="..\..\..\..\Komponenten2\LINQtoCSV\trunk\_apl\LINQtoCSV.csproj">

         <Project>{07058bf9-6f86-40ff-ae33-2a4f89b5758a}</Project>

         <Name>LINQtoCSV</Name>

       </ProjectReference>

     </ItemGroup>

   </When>

   <Otherwise>

     <ItemGroup>

     </ItemGroup>

   </Otherwise>

 </Choose>


With other configurations ("test", "production") these libraries are referenced by Nuget with the inversed condition:

   <ReferenceInclude="Idw.MvcLib, Version=2017.3.0.3, Culture=neutral, processorArchitecture=MSIL"Condition="'$(Configuration)' != 'Local'">

     <HintPath>..\packages\Idw.MvcLib.2017.3.0.3\lib\net461\Idw.MvcLib.dll</HintPath>

   </Reference>

With Visual Studio 2019 it takes always the NuGet reference instead of the project ref. I noticed it when I am trying to debug. The debugger issues a "Just My Code Warning": "You are debugging a Release buld of xxx.dll. Using Just My Code with Release builds using compiler optimizations results in a degrades debugging experience (e.g. breakpoints will not be hit)" With Visual Studio 2017 the same project works fine.


Visual Studio 2019编写的安卓程序,生成失败

$
0
0

下载实例不改动任何能够编译成功,稍加改动无法编译成功。

布局代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView
        android:text="请输入拱高L:"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/textView1" />
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/GongGao"
        android:text="5" />
    <TextView
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/TranslatedPhoneWord"
        android:text="请输入弦长L" />
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/xianchang" />
    <TextView
        android:text="半径R="
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_width="match_parent"
        android:layout_height="50"
        android:id="@+id/BanJing" />
    <Button
        android:text="计算半径"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/JiSuan" />
</LinearLayout>

入口代码:

                         

using System;
using Android.App;
using Android.OS;
using Android.Widget;


namespace Phoneword
{
    [Activity(Label = "Phone Word", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our UI controls from the loaded layout
            EditText h = FindViewById<EditText>(Resource.Id.GongGao);
            EditText l = FindViewById<EditText>(Resource.Id.xianchang);
            Button bt = FindViewById<Button>(Resource.Id.JiSuan);
TextView tv = FindViewById<TextView>(Resource.Id.BanJing);

string translatedNumber = string.Empty;

            bt.Click += (sender, e) =>
            {

                try
                {
                    if (double.Parse(h.Text) > 0 && double.Parse(l.Text) > 0)
                    {
                        tv.Text = "半径R="+Jisan(double.Parse(h.Text), double.Parse(l.Text));
                    }

                }
                catch (Exception ex)
                {
                    tv.Text = ex.ToString();
                }
            };
        }

        private string Jisan(double h, double l)
        {
           return ((h / 2 + l * l / 8 / h).ToString());
        }
    }
}

其余代码为自动生成。

Unusual folder (with name as projectName) being appended to the target binary(dll/lib)

$
0
0

I am having MS Visual Studio 2013 projects for dll/libs for which somehow on my machine the target path for the library seems to be having an extra folder(of the name of $ProjectName) appended at the end(extra to what is mentioned in the $OutDir). The same solution/project files on other machine create the target binary at the correct desired location.

e.g. say I have $(OutDir) as "\folder1\folder2\" with $(ProjectName) asmyLib

On My machine on building the project/solution, I get the target binary created at "\folder1\folder2\myLib\myLib.dll"

While on all other machines the lib is correctly being created at "\folder1\folder2\myLib.dll" (no extra folder with the $ProjectName (heremylib) being created).

I have looked for the project and solution files in text editor looking for anything obvious being the cause, but couldn't notice any discrepancy, nor do I see any difference in the solution/project files using windiff when compared to these files on other machines. 

Can someone please help me with - what could be the cause of the issue here or How to go about troubleshooting it further ?

Thanks.

 

AAryaman

Building a UWP sln via MSBuild builds every architecture possible for a dependent project.

$
0
0

I have a VS solution that I am trying to build via MSBuild on the command line.  This solution has a few dependencies in it.  Like this:

Foo.sln

  Foo.csproj

  Foo.test.csproj

  Foo.logic.csproj

When I build the solution via VS 2017, targeting x64 architecture it builds only the x64 binaries for Foo.test.csproj.  When I do basically the exact same thing via MSBuild it ends up building all the possible architectures that are configured for Foo.test.csproj (ARM, x64, and x86).  

It seems like how this works is different in VS vs MSBuild, but I cannot for the life of me figure out the difference.  The build command I am running via MSBuild is:  

 C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\MSBuild.exe C:\Users\source\foo-uwp-app\src\uwp\foo.sln /target:Restore;Rebuild /verbosity:normal /toolsversion:15.0 /nologo /maxcpucount /property:Platform=x64 /property:Configuration=Debug


Please help me find documentation?

$
0
0

I'm trying to get an Azure DevOps pipeline setup to build an asp.net project and deploy to my on premise staging server.

I've done this with a dotnet core project and it was super easy. 

But this asp.net project is huge and has many assets being created by webpack that are not getting picked up by the release pipeline. 

I'm trying to figure out what all the MSBuild parameters are that are included in the Visual Studio Build task in the "MSBuild Arguments" field: 

 /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"

If I do MSBuild /? from my command line on my dev box, none of those options are listed. -p says you can set project-level properties. Okay, that's a clue, but when I go here: 

https://docs.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-properties?view=vs-2019

None of the above "project-level properties" (DeployOnBuild WebPublishMethod PackageAsSingleFile SkipInvalidConfigurations PackageLocation) are listed. 

So what am I missing? 



MSBuild and its use of the "Platform" environment variable

$
0
0

Hi,
I recently downloaded the source for an open source program (SharpDevelop) that calls MSBuild through a .bat to build the .exe. When I attempt to build it, the build fails with an "MSB4126: The specified solution configuration "Debug|HPD" is invalid" error.

This is on a brand new HP Pavilion sysytem. I traced the problem down to the fact that HP defines the "Platform" enviroment variable as "Platform=HPD". I fixed the problem by adding "/p:Platform=Any CPU" to the MSBuild command line in the .bat file to override it.

My question is this: Is the "Platform" enviroment variable defined for the use of MSBuild alone or does it have other uses in Windows besides setting the CPU platform?

I have a similar question in to HP support to see if they use it for something in their installed OEM software when it runs. If possible, I'm looking to delete/clear it all together and let the default configuration in the solution file set the value.

Thanks in advance.

Paul

 

Visual Studei Code - why isnt my CSS updating in the preview?

$
0
0

I am getting absolutely fuming with my Visual Studio Code application.

My CSS isnt updating with the VSC preview function. I have tried various path drives for my Stylesheet link but surprise, nothing works - it works temperamentally but only when I restart the programme or I click a few menu items around the app, only then does it say to itself "Actually, I'm going to do as I'm told for once...."

For a multi-billion dollar company, they do make some total rubbish sometimes. No wonder why it's free!

What a total joke.

<!DOCTYPE html><html><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1"><head><link rel="stylesheet" href="css.css" type="text/css"></head><body><div id="center"><ul><li><a href="#">Item 1</a></li><li><a href="#">Item 1</a></li><li><a href="#">Item 1</a></li><li><a href="#">Item 1</a></li><li><a href="#">Item 1</a></li><li><a href="#">Item 1</a></li></ul><div id="carousel_container"></div></div></body></html>

The command "UpdatedVersion.exe" exited with code -1.

$
0
0
<Target Name="BeforeBuild"><MSBuild Projects="$(SolutionDir)\Build\UpdateVersion.csproj" Targets="Build" Properties="Configuration=Release" /><Exec WorkingDirectory="$(SolutionDir)\Build" Command="UpdateVersion.exe" Timeout="60000" Condition=" '$(OS)' == 'Windows_NT' " /></Target>

Error code:

The command "UpdateVersion.exe" exited with code -1.	Confuser.Core	E:\MoogsObfuscator - Copy\Confuser.Core\Confuser.Core.csproj	169	

How I got the error:

I had some issue where my project wasnt building so I removed the project from the solution then added it back and then this error happend.


build.proj file does not work with VS17 community edition

$
0
0

Below is the start of my build file
It just doesn't work with Visual Studio 2017 Community edition.

1) What is the correct value for $(VCTargetsPath)

2) How do I tell this to my build.proj file?

<?xml version="1.0" encoding="utf-8"?>
<Project
        DefaultTargets="Build"
        ToolsVersion="4.5"
        xmlns="http://schemas.microsoft.com/developer/msbuild/2003">


    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
    <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Win32.targets" />

            

error MSB4062: The “GetOutOfDateItems” task could not be loaded from the assembly

$
0
0

I am getting following error while building in MSFT VS 2017 using cmake.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(181,5): error MSB4062: The "GetOutOfDateItems" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

I found a link that says (https://developercommunity.visualstudio.com/content/problem/341712/error-msb4062-the-getoutofdateitems-task-could-not.html) that fix for it is available in VS 2019, but I cannot move to VS 2019 and want to get it to working on VS 2017. Also I am not able to locate which file to edit for including suggested changes at the link. Could one please provide some workaround for VS 2017?

Error MSB4057

$
0
0
Severity Code Description Project File Line Suppression State
Error MSB4057 The target "ResolveTagHelperRazorGenerateInputs" does not exist in the project. SunWeb.Web C:\Program Files\dotnet\sdk\2.1.602\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets 227 

Ho to pass additional conditional compilation symbols on msbuild commandline

$
0
0
Hi,
 
I want to add some conditional compilation symbols when invoking msbuild to a solution file.
I tried to use msbuild /p:DefineConstants:MY_DEFINE file.sln, but the problem is that instead of adding MY_DEFINE to the existing list, it replaces it, so if a specific project in the solution has a conditional compilation symbol set, it stops being defined.

When invoking csc directly I can do this easily by passing /D. Isn't there any way to do this in msbuild (whithout requiring to change the individual .csproj's)?

Best Regards,
Gustavo Guerra

Publish .Net Web site to Azure - using Visual Studio Command Line

$
0
0

Hi,

I am publishing a .net site to Azure.

It works from Visual Studio but I am having trouble doing exact same thing using Command line.

So from VS, From publish Site option, I choose Web Deploy and I gave Server, Site Name, User Name, Password, Destination URL.

Validated Connection and published site, it correctly update site on Azure. This is a Azure Web app. 

I am trying to achieve same using command line. 

Tried below command but its not updating site.  

I run it from path "C:\Windows\Microsoft.NET\Framework\v4.0.30319>"

msbuild 
C:\myProjectFolder\MySolutionFile.sln 
/t:AzureSiteName 
/p:DeployOnBuild=True 
/p:PublishProfile=C:\myProjectFolder\SavedPublishprofile.pubxml 
/p:Configuration=Release 
/p:AllowUntrustedCertificate=True 
/p:CreatePackageOnPublish=True 
/p:WebPublishMethod=MSDeploy 
/p:MSDeployPublishMethod=WMSVC 
/p:MSDeployServiceUrl=AzureSite 
/p:UserName=UserName 
/p:Password=Password 
/p:DeployIISAppPath=AzureSiteName 
/p:SkipExtraFilesOnServer=True

Can someone tell me if I missed anything in below command please.

Thanks in advance, 

About agent licensing when compile codedui tests

$
0
0

I use TFS 2017 and for my codedui tests I use run assemblies Task in my build.

I see compile and run assemblies are on need to be on same pc (agent) since they are in same build, every agent using this build needs enterprise license ?

Really confused on this issue. I need separate license for every agent then ?

Lets say I have 5 different agents on different virtual servers, they all need the enterprise license for compiling dlls ?

Or I just install VS on every agent, it compiles my code and runs but DO NOT need license since agents will not open VS editor write code



Just updated VS2019 to v16.2.0 and now getting Build Errors MSB4064 & MSB4063

$
0
0

I just updated VS 2019 and now my application Ive been working on won't build.

I am getting the following two errors..

SeverityCodeDescriptionProjectFileLineSuppression State
ErrorMSB4064 The "Nullable" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property.

 

ErrorMSB4063 The "Csc" task could not be initialized with its input parameters. RoslynDDDCodeGeneratorC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets59

Microsoft Visual Studio Community 2019
Version 16.2.0
VisualStudio.16.Release/16.2.0+29123.88
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

Application Insights Tools for Visual Studio Package   9.1.00611.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019   16.2.290.48383
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   16.2.290.48383
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.2.290.48383
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.3.9000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools   16.2.290.48383
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio   2.3.9000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools   3.2.0-beta4-19359-03+15b43b33901c88f68ef43f8314b5a2457716780d
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Azure HDInsight Azure Node   2.3.9000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.3.9000.0
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio   2.5
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service   2.3.9000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20626.2

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   1.0
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Node.js Tools   1.5.10610.1 Commit Hash:529a87de2769e143655e31ea81795c42e5775ef8
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager   5.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.61906.28070
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   16.0.10627.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.2.0-beta4-19359-03+15b43b33901c88f68ef43f8314b5a2457716780d
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6   16.2.0-beta.19321.1+a24d94ecf97d0d69d4fbe6b8b10cd1f97737fff4
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes   1.0
Visual Studio Tools for Kubernetes


Code Coverage not working with MSBuild

$
0
0

Hi,

Our Project is running the builds on Team City using MSBuild

There is a problem with the Test Coverage after introducing Testing functionality.

Using WebApplicationFactory to setup our test project using Microsoft.AspNetCore.Mvc.Testing

Below is the code causing the code coverage to 0%

var result = await Api.SendRequest(_factory.CreateClient(), request, requestheaders);

before introducing this -factory.CreateClient() code

Code Coverage was 

75% and Lines 72.1%

after introducing this -factory.CreateClient() code

its 0% and 0%

screen shots are attached

Cannot build default Angular project in VS 2019

$
0
0

I cannot build the default Angular project in Visual Studio 2019.  

1) Installed VS 2019 with the following workloads:

             ASP.NET and Web Development

             Azure Development

             Node.js development

             .NET Desktop Development

             Desktop Development with C++

2) Create new project 

            Use template:   ASP.NET core Web Application

                   Choose:   .NET Core and ASP.NET Core 2.2

                                   Angular

            Create !

3)  After project is created, attempt to build solution.

            Receive build error:    


Warning MSB3073 The command "node --version" exited with code 9009. WebApplication4 C:\Users\RMillman\source\repos\WebApplication4\WebApplication4\WebApplication4.csproj 29 
Error  Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE. WebApplication4 C:\Users\RMillman\source\repos\WebApplication4\WebApplication4\WebApplication4.csproj 32 

In the output window the following error is shown:

1>------ Rebuild All started: Project: WebApplication4, Configuration: Debug Any CPU ------
1>WebApplication4 -> C:\Users\RMillman\source\repos\WebApplication4\WebApplication4\bin\Debug\netcoreapp2.2\WebApplication4.dll
1>WebApplication4 -> C:\Users\RMillman\source\repos\WebApplication4\WebApplication4\bin\Debug\netcoreapp2.2\WebApplication4.Views.dll
1>'node' is not recognized as an internal or external command,
1>operable program or batch file.
1>C:\Users\RMillman\source\repos\WebApplication4\WebApplication4\WebApplication4.csproj(29,5): warning MSB3073: The command "node --version" exited with code 9009.
1>C:\Users\RMillman\source\repos\WebApplication4\WebApplication4\WebApplication4.csproj(32,5): error : Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE.
1>Done building project "WebApplication4.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I would think that the project generated from the template should be buildable.  What am I doing wrong?

Publishing to Azure From Visual Studio Command line fails

$
0
0

Hi,

I am having issue publishing a Web App to Azure, using MSBuild command.

Seems like issue is happening because of using “using System.Security.Claims;”.

I have a sample web application, Visual Studio 2017, c#, Web Site project.

On my web page, I simply added “using System.Security.Claims;”, no any other code.

I have saved my “SampleWebSite1-WebDeploy.pubxml” file which is as below.

============================================================================================================================

<?xml version="1.0" encoding="utf-8"?><!--

This file is used by the publish/package process of your Web project. You can customize the behavior of this process

by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.

--><Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><PropertyGroup><WebPublishMethod>MSDeploy</WebPublishMethod><ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect><PublishProvider>AzureWebSite</PublishProvider><LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration><LastUsedPlatform>Any CPU</LastUsedPlatform><SiteUrlToLaunchAfterPublish>XXX</SiteUrlToLaunchAfterPublish><LaunchSiteAfterPublish>True</LaunchSiteAfterPublish><ExcludeApp_Data>True</ExcludeApp_Data><MSDeployServiceURL>XXX</MSDeployServiceURL><DeployIisAppPath>SampleWebApplication1</DeployIisAppPath><RemoteSitePhysicalPath /><SkipExtraFilesOnServer>True</SkipExtraFilesOnServer><MSDeployPublishMethod>WMSVC</MSDeployPublishMethod><EnableMSDeployBackup>True</EnableMSDeployBackup><UserName>$SampleWebApplication1</UserName><Password>XXX</Password><_SavePWD>True</_SavePWD><_DestinationType>AzureWebSite</_DestinationType><EnableUpdateable>False</EnableUpdateable><DebugSymbols>False</DebugSymbols><WDPMergeOption>DonotMerge</WDPMergeOption><PrecompileBeforePublish>True</PrecompileBeforePublish><ExcludeFilesFromDeployment>web.config</ExcludeFilesFromDeployment></PropertyGroup></Project>


============================================================================================================================

I am running below command to publish my web site to Azure, using this profile.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin>msbuild C:\XXX\WebApplication1\WebSite1 /p:DeployOnBuild=True /p:PublishProfile=C:\XXX\WebApplication1\WebSite1\App_Data\PublishProfiles\SampleWebSite1-WebDeploy.pubxml

But if fails with below error.

============================================================================================================================

AspNetPreCompile:

  C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v /WebSite1 -p C:\Users\XXX\AppData\Local\Temp\WebSitePublish\WebSite1-934461955\obj\Debug\AspnetCompileMerge\Source -c C:\Users\XXX\AppData\Local\Temp\WebSite

  Publish\WebSite1-934461955\obj\Debug\AspnetCompileMerge\TempBuildDir

c:\Users\XXX\AppData\Local\Temp\WebSitePublish\WebSite1-934461955\obj\Debug\AspnetCompileMerge\Source\Default.aspx.cs(7): error CS0234: The type or namespace name 'Claims' does not exist in the namespace 'System.Security' (are you m

issing an assembly reference?) [C:\XXX\WebApplication1\WebSite1\website.publishproj]

Done Building Project "C:\XXX\WebApplication1\WebSite1\website.publishproj" (default targets) -- FAILED.

Build FAILED.

"C:\XXX\WebApplication1\WebSite1\website.publishproj" (default target) (1) ->

(AspNetPreCompile target) ->

  c:\Users\XXX\AppData\Local\Temp\WebSitePublish\WebSite1-934461955\obj\Debug\AspnetCompileMerge\Source\Default.aspx.cs(7): error CS0234: The type or namespace name 'Claims' does not exist in the namespace 'System.Security' (are you

 missing an assembly reference?) [C:\XXX\WebApplication1\WebSite1\website.publishproj]

    0 Warning(s)

    1 Error(s)

============================================================================================================================

While publishing, I need to keep these two options in my profile, to precompile files so that it does not publish actual code files (.cs) and it excludes web.config file from publishing.

    <PrecompileBeforePublish>True</PrecompileBeforePublish>

    <ExcludeFilesFromDeployment>web.config</ExcludeFilesFromDeployment>

If I remove any of these option, it correctly publishes site on Azure.

But the issue is happening because of having both options together.

If I keep  <PrecompileBeforePublish>True</PrecompileBeforePublish>, it always fails with the error “error CS0234: The type or namespace name 'Claims' does not exist in the namespace 'System.Security' (are you

 missing an assembly reference?) [C:\XXX\WebApplication1\WebSite1\website.publishproj]

I tried various options but could not make this working.

So can someone help me to publish this sample web application, to Azure, using given command, with both the options <PrecompileBeforePublish>True</PrecompileBeforePublish> and <ExcludeFilesFromDeployment>web.config</ExcludeFilesFromDeployment>.

_EnsureRazorTasksAssemblyDefined" does not exist in the project

$
0
0

Dear Community Team:

Can you please help me regarding this issues

I am facing with this issues using .net core 2.2 in visual studio 2019 and 2017 

ErrorMSB4057The target "_EnsureRazorTasksAssemblyDefined" does not exist in the project.BookList

Unusual folder (with name as projectName) being appended to the target binary(dll/lib)

$
0
0

I am having MS Visual Studio 2013 projects for dll/libs for which somehow on my machine the target path for the library seems to be having an extra folder(of the name of $ProjectName) appended at the end(extra to what is mentioned in the $OutDir). The same solution/project files on other machine create the target binary at the correct desired location.

e.g. say I have $(OutDir) as "\folder1\folder2\" with $(ProjectName) asmyLib

On My machine on building the project/solution, I get the target binary created at "\folder1\folder2\myLib\myLib.dll"

While on all other machines the lib is correctly being created at "\folder1\folder2\myLib.dll" (no extra folder with the $ProjectName (heremylib) being created).

I have looked for the project and solution files in text editor looking for anything obvious being the cause, but couldn't notice any discrepancy, nor do I see any difference in the solution/project files using windiff when compared to these files on other machines. 

Can someone please help me with - what could be the cause of the issue here or How to go about troubleshooting it further ?

Thanks.

 

AAryaman

Viewing all 2763 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>