Quantcast
Channel: Visual Studio General Questions forum
Viewing all 21115 articles
Browse latest View live

Visual Studio 2017: Display the title of a UWP application containing a NavigationView and an acrylic design extended to the title bar

$
0
0

Hello,

My UWP app has a NavigationView and uses Fluent Design with extended acrylic in the title bar.

So you have to draw the application title yourself, which normally appears automatically in the title bar, with a TextBlock control using CaptionTextBlockStyle. I tried to apply the example provided by Microsoft here.

But unfortunately this example does not take into account the extended acrylic in the title bar. Below the modified XAML code:

<Page
    x:Class="MesProjets.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MesProjets"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="using:Microsoft.UI.Xaml.Controls"
    mc:Ignorable="d"><Page.Resources><ImageBrush x:Key="imagefond" 
                    ImageSource="/Assets/Images/Wallpaper.png"
                    Stretch="UniformToFill"/><Style TargetType="NavigationView"><Setter Property="Foreground" Value="White" /></Style></Page.Resources><Grid ><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="*"/></Grid.RowDefinitions><Grid.Resources><AcrylicBrush x:Key="NavigationViewDefaultPaneBackground"
                  BackgroundSource="HostBackdrop"
                  TintColor="DarkOliveGreen"
                  TintOpacity="0.6"
                  FallbackColor="DarkGray"/><AcrylicBrush x:Key="NavigationViewExpandedPaneBackground"
                  BackgroundSource="HostBackdrop"
                  TintColor="DarkOliveGreen"
                  TintOpacity="0.6"
                  FallbackColor="DarkGray"/><SolidColorBrush x:Key="NavigationViewItemForeground" Color="White"/><SolidColorBrush x:Key="NavigationViewItemForegroundPointerOver" Color="White"/><SolidColorBrush x:Key="NavigationViewItemForegroundSelected" Color="GreenYellow"/><SolidColorBrush x:Key="NavigationViewItemForegroundSelectedPointerOver" Color="White"/><SolidColorBrush x:Key="NavigationViewItemForegroundPressed" Color="GreenYellow"/></Grid.Resources><Grid x:Name="AppTitleBar" Background="Transparent"><!--Width of the padding columns is set in LayoutMetricsChanged handler. 
             Using padding columns instead of Margin ensures that the background
         paints the area under the caption control buttons (for transparent buttons).--> <Grid.ColumnDefinitions><ColumnDefinition x:Name="LeftPaddingColumn" Width="0"/><ColumnDefinition/></Grid.ColumnDefinitions><TextBlock Text="Mes Projets" 
               Grid.Column="1" 
               Style="{StaticResource CaptionTextBlockStyle}" 
               Margin="10,0,0,0"/></Grid><NavigationView x:Name="NavViewMain"
                        PaneTitle="  Mes Projets"
                        Margin="0,0,0,0" Grid.Row="1" 
                        Loaded="NavViewMain_Loaded"
                        SelectionChanged="NavViewMain_SelectionChanged"
                        ItemInvoked="NavViewMain_ItemInvoked"
                        CompactModeThresholdWidth="0"
                        ExpandedModeThresholdWidth="1000"
                        OpenPaneLength="250"
                        FontSize="24"
                        IsSettingsVisible="{Binding ElementName=settingsCheck,Path=IsChecked}" IsTabStop="False"
                        IsBackButtonVisible="Collapsed"><NavigationView.HeaderTemplate><DataTemplate><TextBlock  x:Name="appTitle" 
                                    Style="{StaticResource TitleTextBlockStyle}"
                                    Grid.Column="1"
                                    FontSize="28"
                                    VerticalAlignment="Top"
                                    x:Uid="MainPageTitre"/></DataTemplate></NavigationView.HeaderTemplate><NavigationView.MenuItems><NavigationViewItem Icon="Library" Tag="ListeProjets_Page" ><TextBlock Tag="Nav_ListeProjets" x:Uid="NVItem1" /></NavigationViewItem><NavigationViewItem Icon="Library" Tag="ProjetsPrevus_Page" ><TextBlock Tag="Nav_ProjetsPrevus" x:Uid="NVItem2" /></NavigationViewItem><NavigationViewItem Icon="Library" Tag="ProjetsEnCours_Page" ><TextBlock Tag="Nav_ProjetsEnCours" x:Uid="NVItem3" /></NavigationViewItem><NavigationViewItem Icon="Library" Tag="ProjetsRealises_Page" ><TextBlock Tag="Nav_ProjetsRealises" x:Uid="NVItem4" /></NavigationViewItem><NavigationViewItemSeparator/><NavigationViewItem Icon="XboxOneConsole" Tag="ListeMonnaies_Page" ><TextBlock Tag="Nav_ListeMonnaies" x:Uid="NVItem5" /></NavigationViewItem><NavigationViewItem Icon="Save" Tag="Backup_Page" ><TextBlock Tag="Nav_Backup" x:Uid="NVItem6" /></NavigationViewItem><NavigationViewItem Icon="Help" Tag="Aide_Page" ><TextBlock Tag="Nav_Aide" x:Uid="NVItem7" /></NavigationViewItem></NavigationView.MenuItems><Frame x:Name="contentFrame"></Frame></NavigationView></Grid></Page>

