C# Google Chrome Extension, where is my bin/debug path? - c#

I am working on a Google Chrome Extension and I need add a library to my project.
I know how can I add the library but there is a problem I have.
First, I added .dll file into my referance.
Than, I need a debug folder in my bin folder. Normally, bin/debug file create automatically when you create new project in C#. But when I create "Chrome extensions project" the file path didn't create. I created manually but it didn't worked.
I created a console app and I tried add my library into the project, it worked. What should I do?

There is no bin\debug folder in the Google Chrome Extension project. The output is the zip file (not dll or exe), that contains the files from the app directory. You register this zip file as an extension.
You can't build Chrome extension using c#.
More info you can find here: https://visualstudiogallery.msdn.microsoft.com/c11cd639-2abb-4243-96d2-153c0adb494a

Related

As a C# beginner (mostly console apps) what files to upload to github

I have enrolled in a course for C# Basics. Most of the course are exercises which are just console apps. However, I want to add them to my GitHub profile. Unfortunately, as already stated, I'm new to C# and Visual Studio and I don't know much. I have learned to create a blank solution and add console app projects for each of the exercises. Each console app has a folder in the solution, which name is usually the exercise name: ex.DepositCalculator. In the folder (DepositCalculator) there are two folders – bin and obj, as well as DepositCalculator.csproj file and Program.cs which appears to be the source code. I have no idea about the .csproj, or bin or obj folders, and this is why I don't know what to upload to GitHub. Do I upload only the .cs file, or I need to .csproj, bin and obj, or should I upload the .sln (which appears to be the solution)?
My whole folder contents with the .sln file:
DepositCalculator folder contents:

WPF Publish - include folders

I have a WPF project that is now finished, and I want to publish the app into an installer that other people can use.
When I publish the project, the project compiles into setup.exe, but on install the folders that I have do not get included.
I've been reading the guides, and made sure to include the files inside the folders as Content or a Resource. I've also made sure they are always copied. When some of my files are copied, they have a .deploy extension, and I need it to be an .xml in order for some function to read them. Images that I have in the app load fine however.
What do I need to do to have my custom files be EXACTlY as they are, xml as xml, txt as txt and so on. Also I have some empty folders, like this TempCF that I use at some point. Do i need to create it via code?
If you go to Project->Properties->Publish->Install Mode and Settings->Options->Deployment in Visual Studio, there is a "Use ".deploy" file extension" option that you can untick to get rid of the .deploy extension being added to your published files:
Empty project folders are not included in the output. Either put a dummy content file in them or create the folder dynamically as needed during runtime.
# Nikola L.
You could try to use the following methods to add the files in your program to the installation package so that you can have the files you need in your installation path. If I misunderstood your question, please let me know.
The steps are as follows:
1.Right-click on the Setup project and select View -> File System
2.In the File System page, right-click the Application Folder (File System on target Machine) and select Add->Folder(named User's Application Data ) -> File…-> find the file under your project and select the file you need.
Such as:
3.Right-click the Setup project.
Install your setup package.
You can find the files you added in your installation path.
The result is like the picture below:

Xamarin.Forms: Android project Build Error - Missing Files inside AppData\Local\Xamarin Folders

I'm trying the Xamarin.Forms.
I created a Solution named "App2". The Visual Studio automatically created the following projects:
App2 (Portable)
App2.Droid
App2.iOS
When I try to compile the Android Project (App2.Droid), I get the following errors:
Download failed. Please download
https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
and put it to the
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3
directory. App2.Droid Reason: One or more errors. App2.Droid
Please install package: 'Xamarin.Android.Support.Design' available in
SDK installer. Java library file
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3\embedded\classes.jar
doesn't exist. App2.Droid Download failed. Please download
https://dl-ssl.google.com/android/repository/android_m2repository_r22.zip
and put it to the
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3
directory. App2.Droid Reason: One or more errors. App2.Droid
Please install package: 'Xamarin.Android.Support.Design' available in
SDK installer. Android resource directory
C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3\embedded./
doesn't exist. App2.Droid
I've already tried to:
Download the android_m2repository_r22.zip file and put it on the C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 folder
Download the file and extract it to the folder
Delete the C:\Users\pedro.costa\AppData\Local\Xamarin\Android.Support.Design\23.0.1.3 folder and recompile project
Delete the C:\Users\pedro.costa\AppData\Local\Xamarin\zips folder and recompile the project.
Update the Xamarin.Android.Support.* nuget packages, but when I try it, I also get those build errors.
I've done a lot of research and it seems that the Android.Support.* folders should have files inside it, and that those files should be downloaded when the android solution is built, but it is not happening for me.
Try this work around :
Navigate to C:\Users\[user-name]\AppData\Local\Xamarin\zips folder.
Remove all zip files.
Remove /bin and /objfrom your project.
Clean and build your project.
It may take a while to build and debug project.
1.download
https://dl-ssl.google.com/android/repository/android_m2repository_r29.zip
2.rename to 2A3A8A6D6826EF6CC653030E7D695C41.zip
3.copy to C:\Users\User\AppData\Local\Xamarin\zip
4.rebuild
I saw in other answers to this problem, that by just deleting all the content from the Android.Support.Design folder, Visual Studio would download it again once the project was rebuild.
The problem in my case, was a proxy issue. When I set my environment to access the internet without the proxy, Visual Studio download the necessary files and folders on the rebuild.
Don't extract the zip to \23.0.1.3folder or just put it there, that won't work don't mind the error message.
You must put the zip in the \zip folder, after you delete the already existing zip, you may need to rename the zip you downloaded to something like: 2A3A8A6D6826EF6CC653030E7D695C41.zip
But if you don't want to manually download the support repository you can just delete everything in the %USER%\AppData\Local\Xamarin\ folder and rebuild and wait.
there is a zips name folder over this address C:\Users\[user-name]\AppData\Local\Xamarin\zips
first u have to check it the file is in extract condition there we can see an error it is an currupt format then u can replace those two files
1)2A3A8A6D6826EF6CC653030E7D695C41.zip replace by this link rename with 2A3A8A6D6826EF6CC653030E7D695C41
2)96659D653BDE0FAEDB818170891F2BB0.zip replace by this link rename with 96659D653BDE0FAEDB818170891F2BB0
then rebuild the project

