When compiling WPF application language folders are copied to build folder - c#

How can I cancel this option (I need only English).
Is it some installation that should be removed? configuration?
folders created are: de, en, es, fr, it, ja, ko, zh-Hans zh-Hant
Working with Visual Studio 2015
references:
System.Windows.Interactivity
Microsoft.Expression.Interactions

I added this in my "post build event command line" which is a bit shorter than the example by Dr. C. Hilarius.
rd /s /q "de" "en" "es" "fr" "hu" "it" "ja" "ko" "pr-br" "ro" "pt-br" "ru" "sv" "zh-hans" "zh-hant"

None of the suggestions worked for me.
Instead, I added post build events to remove the offending directories:
RMDIR "$(TargetDir)de/" /S /Q
RMDIR "$(TargetDir)es/" /S /Q
RMDIR "$(TargetDir)fr/" /S /Q
RMDIR "$(TargetDir)it/" /S /Q
RMDIR "$(TargetDir)ja/" /S /Q
RMDIR "$(TargetDir)ko/" /S /Q
RMDIR "$(TargetDir)ru/" /S /Q
RMDIR "$(TargetDir)zh-Hans/" /S /Q
RMDIR "$(TargetDir)zh-Hant/" /S /Q

Turning my comment as an answer:
The issue may come from C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries which contains localizable objects for build. If you delete it (keep a backup to be sure) it should solve your issue.

In The case of linking in ZedGraph into your project, simply go to the path where ZedGraph is installed (being referenced from). Delete all the unwanted folders from this location, then go back and rebuild your project. Don't forget to delete all the unwanted folders in your projects output folder so you can verify the rebuild indeed does not recreate the unwanted folders.

Related

the command xcopy exited with code 9009 visual studio 2017 [duplicate]

This question already has answers here:
What does "exited with code 9009" mean during this build?
(36 answers)
Closed 3 years ago.
I setup project from git. but when i build solution I got an error "the command xcopy... exited with code 9009. I did not find any solution.
below are the commands by default in Post build event command line:-
xcopy "$(ProjectDir)bin\$(TargetFileName)" "$(SolutionDir)..\Educate\bin\" /s /i /y
xcopy "$(ProjectDir)bin\$(TargetFileName)" "$(SolutionDir)..\PlayList\bin\" /s /i /y
xcopy "$(ProjectDir)bin\$(TargetFileName)" "$(SolutionDir)..\EducateFHCRC\FredHutch\FredHutch\bin\" /s /i /y
xcopy "$(ProjectDir)bin\$(TargetFileName)" "$(SolutionDir)..\EducateFHCRC\FredHutch\FredHutch.Domain\bin\" /s /i /y
This is the full error:-
Error The command "xcopy "D:\Projects\Educate\EmpowerLearn\EducateAssessment\bin\EducateAssessment.dll" "D:\Projects\Educate\EmpowerLearn\EducateAssessment\..\Educate\bin\" /s /i /y
xcopy "D:\Projects\Educate\EmpowerLearn\EducateAssessment\bin\EducateAssessment.dll" "D:\Projects\Educate\EmpowerLearn\EducateAssessment..\PlayList\bin\" /s /i /y
xcopy "D:\Projects\Educate\EmpowerLearn\EducateAssessment\bin\EducateAssessment.dll" "D:\Projects\Educate\EmpowerLearn\EducateAssessment..\EducateFHCRC\FredHutch\FredHutch\bin\" /s /i /y
xcopy "D:\Projects\Educate\EmpowerLearn\EducateAssessment\bin\EducateAssessment.dll" "D:\Projects\Educate\EmpowerLearn\EducateAssessment..\EducateFHCRC\FredHutch\FredHutch.Domain\bin\" /s /i /y" exited with code 9009. EducateAssessment
You should try restarting Visual Stutio. Worked for me.
Maybe your path is incorrect, it should be something like this :
C:\Program Files (x86)\Bad Vendor\Buggy Program;
Or is just that a DLL file is missing. To see, run the same command line in CMD and see the output. DLL's are easy to download, from here : https://www.dll-files.com/
More info on this thread : Why does xcopy exit with code 9009 in Visual Studio post-build step?
The 'xcopy' executable can't be found. Check your PATH variable for 'C:\Windows\System32\' - if this not exists, add this at the front of PATH.