The result is that the title of the application appears in the upper left, but in a title bar that should not normally exist.

How do I get the same result we have with the Calendar app?

Thanks to whoever can help me.


VS is killing me

$
0
0
I've used Visual Studio for over ten years in its various iterations.  I installed VS 2019 to use for developing SSRS reports--nothing big or complicated here.  I was completely blindsided by VS 2019 destroying my home version of Windows 10.  This happened after update 16.4.  Before that, no problem and I should have ignored their obnoxious nag that tells me to update every time I open the IDE.  After the update and a reboot, Windows wouldn't come up and instead went into the infamous Windows 10 Automatic Repair loop.  After going through the various options to troubleshoot and repair, I ultimately got the dreaded damaged beyond repair message.  The laptop went to the shop since I didn't have a bootup disk I could use to reformat the hard drive and start over again.  Nice, huh?  Now, afraid to use VS 2019, I installed VS 2017 which I've used previously.  When I try to load an SSRS solution I just created, I get an "incompatible" message and another message that says the application is not installed.  I have done nothing between the last time I closed the solution and trying to open a couple of hours later.  With a fresh Windows 10 installation, there isn't a bunch of software that could corrupt an SSRS solution.  Basically, I am frustrated beyond words at what looks like really bad software since I can't think of any other company that puts out software that can easily corrupt an OS and continue to act like like it doesn't want to work.  

WPF: Vector images don't persist in xaml designer

$
0
0

I've started a WPF project and successfully added a couple of vector images. I'll add those images as static resources in Xaml and they work, however, if I navigate away or start typing in a way that makes IntelliSense have to refresh (like invalid markup), the images will no longer show.

Now if I build they are there, and I can get them to come back if I go into properties -> Common -> Source -> Green Square -> LocalResources and select it again, but it's really hard to see how the layout looks when you have to do a 5-step refresh on every image all the time.

Is there a setting for this I'm missing or is this a bug?

Also, I add every image as a static resource but VS will change them to dynamic resources sometimes. Is that normal?

Popper-glib on latest red hat

$
0
0

I know someone might want to tell me to ask Oracle or Redhat for that matter but they would say I should ask Mr. VS instead.

I am deploying my software to many Linux (X) flavors, locally and on clouds with VS.

It becomes a game of how fast I can take unknown instance be it LAN or WAN IP, and go through to the end.

You get to meet many interesting blocks and after you meet them once, you learn forever your lesson.

One block is the "linker dependency list" of libraries to link with on the instance. My list serves well with all X flavors. Some times it will pre exist and sometimes you just apt get or yum to have it and link to it.

Having said that, I am quite proud to have worked it out with so many distros with a face and without a face. I have entered X programming very late in the game, just this year. Before that, I have to recall my Unix days with a VAX on campus. And I must say that in 2020 any Windows programmer is also an X programmer. And while most of them suffered development directly on X, I decided to wait until VS will do it, just the way they do it now - the greatest contribution in the history of FOSS. And X my friends, is mostly faceless for most of us..as we would not spend a second using X for our productivity.

And having said all of that brings me to this particular block.....I can not link with lib popper-glib onlatest Oracle Linux which is Redhat, locally  - on OCI no problems dudes !

VS reports not found while I can see all the popper libs inside usr/lib64

If you are just a Windows programmer without active cross pollination with X, please ignore this thread.

Visual Studio Workplace Question - Can you install Visual Studio Community in more than 5 PCs if you have only 5 developers?

