Visual Studio WPF Project build Output path - wpf

I have a Solution that contain 3 projects.
1 Windows application and 2 class library.
Folder structure tree on my disc is as following:
\projects\CurrentProject\test\
\projects\CurrentProject\build\
The solution files are located under:
/projects/CurrentProject/
All 3 projects are located at \projects\CurrentProject\test\
I need all the build outputs of all projects (1.exe and 2 dlls) to be under \projects\CurrentProject\build\ ...
So on each project, i go to "project properties", select on both debug/release the output path to be: "....\build", but still after doing so, i have files on /obj of the class library projects.
Why is this ?
Thanks

To move your obj folder elsewhere your can customize your build configuration using the BaseIntermediateOutputPath property in the project file (the .csproj file).
To do it:
Open the .csproj file in a text editor (the .csproj file is an XML file)
Edit the value of the element BaseIntermediateOutputPath or add it in the desired PropertyGroup. (The line to modify or to add looks like <BaseIntermediateOutputPath>..\build\obj</BaseIntermediateOutputPath>)
Save the file
Reopen your project in Visual Studio.

Related

Not Seeing <prijectname>csproj file in .net core project directory

csproj file is missing in solution file .
FYI : I am using VS 2019
WebApplication9 is a csproj file, Check it out from View ->and tik mark Filename extensions ,So that you will be able to see the extension

tizen delta and project files

What does the xml .project and .cproject file contains ?
.rds_delta is a file which contains data like
#delete
.delta.lst
#add
#modify
author-signature.xml
signature1.xml
what is it's purpose?
There is another file .sdk_delta.info what does this contains
I would like to know the consequences of change in these file (each of these files).
You typically wouldn't change any of these files manually.
The .project file contains general settings for your project. Eclipse settings, whether the project is linked to another project, etc.
The .cproject contains C/C++-specific settings for your project. Build paths, build flags, which compiler to use, etc.

File cannot be found when relative path is used

In my WPF caliburn.micro application, I use ComponentOne's C1DocumentViewer to display a report.
I created in the project a new Folder “Reports” and placed the .xml there. I show the report using C1DocumentViewer. When provide the absolute path to the .xml file, it works fine. But of course I need to use a relative path. So if I make it “../../MyProject/Reports/MyReport.xml”, it works on my machine when I run it in Visual Studio. But not when I publish it using ClickOnce, it just cannot find the file. Same thing if I use “/Reports/MyReport.xml” or “Reports/MyReport.xml”.
When I try to use “Reports/MyReport.xml” when I debug in Visual Studio, it is looking for the path “Reports/MyReport.xml” in bin/Debug of the main project of the solution.
Please help. Here is my code:
protected override void OnViewLoaded(object view)
{
base.OnViewLoaded(view);
var rpt = new C1.C1Report.C1Report();
rpt.Load(#"Reports/MyReport.xml", "Recent Files Information");
rpt.DataSource.RecordSource = "MyReportProc(1)";
rpt.Render();
Report = rpt.FixedDocumentSequence;
}
Just a guess. Your problem might be related to the working directory of your process.
When the process refers to a file using a simple file name or relative
path (as opposed to a file designated by a full path from a root
directory), the reference is interpreted relative to the current
working directory of the process.
Check it with Directory.GetCurrentDirectory() when you run your program in Visual Studio and also when you run it after publishing it with ClickOnce.

How does Locbaml work?

I created a WPF test project, single Window with a single button in it. I then unloaded the project and modified the csproj to contain the following <UICulture>en-US</UICulture>. After rebuilding the build folder now contains a subfolder named en-US and it contains a file called WpfLocalizationTest.resources.dll. All clear so far.
Then I downloaded the source code for Locbaml and built it. (Couldn't find a binary download anywhere, go figure.)
Then I copied the Locbaml.exe to the en-US folder and tried the following.
locbaml /parse WpfLocalizationTest.resources.dll /out:test.csv
This results in an error 'Could not load file or assembly WpfLocalizationTest.resources.dll or one of its dependencies. An attempt was made to load a program with an incorrect format.'
In the obj\x86\Debug folder there's a file called WpfLocalizationTest.g.en-US.resources. I tried running locbaml on that, but the result was the same.
How is locbaml supposed to be used? MSDN is full of cockamamie samples, none of which work. Is locbaml really how Microsoft intends WPF apps to be localized? Or have they come up with proper tools for the job?
As I continue to search I found another link here on Stackoverflow. The compile errors we were originally receiving were related to an outdated LocBaml project not being set for .Net4.0. This is why I was unable to generate teh CSV from the DLL and had to go straight at the resource file. Follow this link for more details. Locbaml localization of .net wpf4 application
This link provides a link to .net 4 binaries which once compilied allow you to go straight at the dll to generate the CSV using LocBaml.
Just an update I pulled my notes this morning. Hopefully this will help get you a bit further along.
Once the project has been compiled copy the LocBaml.exe to the project directory where the build has been generated : In my instance I copied the file to E:\localiztion_sample\localiztion_sample\obj\x86\Release
This is the tricky part in that the build did not contain all the DLL files from the bin directory (telerik controls and other assemblies). As a result I went to bin\release\ and copied all the DLL and resource files from there into the obj\x86\Release directory. For files where I was prompted to overwrite I looked to see if there was a difference in filesize or date created and if not I skipped the copy for these objects.
NOTE: In order for me to generate the CSV I had to copy dll and resource files from the bin directory and place them in the obj directory. Omitting this step will result in the CSV file being created but not populated with data.
Once you have copied the necessary files to the directory you will then parse the .resource file located within the Release directory.
In my project the resource file was located at:
E:\localiztion_sample\localiztion_sample\obj\x86\Release
And the file name was titled: localiztion_sample.g.en-US.resources
Note: this is different from the instruction on the Microsoft website. Microsoft states that you should run the LocBaml tool on the dll file located within the en-US directory. However after multiple attempts and research I found that this in fact caused a number of problems with compatibility between 32 and 64-bit builds as well as it just flat out not working.
In reading through wpf4 unleashed as well as online forums it is suggested to instead point to the *.gen.en-Us.resources file. * = the project name and gen.en-Us reflects the development language chosen
Within the VS command untility you will then need to enter the following
LocBaml /parse filename.resources /out: sample-en.csv
Notes: It is assumed that you have copied the LocBaml file to the root directory where this file exists and that you are running the command prompt as system administrator. For ease of use I changed the working directory within the command prompt to the VS project directory
For my sample project the command looked as:
*LocBaml /parse localization_sample.g.en-US.resources /out: sample-en.csv*
This command then generates the CSV file which acts as a definition of the current project
This was as far as I got I was able to modify teh file and regenerate the dll but I was not able to get the culture to change within the application so I am still working on this piece. I'll reposte once I get it working.
1) Unload project you want to localise
2) Edit Project .cproj file
3) Add property group at the end of the last property group
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
en-GB
4) Reload project and compile this would create a satellite assembly "yourlibrary.resources.dll" inside en-GB folder at bin\debug location, this assembly would be the default assembly.
5) Open Properties\AssemblyInfo.cs file and uncomment this line [assembly: NeutralResourcesLanguage("en-GB", UltimateResourceFallbackLocation.Satellite)] this is a fallback satellite assembly. And we need this entry otherwise for wpf application it throws exception around app.xaml.cs couldn't load
6) From command prompt run this command which uses msbuild to generate UID C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild /t:updateuid . \yourlibrary.csproj, open xaml file and check your controls there would be UID on all elements.
7) Download locabaml.exe source code tool from https://github.com/JeremyDurnell/locbaml
8) Copy locabaml.exe file to the \yourprojectname\bin\debug folder
9) we would now create an satellite assembly for french. First we need to parse the default satellite assembly and write out the contents to a csv file as shown here
10:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild /parse C:\yourprojectname\bin\Debug\yourlibrary.resources.dll /out:C:\yourprojectname\bin\Debug\yourlibrary.resources_FR.csv
11) Open yourlibrary.resources_FR.csv make necessary translations
12) Now we need to create a satellite assembly in french using command line
13) C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild /generate C:\yourprojectname\bin\Debug\yourlibrary.Resources.dll /trans: C:\yourprojectname\bin\Debug\yourlibrary.resources_FR.csv /out:C:\yourporjectname\bin\Debug\temp /cul:fr-FR
14) The command above would create a folder fr-FR at \bin\debug location
15) Switch your computer region settings to french(France)
16) In the code set localisation to Thread.CurrentThread.CurrentCulture = CultureInfo.CurrentCulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;
17) Compile and run application you would see translated text on the controls