embedding web site in c# project

I am currently developing a C# application. I want to have a website as a help file that is loaded within the Windows form of the software.
I have added the directory where the help site is stored inside with the rest of the project classes and folders and included it into the project.
I have the following in the code
string appPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
string openPath = Path.Combine(appPath, "HelpFiles/Introduction/index.htm");
helpContent.Navigate(openPath);
How can I reference the site directory from inside the main project. At the moment I can only get it to work if I can copy the directory into the bin/debug directory where the exe is located. I don't want this I want the HelpFiles directory to be embedded into the main part of the software.
How are you planning to deploy your project? If you are planning to use VS Setup project then you should mark your help files as content files and then in setup project, place the content files at installation directory - for example, you may choose structure such as:
<Installation Dir>
bin -> place project output here
help -> place project content files
Now you can use a relative path from app base path i.e.
string openPath = Path.Combine(appPath, "../help/Introduction/index.htm");
Another way could be to mark all your help files as "copy to output" (from files property), that will put all your files in the same directory as exe.

Embedding a PDF as a resource in WPF application

I want to embed a PDF file (which is basically have Product details, Release notes) and wants to open that file from menu bar. What would be the best approach. I need to use this file in installer also. So i'm looking for an approach in which file will be moved to BIN on compilation and from there installer can access that file.
IDEAS ...
Add the file to the project the builds the EXE (use Add existing file in visual studio). Then right click on the file in visual studio, go to properties, and verify that the build action is "Content" and the copy to output directory is "Always" or "If newer" (whichever suits you).
Then this file will always be copied to the same directory where the EXE resides and your application will be able to access it because it's always in the application's directory.
If the installer just takes the BIN directory then it will also be able to access it because the file will reside in the BIN directory.
Have fun!
Finally i did it in following way:
a. We've a folder which contains notes.pdf (used by installshield).
b. Created a pre build command to copy the pdf file from installshield folder to output directory.
c. use process.start("notes.pdf"); to open the file. As it would look in bin directory first for pdf file and we've already copied it there.
It worked for both Installer version and running application from code.

Categories