Skip .rdlc file compiling on build - visual-studio-2013

I'm using VS 2013 Express. I have a legacy project that uses .rdlc files loaded during runtime. They are stored in ..\Reports directory. These files have some custom code and reference external modules. When I build the project with these files property [Build Action] = "None", there is no issue and they are correctly loaded and displayed during runtime.
Problem starts when I need to publish the project as a ClickOnce app. To include .rdlc files in ClickOnce, I have to change their [Build Action] = "Content". After this, VS starts to spellcheck .rldc files and gives me a bunch of errors I don't care about, since I know that at the runtime when those files are loaded these errors do not occur.
How can I tell VS to include these files as a content without the spellcheck on build?
Just for info - the errors i'm getting are
"Error while loading code module"
and
"<Namespace-name> cannot be resolved"
in the custom code. None of these are an issue during runtime

Related

Why is Visual Studio 2022 building my project in Release build when settings are set for Debug build?

I am trying to debug an assembly in a web project. The web project has a reference to the assembly. I have the code for the assembly. I have set the assembly project whose target framework is .Net Standatd 2.0 to Debug build as shown below.
I copied the generated .dll and .pdb files to the \bin\debug\net50 folder of the web project (targets .NET 5.0). During debugging the web project, I noticed in the modules window that Visual Studio loaded the assembly as Optimized and Skipped loading symbols. The dll and .pdb files have the same timestamps. I am not sure why the assembly's symbols are not being loaded.
Then I used this Assembly Information tool and it showed the dll as Release and optimized. So that explains why VS is loading it as such?
My question is why is it being built as Release and optimized?
My goal is getting VS to load it where I can set breakpoints and single step through the assembly code.
There was an Optimize property set to true in the csproj file. Changed it to false.

How do I make MSBuild work with a UWP solution generated from a Unity3D project?