Huge package directory .NET solution

I developed an asp.net mvc application to manage some business process in our organisation. This application use the following main frameworks :
Asp.NET MVC 5.0;
Entity framework 6.0 to manage db access;
MS Identity 2.0 to manage security : users, roles, access authorizations...;
Bootstrap;
I noticed that the packages directory of this solution has become very huge(more than 350 MB).
I tried to use the "Remove unused packages" feature of ReShaper but it did not significantly reduce the size of the packages folder. I think that there's some unnecessary packages that must be removed.So, my questions are :
Is it normal to have a packages directory with a size more than 350 MB for a simple asp.net MVC solution ?
How could I reduce the size of this directory and remove all unused and unnecessary packages?
Thanks for your help.
It's 2018, disk space is cheap, 350 MB is not "huge".
There's loads of metadata in those packages, and each package exists as a .nupkg and in extracted form, doubling its size (barring ZIP compression used for packages). So if a package like MVC 5.2 is 300 KB and its extracted size is 1,5 MB, in total that'll already be nearly 2 MB for one package. And you probably have dozens, if not more packages, each taking up their own disk space.
This only becomes a problem when other people on your team upgrade packages and then you pull their version, your packages directory still contains the older versions, as well as the newer versions.
So it can help to regularly clean your packages directory if this happens. Then only the currently used packages will be downloaded again.
Multiple versions of a package installed in a solution also cause older versions to coexist next to newer ones; upgrade all packages for a solution at once ("Manage NuGet Packages for Solution") or consolidate them on the Consolidate tab. This ensures all projects reference the same package version.
Packages included in one of my projects is 450Mb and works as desired and without issues. So I would not be so worried about yours being 350Mb.
If Resharper could not remove any unused packages then it would suggest that they are all being used at some point in your application. How can you find the unused NuGet packages in a solution? was a useful post on Resharpers tool for this.
Note also you can use the Visual Studio Extension ResolveUR - Resolve Unused References
If the packages are being used the project will break when trying to build and the package has been removed.
I reduced the size considerably with a script that removes languages other than English and things like Android/Xamarin, that I don't use:
FOR /F %%G IN ('DIR packages\ru /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\ja /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\de /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\fr /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\es /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\it /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\ko /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\zh* /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\monoandroid* /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\sl* /B /A:D /S') DO RMDIR /S /Q "%%G"
FOR /F %%G IN ('DIR packages\wp* /B /A:D /S') DO RMDIR /S /Q "%%G"

How to install BHO without Wix in C#

I followed this link How to get started with developing Internet Explorer extensions? and after following it I got it to install on my own machine by using the Debug mode on Visual Studio. How do I install it on another users machine without them having to start up Visual Studio and run through Debug?
If you have have followed the link posted in the answer (making sure you have the register and unregister methods) then you can create a batch file that people can use to install it on their own machines.
Ex:
"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" /f /i "%~dp0YourDLL.dll"
"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" /unregister "%~dp0YourDLL.dll"
"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "%~dp0YourDLL.dll"
"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe" /f /i "%~dp0YourDLL.dll"
"%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe" /unregister "%~dp0YourDLL.dll"
"%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe" "%~dp0YourDLL.dll"
REG ADD "HKLM\Software\Microsoft\Internet Explorer\Extensions{0A0F07FC-0099-4AAF-8D2F-C6C710EE91CA}" /v "Icon" /t REG_SZ /d "%~dp0Resources\YourIcon.ico" /f
REG ADD "HKLM\Software\Wow6432Node\Microsoft\Internet Explorer\Extensions{0A0F07FC-0099-4AAF-8D2F-C6C710EE91CA}" /v "Icon" /t REG_SZ /d "%~dp0Resources\YourIcon.ico" /f
You do not have to include the REG ADD at the end if you don't have an Icon that you want to use but I couldn't find a way to have a dynamic path for the icon in Visual Studio that would work so I decided to register it through the batch file itself. If you want info on registry commands for batch files you can look here: Is it possible to modify a registry entry via a .bat/.cmd script?.
The %~dp0 before the YourDLL in the first part of the code is to get the current path that your batch file is located in. I found that information out through this How do I find the current directory of a batch file, and then use it for the path?