$
0
0

I would like some information regarding the following scenario.

A company with 5 developers,which is not an enterprise, has more than 5 computers, say, 10 computers, e.g. 7 workstations and 3 laptops. According to the Terms of Use, up to 5 developers can use Visual Studio Community to develop software for the company. While the Terms of Use are clear, there are some nuanced (in my opinion) cases, regarding which I would appreciate some clarifications.

  • The question is, can the company install Visual Studio Community on the rest of the computers, which are, nevertheless, only used occasionally (e.g. a company laptop may be used by a developer when working from home), by a total of 5 developers (hence, never more than 5 VS Community instances at the same time)? In essence, the question regarding the limit of 5 developers using Visual Studio Community is, does it matterhow many computers have Visual Studio Community installed, orhow many developers are actually using it at the same time?
  • Additionally, if this does apply to the total number of developers, instead of the total number of computers, another question would be the following scenario. Having 7 developers would entail having to use two additionallicensed Visual Studio (e.g. Professional Edition) instances. Would it be OK if 8 out of the total of 10 workstations have Visual Studio Community installed, 2 of them have thelicensed versions installed, and 2 of the 7 developers always use the licensedversions, while the rest 5 may alternate between workstations butalways use 5 Visual Studio Community instances at the same time.

I would expect the limit of 5 to apply to the total number of developers, rather than the total number of workstations, however I would definitely like to have some more authoritative opinion/confirmation on this subject.

Unable to add an event handler by clicking

$
0
0

I used to be able to click a Button or click an even property in the Properties panel to add an event handler for UWP apps.  I have not been able to do this for a few months.  I really miss this feature. 

Could anyone offer a tip on how to revive this function?


Hong

ScriptedSandbox64.exe During Debug Sessions

$
0
0

This is a follow-up post related to my development productivity while performing build/debug iterations in VS 2015 RC.  The original post is here and lists all the different VS-related components that I find seem to consume CPU or do some kind of blocking: (VS 2015 RC and productivity during build/debug iterations)

Question:
Does anyone have any thoughts on something called "ScriptedSandbox64.exe"?  If my IDE gets locked up and I kill that sucker, it can have the effect of freeing things up a bit.  But then it comes back again and never solves any long-term problems.

In order to see this process in taskmgr, you just need to create a new console application and start debugging.  You will see the process being launched during debugging.  Killing it seems to have no adverse effects that I can tell.  Ideally there would be configuration to prevent it from starting in the first place.

I'm not trying to nitpick .  Instead I am seeing latencies and I am having trouble understanding where they come from or why they are involved in launching a WPF (legacy) app from the Visual Studio debugger after making a minor edit to a code file.  Sometimes its fast and sometimes its slow.  It is extremely inconsistent and unpredictable, even when adding a new blank line to the exact same code file and launching a build/debug session.  It is a general question about Visual Studio performance and it involves the component I listed (as per a simple ProcessMonitor audit).

Thanks

  

David Beavon

How to add proper version of DLL to the project?

$
0
0

Hello folks,

Have one more strange question for you.

I use a log4net logger tool in my projects.
Packages not used, do update manually.
Tool updated and latest version is 2.0.8.0. Used build with old signing key.
Reference to the DLL in the projects was replaced by removing and adding reference. 

Studio 2015 Community did this without any problem and properties window show that proper version added.
But application begin fail on ClickOnce installation.

I review the prroject and find following:

<Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"><SpecificVersion>False</SpecificVersion><HintPath>..\log4net\v.2.0.8\log4net.dll</HintPath></Reference>

I review other projects and find references for 1.2.10.0 version of log4net. 
I was not able to replace this reference using Studio 2015 - each time I remove the DLL and add it again a wrong version are scribed in the project file.

Version 1.2.10.0 and version 1.2.12.0 of log4net.dll are in the GAC, but as far as I known this should not affect scripting a reference in the project.

Can anybody tell me how to get proper reference script in the project? 

P.S. Studio 2019 Community also installed on the system.


Sincerely, Highly skilled coding monkey.


Need to Create CI-CD Pipeline for a WPF Application

$
0
0

I need to create a CI-CD pipeline in TFS 2017(TFS is hosted on a server) for a WPF Application. WPF Application is built on Visual Studio 2017 edition & code branch is located in TFS.