So I'm trying to automate the process for building a packaged app from a Unity project and I've hit a roadblock when trying to use MSBuild to build the final app packages.
In Unity, when you build for UWP, a folder /UWP/ is generated for the project. These contain csharp projects for two .dlls that are required to build the uwp app.
For me, these dlls got generated in a folder for each platform (x86,x64, and ARM), but this is where I hit the roadblock. To build the app packages I use MSBuild(I've also tried with the Developer Command Prompt - same result) with the command.
MSBuild "{Project}.csproj" /p:Configuration=Debug;AppxBundle=Always;AppxBundlePlatforms="x64";OutputPath="AppxPackages"
This throws the error
"C:\Users\{User}\Desktop\Output\{Project}\{Project}.csproj" (default target) (1) ->
(BeforeResolveReferences target) ->
C:\Users\{User}\Desktop\Output\{Project}\{Project}.csproj(319,5): error MSB3030: Could not copy the file "{path-to-unity-project}\UWP\Assembly-CSharp\bin\AnyCPU\Debug\Unprocessed\Assembly-CSharp.dll" because it was not found.
What is happening here is that MSBuild is attempting to find a dll in a folder "AnyCPU" that simply does not exist.
Is there any way I could tell MSBuild to individually build each platform rather than look for a combined dll, or am I using MSBuild incorrectly?
Even though I was unable to figure out why the Debug configuration looks for an assembly in the wrong directory, thanks to #Leo-MSFT I was able to fix the error that was occurring.
Firstly, I was calling MSBuild on the game project, this needed to be the generated solution instead.
Secondly, instead of using the Debug configuration, I used the Release configuration.
And finally, I was confused by the contents generated by the build compared to a build from Visual Studio (Right Click->Store->Create App Packages...). While VS generates an .appxbundle, using MSBuild will generate individually for each of the platforms selected such as game_x64.appx, game_ARM.appx, and a few more.
You can create the bundle yourself by using the makeappx tool.

Why is VSIX attempting to load random files as assemblies?

In short: When building a VSIX project In Visual Studio 2015, the build process is attempting to load random files (such as icons, .config files, .targets file) as if they were .Net assemblies.
I am attempting to build a VSIX project that includes a referenced project template and a embedded wizard assembly. I've done the exact same thing previously with success, following the steps described at How to: Use Wizards with Project Templates.
This time, however, when I attempt to build the VSIX project I get bizarre errors such as the following:
Could not determine the FullName of the Assembly at "C:\Source\VSTS\Toolkits\v7\Web.Site\v7.2\packages\Microsoft.Net.Compilers.1.3.2\tools\csc.exe.config". Could not load file or assembly 'csc.exe.config' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Note, the compiler is trying to load a config file as if it were an assembly. In fact, I first got this error when it was attempting to load the icon file for the VSIX...as if it were an assembly. If I rename or remove the file in the error message and rebuild I just get the same error but with the next random not-an-assembly file that the compiler encounters.
Why is the compiler attempting to load random files as if they were assemblies? How can I make it stop so that I can actually build my VSIX project?
More info:
This error is thrown by the DetokenizeVsizManifestSource build step defined in Microsoft.VsSDK.targets:
<DetokenizeVsixManifestSource
InputFile="#(SourceVsixManifest)"
OutputFile="$(IntermediateVsixManifest)"
ResolvedReferences="#(_VsixManifestResolvedReferences)">
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</DetokenizeVsixManifestSource>
I had the same problem. It seems you can't add add an applciation to a VSIX. You need the project to output a dll and attach that.
If you need to attach an application try to do so as File not as Project.

TypeScript compilation outside of project created with Visual Studio

I have inherited a large LOB application that is built using TypeScript. The project has no reference paths in any of the files due to the fact it has been setup and created using Visual Studio 2013 - Visual Studio seems to have some magic where it will pick up the global TypeMaps itself. scoff.
The current build process has been to use Grunt to copy the compiled .js files (which are generated on save in Visual Studio) to a build directory - not actually compile them.
(to further reinforce this point, Grunt is NOT compiling any TypeScript).
This build process is now no longer acceptable as I am moving the application to a build through a Continuous Integration process, using Team City and Command Line tsc.exe/Grunt - so when the repository is checked out there are obviously no generated .js files in the project.
In its current state there is a host of compilation errors when trying to use Command Line tsc.exe/Grunt to compile the TypeScript files, I think due to the fact that the application is not using reference paths?
Does this mean I'm going to need to add all of the relevant reference paths to each file in the project?
Has anyone got any experience regarding this kind of setup and could point me in the right direction to manage these reference paths and build process?
Thanks
In its current state there is a host of compilation errors when trying to use Command Line tsc.exe/Grunt to compile the TypeScript files, I think due to the fact that the application is not using reference paths
No. You should use a tsconfig.json which will create the compilation context.
More
https://basarat.gitbooks.io/typescript/content/docs/project/project.html
A solution has been found.
Using the Visual Studio configuration options in the grunt-ts task I have setup the task to specifically use the projects .csprog and TypeScript 1.4 compiler (we are locked into this compiler).
My configuration for the grunt-ts task:
ts: {
default: {
vs: "Consortium.Client.Web.csproj",
options: {
compiler: "1.4/tsc"
}
}
}
I hope on the off chance, this helps someone else.

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 be included in the assembly as embedded resources, so that they can be exposed to a consuming ASP.NET MVC application via a custom VirtualPathProvider.
Note: although only the generated JavaScript files are essential for the production environment, the .ts and .js.map files must also be accessible to the web application, for debugging.
This presents a conflict, since TypeScript files are usually assigned the TypeScriptCompile build action but I also need them to be assigned EmbeddedResource.
Is there any way to assign multiple build actions to a VisualStudio project component? Alternatively, is there another way to get TypeScript to compile files that are not explicitly marked as TypeScriptCompile or to get Visual Studio to embed files that are not marked as EmbeddedResource?
Thanks for your suggestions,
Tim
If you had a TypeScript file that referenced all of the others, only it would need to have the TypeScriptCompile type as the compiler should walk all the dependencies and compile all the rest too.
So creating a file that acts as the compilation target and that references all of your other files might allow you to change all the rest to EmbeddedResource.

Resources