Could not load file or assembly 'itextsharp, Version=5.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies

I have used itextsharp library to generate pdf in my asp.net web application. It was working fine untill today when suddenly my laptop on which the application was running in the debug mode went off. When I switched on my laptop again and tried to run the application I satrted getting this error:
"Could not load file or assembly 'itextsharp, Version=5.5.0.0,
Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its
dependencies. The parameter is incorrect. (Exception from HRESULT:
0x80070057 (E_INVALIDARG))"
What could be the reason and how can I solve this? Please help.
Try removing the reference and add again...!!! Seems like the reference got removed due to improper shutdown.
Try to clean Temporary Files of Asp.Net, sometime I've experimented strage cases of files corruption(I know this should be a comment but It's verbose):
1 - Open notepad and paste the following.
#ECHO OFF
ECHO Per­form­ing IIS Reset
IISRESET
ECHO Delet­ing Cache
Del /F /Q /S %LOCALAPPDATA%\Microsoft\WebsiteCache\*.*
Del /F /Q /S %LOCALAPPDATA%\Temp\VWDWebCache\*.*
Del /F /Q /S “%LOCALAPPDATA%\Microsoft\Team Foundation\3.0\Cache\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\*.*“
ECHO Complete
2 - Save the file as a .bat file.
3 - run it from the com­mand prompt.
I had a backup of my project. Restored the backup and it worked. Thanks for all the suggestions.

I can't build AwesomiumSharp version from github

Anyone using https://github.com/khrona/AwesomiumSharp? I am trying to build the AwesomiumSharp but get the following errors:
Error 2 The command "XCOPY ..........\build\bin\release\icudt42.dll "C:\Users\demo\Desktop\July2012\khrona-AwesomiumSharp-423f277\AwesomiumSharp\bin\x86\Debug\" /i /y
XCOPY ..........\build\bin\release\avcodec-52.dll "C:\Users\demo\Desktop\July2012\khrona-AwesomiumSharp-423f277\AwesomiumSharp\bin\x86\Debug\" /i /y
XCOPY ..........\build\bin\release\avformat-52.dll "C:\Users\demo\Desktop\July2012\khrona-AwesomiumSharp-423f277\AwesomiumSharp\bin\x86\Debug\" /i /y
XCOPY ..........\build\bin\release\avutil-50.dll "C:\Users\demo\Desktop\July2012\khrona-AwesomiumSharp-423f277\AwesomiumSharp\bin\x86\Debug\" /i /y
XCOPY ..........\build\bin\release\Awesomium.dll "C:\Users\demo\Desktop\July2012\khrona-AwesomiumSharp-423f277\AwesomiumSharp\bin\x86\Debug\" /i /y
XCOPY ..........\build\bin\release\AwesomiumProcess.exe "C:\Users\demo\Desktop\July2012\khrona-AwesomiumSharp-423f277\AwesomiumSharp\bin\x86\Debug\" /i /y
XCOPY ..........\build\bin\Release\locales\en-US.dll "C:\Users\demo\Desktop\July2012\khrona-AwesomiumSharp-423f277\AwesomiumSharp\bin\x86\Debug\locales\" /i /y
XCOPY ..........\build\bin\debug\Awesomium_d.dll "C:\Users\demo\Desktop\July2012\khrona-AwesomiumSharp-423f277\AwesomiumSharp\bin\x86\Debug\" /i /y
XCOPY ..........\build\bin\debug\AwesomiumProcess_d.exe "C:\Users\demo\Desktop\July2012\khrona-AwesomiumSharp-423f277\AwesomiumSharp\bin\x86\Debug\" /i /y
" exited with code 4. AwesomiumSharp
Any ideas?
The XCOPY commands are in the startup projects properties on the build events tab, you need to amend to your disk or remove them (depending on what they are doing, I am unsure.)
Same for the Mono project I am guessing.....
-------------------- EDIT ----------------------
I managed to get it compiling the code, I followed the readme and installed the SDK on my D:\
I then copied the source in the same folder as the readme into the following folder:
D:\Awesomium\1.6.6\wrappers\Awesomium.NET\AwesomiumSharp
I then went into the properties and added in front of the xcopy source path an extra ..\ so that it went down to the correct folder and now it compiles.
It should be then copied from here:
Good luck!

Categories

Resources