Creating Silverlight 3 applications with F#

Is there an easy way to create Silverlight 3 applications with F# (October CTP)?
I have seen the F# for Silverlight, but that only works with the May CTP.
I am using Visual Studio Integrated Shell 2008.
It is possible to use the May CTP templates with the October CTP version of F#
Create your new project, then unload it and edit the hint path for the FSharp.Core.dll to point to the October CTP,
<HintPath>$(ProgramFiles)\fsharp-1.9.7.8\Silverlight\2.0\bin\FSharp.Core.dll</HintPath>
then reload the project and build.
You do have to package the .xap file manually by e.g. using the chiron tool (or just zipping and renaming)
The AppManifest.xaml file looks like
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
RuntimeVersion="3.0.40818.0"
EntryPointAssembly="astroclock-fs"
EntryPointType="astroclock.fs.MyApp">
<Deployment.Parts>
<AssemblyPart x:Name="astroclock-fs" Source="astroclock-fs.dll" />
<AssemblyPart x:Name="FSharp.Core" Source="FSharp.Core.dll" />
</Deployment.Parts>
</Deployment>
where you fill in your own assembly name and entrypoint instead of mine
Create a folder in $(ProjectDir) to hold all the files to be packaged and copy C:\Program Files\FSharp-1.9.7.8\Silverlight\2.0\bin\FSharp.Core.dll into it, along with the AppManifest.xaml above
Create an empty file null.py in the folder to keep chiron quiet if you are using that tool
Add the following post-build steps
cd $(ProjectDir)
copy /y $(OutDir)$(TargetFileName) [your directory with all the output]
"C:\Program Files\IronPython 2.0\Silverlight\bin\chiron.exe" /d:[your directory with all the output] /z:app.xap
Create a test page to load app.xap
Build project
Load page in browser and enjoy
ADDED
You can make a permanent fix for the hint path needed to find FSharp.Core.dll by editing the template in C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplatesCache\FSharp\Silverlight\SilverlightLibrary3.zip\SilverlightLibrary.fsproj (and probably the version of the file in C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\FSharp\Silverlight\SilverlightLibrary3.zip just to be certain).
And a working proof of concept (source and everything bundled into the xap) here.
Looks like I got to wait for VS 2010.

Resources