40 questions
0
votes
1
answer
47
views
Prevent VSTO .msi installation if Word is running (check winword.exe)
I'm developing a VSTO add-in for Microsoft Word and packaging it using a .msi installer (Visual Studio Installer Project). Before proceeding with the installation, I want to ensure that Word (winword....
0
votes
1
answer
133
views
Multiple build actions per file in Visual Studio
I have a few C# (*.cs) files in my project that need to be included in compilation as well as distributed as source code along with the application (the application itself is not open-source).
...
0
votes
0
answers
397
views
.Net Maui Including large file in project
I am trying to include a large file in my project but it doesn't let me. If set the Build Action to "MauiAsset" I get the following error: "APT2000 filemap E 08-18 15:25:19 23420 8832 ...
3
votes
2
answers
486
views
How to get C# library file in output directory?
I have a solution with a few projects:
library.dll with something.json
webapp.dll
winapp.exe
2 and 3 depend on 1, not on eachother.
I would like copy something.json to the bin directory of winapp....
0
votes
1
answer
168
views
Visual Studio 2017 web deploy: wait for custom pre-build action finish
I want to use a web deploy to publish my ASP.Net Web API project along with Angular app. Angular app build is running in pre-build action, I'm using CustommCollectFiles to include \dist folder in ...
1
vote
2
answers
214
views
Which Build Action (C# Microsoft Visual Studio) is suitable for launching an .exe software which has zero or more dependents within a Windows Form?
Consider these two software: MyGame.exe and SocketTest.exe.
MyGame.exe doesn't depend on any files to run but SocketTest.exe is an actual software. It can only run if one or more of four other files ...
0
votes
1
answer
1k
views
WPF C# Reflection: Iterate over all resources with build action "Page"
I have a .dll with a lot of ResourceDictionaries.
The build action of all these ResourceDictionaries is set to "Page".
Inside the Dll, I want to find all these ResourceDictionaries and iterate over ...
0
votes
0
answers
704
views
C# files Build Action = Content and Copy to Output = Copy Always being copied on Build but deleted on Run
I have some files setup to copy to the output directory on build. When I do a build the files are copied as expected. If I check the build log I can see the file being moves from the specific project ...
0
votes
1
answer
3k
views
What does it mean that a DLL is flagged as "incorrectly specified as a file" in my C# project?
I get this warning in a C# project:
Assembly 'bin\DAL05.dll' is incorrectly specified as a file.
The project does reference DAL05, which has these values:
Description = "Data Access Layer for VS2005"...
5
votes
1
answer
1k
views
How to minify JavaScript files that have changed (and only them) when building (aka duplicate items after adding "ItemGroup" to csproj)
I've added the following code to my .csproj in order to minify the JS files that have changed when building the project:
<Target Name="BeforeBuild">
<MSBuild Targets="CheckAndMinifyJS" ...
3
votes
2
answers
2k
views
How can I open a file I've added to my Windows Store App project programatically?
I want to load a PDF file in response to a Tapped event.
I added the file to my project (Add > Existing Item), set "Build Action" to "Content" and "Copy to Output Directory" to "Copy if newer"
I'm ...
48
votes
4
answers
44k
views
What is Content Build Action in Visual Studio?
What does the Content Build Action in Visual Studio do? It does not look like it's doing anything.
The File Properties article on MSDN (does not exist anymore) says:
Content - The file is not ...
2
votes
2
answers
9k
views
How come my Windows Service cannot access a folder with files in them?
I have setup a Console, Library, and Service project. The Library project loads up files in a folder and stores the text in variables.
The console project will then manipulate those variables. I am ...
4
votes
1
answer
619
views
Visual Studio 2012 - How to assign multiple build actions to a TypeScript file
I am using Visual Studio 2012 to create a class library project that will also include a number of TypeScript (.ts) files, as well as their generated .js and .js.map files. All of these files need to ...
0
votes
0
answers
156
views
phonegap windows phone copy existing www over?
I have created a phonegap windows phone project, did the install and setup. It runs fine with the demo/default code when I run the emulator.
I have an existing android project. I drag my www folder to ...
0
votes
2
answers
2k
views
Cannot load resource dictionary with converter
Everything happens within the same VS project. I have a resource dictionary file living on it's own. When I try to load it programmatically I get the error
"Cannot create unknown type '{clr-...
0
votes
1
answer
595
views
WPF and WinRT Image Source using Content Build Action
I have a WinRT application and a .NET application which want to share images. I have been using portable class library and want to share as much code as possible. I also want to have only one copy of ...
4
votes
1
answer
2k
views
Any issues setting MVC 3 rc1 Razor cshtml file Build Action to Compile?
The default build action has been changed from "None" to "Content", as I understand to support Visual Studio publish/deploy.
For a particular project, I do not use the Visual Studio publish/deploy ...
37
votes
8
answers
57k
views
Error "A namespace does not directly contain members such as fields or methods"
I'm trying to build my C# project and I'm getting the error message "A namespace does not directly contain members such as fields or methods". It is flagging the first character (the less than symbol)...
0
votes
6
answers
3k
views
Custom Namespace on .NET web app
So I wrote some custom classes and put them all in a namespace, call it "Sphere".
On my aspx.cs codebehind file, I have "using Sphere;" written. I know that this works because it's always worked ...