A part of CI-CD, I need to first install Agent. I am new with this.

  1. So want to know, Do i need to install Agent on the server(where TFS Hosted) only or the Agent can be installed on my laptop as well?

  2. I tried install agent on the TFS Server & a default agent has been created. But then while creating build on TFS, receiving issue: "No agent found in pool Default which satisfies the specified demands: msbuild visualstudio vstest Agent.Version -gtVersion 2.115.0"

Pls. help.

cannot install visual studio, not launch vs installer

$
0
0

vs 2019 community from `https://visualstudio.microsoft.com` but the Visual Studio Installer does not run.
The Windows Installer appears very briefly and then disappears. There is no reaction.

I tried after reset PC but it is the same.
What should I do?

%temp%

[12/13/2019, 15:58:9] === Logging started: 2019/12/13 15:58:09 ===
[12/13/2019, 15:58:9] [12/13/2019, 15:58:10] --- logging level: standard ---
[12/13/2019, 15:58:10] Directory 'C:\Users\7ADE~1\AppData\Local\Temp\fa172949c1a6214dfa5c85\' has been selected for file extraction
[12/13/2019, 15:58:10] Extracting files to: C:\Users\7ADE~1\AppData\Local\Temp\fa172949c1a6214dfa5c85\
[12/13/2019, 15:58:10] Error 0x8007002a: Failed to extract all files out of box container #0.
[12/13/2019, 15:58:10] Error 0x8007002a: Failed to extract
[12/13/2019, 15:58:10] Error 0x8007013d: Failed to get error string from error: 0x8007002a
[12/13/2019, 15:58:10] The entire Box execution exiting with result code: 0x8007002a
[12/13/2019, 15:58:10] Launched extracted application exiting with result code: 0x0
[12/13/2019, 15:58:10] === Logging stopped: 2019/12/13 15:58:10 ===

How do I build a VS 2013 project in VS 2019?

$
0
0

Hi! I have a project built using VS 2013 but, now I want to use it in VS 2019...Is it possible to do so?

If yes, how?

Desktop + Cross-Platform/Mobile - Xamarin? .NET Core 3.1? Other?

$
0
0

I've been writing Java and out of the C#/.NET ecosystem for over a decade, so please pardon my ignorance as I completely missed the whole XAML/WPF/UWP era. I've been trying my best to get up to speed on current technology and best practices, but it's so different than the early days of WinForms.

I inherited two old C# applications that need to be completely re-written (way beyond refactoring). One is a desktop WPF application that is basically a graphical editor for an XML file (persists the model). The other app is a Win8.1 Metro store app that runs on a Windows Surface Pro tablet that basically renders the XML file and lets the user add data to the model/XML file. Several custom User Controls are functionally common to both apps, but with duplicate and incompatible code (WPF vs WinRT).

My goals for the re-write are:

- Use MVVM to allow unit testing of as much as possible and clean up the design.

- Have the two apps share as much code as possible. 

- The mobile app needs to run on Win10, iOS, and Android with as much shared code as possible

At first, I thought .NET 5 was going to be my savior with all the talk of it being "cross-platform". I thought it was going to support writing a WPF app and having it magically run on iOS and Android as-is, but I guess I misunderstood the press release/etc. I was thinking that I could re-write both apps using .NET Core 3.1 and when .NET 5 comes out, my apps would be cross-platform. It appears that is not the case...

It appears that I need to re-write the mobile app using Xamarin.Forms. The desktop app can still be WPF (or must it be UWP to share UI controls?). The shared code would be written in .NET Core 3.1/5, or does it require .NET Standard 2.x? 

I'm so confused. I've been reading/googling for hours and hours and still don't understand what my path forward should be. Can anyone clear up how to create a desktop app and a mobile cross-platform app (Win10, iOS, and Android) that can share code in 2020?





VS2019 best hardware in 2020

$
0
0

Hello,

I'm thinking to change my computer in 2020. So I'm looking for the best compromise for C# dev (and a bit of gaming)

On the official site, we have the minimum configuration : https://docs.microsoft.com/fr-fr/visualstudio/releases/2019/system-requirements

Some recommended are specified but not the best.

How much does VS can manage ? Is this useful to get more core with less speed (i9 vs Xeon for example) ?

How much RAM can be used by VS ?

Does Intel is still the best choice or AMD become an interesting alternative ?

