visual-studio

Convert all *.cs files to unicode in VisualStudio

故事扮演 提交于 2021-02-07 20:59:22
问题 My team does not pay attention to file encoding (and that is correct, because humans should not be bothered by file encodings). However some files are saved in utf8, and some in regional encoding (cp1250). I need a tool that can do two things: 1. Force utf8 on all files that will be created in future 2. Convert all existing files with given extension (or at least *.cs) to utf-8 How can I achieve these goals using Visual-Studio or Resharper plugins, and or external tools? I tried to do #2 with

Set Product Version and File Version to different numbers in C#

余生长醉 提交于 2021-02-07 20:37:39
问题 In a C++ project, I can add different Product Version and File Version values to my assembly using VERSIONINFO in a Version resource file: #define VER_PRODUCTVERSION 1,0,0,0 #define VER_PRODUCTVERSION_STR "1.0\0" #define VER_FILEVERSION 1,0,0,1 #define VER_FILEVERSION_STR "1.0.0.1\0" This appears in the DLL properties as: I'm having trouble achieving the same in a C# project. I've set the following in the AssemblyInfo.cs file: [assembly: AssemblyVersion("1.0")] [assembly: AssemblyFileVersion(

CoInitializeSecurity throws RPC_E_TOO_LATE in Visual Studio 2017

◇◆丶佛笑我妖孽 提交于 2021-02-07 19:43:35
问题 I'm trying to run an application making a call to CoInitializeSecurity at startup. This works in Visual Studio 2013, but does not work in Visual Studio 2017 - and I'm curious to why this is. When calling CoInitializeSecurity at startup in Visual Studio 2017 I get a COMException with the error code RPC_E_TOO_LATE (0x80010119) which indicates a call has already been made to CoInitialize , this does not happen in Visual Studio 2013. I have seen this behaviour before in Visual Studio 2013 when

What files are mandatory in release windows form?

一世执手 提交于 2021-02-07 14:55:24
问题 I have files in ...bin/release where is my windows form application, I have used EEPlus library as well. What the files do I need to send to client to have application work correctly? My files: name.exe name.exe.config name.pdb name.vshost.exe name.vshost.exe.config name.vshost.exe.manifest EEPlus.dll EEPlus.xml I know that first two are mandatory, but what about all rest? thanks in advance 回答1: name.exe //necessary, it is your main executable name.exe.config //necessary, it is your

How avoid *.<Environment>.config transformations being deployed on server

孤人 提交于 2021-02-07 14:54:56
问题 I'm using VSTS to deploy at several environments. And as usual, some parameters on config files need to be different depending the environment, hence I will use config transformations to deploy it at the target environment. Since I want to have the package with both the config and the transform that will be applied later I set the Build Action as Content as such: <Content Include="App_Config\MyConfig.config" /> <Compile Include="App_Config\MyConfig.prod.config"> <DependentUpon>MyConfig.config

How to select an older compiler in Microsoft Visual C++ 2019?

冷暖自知 提交于 2021-02-07 14:41:52
问题 As written here, under "Project Settings" I should be able to specify the compiler to be used for the current project. However, I cannot find this menu entry in Visual Studio 2019. I have both Visual C++ 2019 and 2013, and would like to use the new IDE with the old compiler. How can I do it? Is it possible to do it with the "Community" editions? 回答1: Here are the official instructions, taken from this page: In Visual Studio, in Solution Explorer, open the shortcut menu for your project ( not

How to select an older compiler in Microsoft Visual C++ 2019?

蓝咒 提交于 2021-02-07 14:40:48
问题 As written here, under "Project Settings" I should be able to specify the compiler to be used for the current project. However, I cannot find this menu entry in Visual Studio 2019. I have both Visual C++ 2019 and 2013, and would like to use the new IDE with the old compiler. How can I do it? Is it possible to do it with the "Community" editions? 回答1: Here are the official instructions, taken from this page: In Visual Studio, in Solution Explorer, open the shortcut menu for your project ( not

How to select an older compiler in Microsoft Visual C++ 2019?

半世苍凉 提交于 2021-02-07 14:39:24
问题 As written here, under "Project Settings" I should be able to specify the compiler to be used for the current project. However, I cannot find this menu entry in Visual Studio 2019. I have both Visual C++ 2019 and 2013, and would like to use the new IDE with the old compiler. How can I do it? Is it possible to do it with the "Community" editions? 回答1: Here are the official instructions, taken from this page: In Visual Studio, in Solution Explorer, open the shortcut menu for your project ( not

How to determine at runtime when your C++ application has the visual studio debugger attached?

我的未来我决定 提交于 2021-02-07 14:28:34
问题 How do you determine at runtime whether the visual studio debugger is attached to your process. I've seen instructions for how to do this in .NET, but my process is a native C++ process. Support for detecting Just-in-time debugging would be nice but not a strict requirement. 回答1: The Win32 call IsDebuggerPresent() sounds like it ought to work. 回答2: Use IsDebuggerPresent 来源: https://stackoverflow.com/questions/2789390/how-to-determine-at-runtime-when-your-c-application-has-the-visual-studio

How can I get IWpfTextView for EnvDte.ActiveDocument?

China☆狼群 提交于 2021-02-07 14:24:31
问题 I am trying to manipulate the Visual Studio Text Editor scrollbar values. The problem is that I have only the dte.ActiveDocument and it is not possible to do it from there. My extension is loaded only once when VS starts and I capture dte.Events.CommandEvents. At some point I want to change the scrollbar values for the ActiveDocument. To do this I need IWpfTextView or ITextView. Do you have any idea how can I get an instance of that object? internal class MyExtension { private CommandEvents