I've found this benchmark with many configurations but it's not for VS :( : https://www.phoronix.com/scan.php?page=article&item=gcc-clang-2019&num=6

Thanks for feedback.

Vincent


Where is Team Explorer Tab in Visual Studio 2015?

$
0
0

I've recently installed Visual Studio 2015 Professional and cannot find the Team Explorer tab:

enter image description here

I tried to find TFS client to VS 2015, but I cannot find where I can install this software?

enter image description here

How to set environment variables for MSVC++ cl.exe compiler alongside older versions?

$
0
0

Hello I've installed MSVC++ 6.0 in my computer so it has set the environment variables.

No I've installed MSVC++ 2019 but when I go to Computer properties->advanced system settings->Environment variables

Include contains only C:\Program Files (x86)\Microsoft Visual Studio\VC98\atl\include;C:\Program Files (x86)\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files (x86)\Microsoft Visual Studio\VC98\include

and the remaining path, libs... all contains folders of MSVC++6 but not 2019.

  • I need this because sometimes I want to compile my C++20 code from CMD not from IDE.

  • I've run as administrator VsDevCmd.bat but it didn't make changes!

  • So how can I set the environment variables for visual Studio 2019? Thank you!


General Setup Issue

$
0
0

Hello,

I have just recently downloaded Visual Studio Code, only to find that I'm in over my head...

I followed the steps from "Getting Started With C++ & Minw-w64 in Visual Studio Code" from the VSCode website:

(  LINK: https://code.visualstudio.com/docs/cpp/config-mingw  )

Once completing the steps, I tried to run a simple C program: 

#include <stdio.h>
int main() {
    printf("hi");
    
    return 0;
}

Only to find out that my attempts are in vain! It could not compile due to these errors:

--------------------------------------------------------------------

> Executing task: g++ -g -o Test Test.cpp <           // Test.cpp ---> name of workspace file

g++.exe: error: Test.cpp: No such file or directory
g++.exe: fatal error: no input files
compilation terminated.
The terminal process terminated with exit code: 1

--------------------------------------------------------------------

I've tried refining the process multiple times, paying more attention as I do each step.

I've even tried to move the Test folder into the Compiler Path:  C:\\MING\bin\ and that

didn't work either. I'm not sure how to proceed. Any help will be greatly appreciated!

Change default from spaces to tabs in editor

$
0
0

I am a Visual Basic Programmer.

Every time I open a source file, it open with spaces at the
beginning of each line. I have to click on

I have tried the Tools|Options|Text Editor|Basic|Tabs

Indenting:Smart

Tab:Keep Tabs

Does anybody have any idea how to force it stay Tabs?

Python Run icon (right facing arrow) fails

$
0
0

Can't find a Python forum ... so 

Running  Win7 and Python 3.6 (32-bit) [ PTVS 15.6.18045.1-15.0] 
in VS Community 2017 Ver 15.6.0
The VS IDE‘s second line contains the Save and Save All.
To the right I see what I think is a Run right pointing arrow.
But it is linked to the Attach … command and doesn’t 
activate the Run command.
Did I do something wrong? 

Bob


Bob

Visual Studio 2019 16.4.2 - distributing .apk to Google Play gets: Too many draft releases specified.[400]

$
0
0

Using Visual Studio 2019 16.4.2, for a Xamarin Android app, after clicking the Distribute button and selecting the appropriate next UI items, the uploading process starts but then errors out with:


An error occur uploading '<appname>.apk':  Too many draft releases specified. [400]

This seems to be a new issue since this worked just 2 weeks ago.

Anyone got an idea how to resolve this ?


Karhu Koti

Your automated publishing to Google Play will stop working on December 1.

$
0
0

I have the very very latest Visual Studio 16.3.10 installed.

When I Distribute my Xamarin app via the Visual Studio UI to google play, the google site says the following:

ACTION REQUIRED: Your automated publishing to Google Play will stop working on December 1, 2019
Your app is using an old version of the Google Play Developer API. From December 1 2019, versions 1 and 2 of this API will no longer be available, and any calls to these versions will fail. Update to version 3 before this date. Learn more

Some threads that do their own custom publishing say some endpoint v2 needs to be v3.

OK, great, but since I am using Visual Studio to do all of this, what needs to change in Visual Studio to stop getting this error ?

Best regards, Karhu.



Karhu Koti

Viewing all 21115 articles
Browse latest View live


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