Make Visual Studio work on source files developed under Mac - visual-studio

I use Emacs for Mac to develop Excel add-ins, and test and debug them in Excel Online and Chrome DevTools. All the source files (.xml, .html, .js, .css) are put in one folder at the same level. The folder contains no more than 10 files in total, and we can add it to workspace in Chrome DevTools, which synchronises quite well with Emacs.
Once an add-in has been built more or less, I need to test (and thus debug) it further in Excel for Windows, which is more used by professionals and supports more complex Excel files than Excel Online. I install Windows as a virtual machine, which has access to files in Mac.
To debug an add-in in Excel for Windows, we have to use Visual Studio, I see how to create an add-in project from scratch in Visual Studio.
However, the question is, whether it is possible to build a project in Visual Studio, which is based on existing source files of an add-in (in one folder and at the same level). I guess only when we code and debug on the same source files across Windows (Visual Studio) and Mac (Emacs), we could keep the files synchronised.
Does anyone know what is the best practice?

If you're looking for the fully interactive debug experience from Visual Studio (ie. Hit F5 and have the website, debugger and Excel all spin up at once) then this does require Visual Studio ASP.NET.
That said, you do not need to use Visual Studio to build Add-ins. All that is required is a Manifest and a Web App hosted over HTTPS. The last part is the tricky bit since you likely don't have a valid SSL Cert running on your local Mac that is also trusted on the PC. You could solve this by trusting that cert in Windows but if you're not familiar with how the Certificate Manager works it may be an exercise in frustration.
The easiest way around this is using an Azure. Web Apps have a Free tier so it won't cost anything to spin it up and they include a valid SSL cert out of the box. Once you push your site up into Azure you simply need to edit the Manifest file and give it your Web App URL as the source location (i.e. https://mytestsite.azurewebsites.net/index.html).
In order to sideload the Add-in into Excel for Windows, you'll want to place the Manifest into a shared folder (SMB share). Within Excel you add that network share as a "Trusted Catalog" after which any manifest placed in that directory will show up in Excel for Windows.

Related

How to test an office excel add-in with other computer

I'm newly developing office Add-Ins. I was able to create an Excel add-in using visual studio 2019 with Office / SharePoint development workload (JavaScrip APIs). It was possible to test on my own excel desktop when I press the start button in Visual studio, but I need a test on another computer. I'm planning to publicize this app on AppSource and OfficeStore.
Checking Microsoft's documentation and some other questions here at Stackoverflow I understood that the recommended way to test is: SideLoad.
Microsoft's Documentation about testing and debugging office
add-ins
Test office Add-ins - StackOverflow
Overall Testing Story for Office Add-ins
On the other hand, when I started on my desktop the WebApp(task pane) was host in the IIS server as localhost. So, I created a shared folder and put the manifest archive that was available in my machine on the path: Office add-in\ExcelWebAddIn1\bin\Release\OfficeAppManifests. Besides that, accessing another computer I set the trust manually and it works. On the other hand, when I accessed the excel> insert>add-in>myadd-ins> down arrow is not possible to keep going with Microsoft's documentation, and the add-in is not there!
If I try file>options>add-ins is not there too!
Sideload Office Add-ins for testing from a network share
Is it necessary to host the web app on a real server or Azure before following these steps? or Is it necessary to publish the solution? Besides that how can I include the manifest in excel?
To test an add-in on a machine that is not the machine where the add-in's web app is running, you cannot use "localhost" in the manifest. The manifest must point to the HTTPS URL of the web app.
I have done the following:
installed and used Node.js
edited taskpane files etc on node server
in a browser, visited localhost:3000/taskpane.html and other files, and copied source generated
on a webserver, placed these generated files, and copied links to these files (only one html and one js needed)
repalced links in manifest.xml to html file, and in .html file to .js file
re-upload manifest.xml to reflect changes
It works, with some errors being thrown in the console output.
It does mean that you need to repeat the steps above each time, except for the upload of the manifest.xml.

Prevent Visual Studio from automagically changing the physical path of IIS virtual directory?

I have a Visual Studio "solution" which contains a Web application project (among a few other projects). Visual studio "typical" setup seems to be to insist that the output directory for binaries is smack in the root of the project source directory. In particular, each time the web application project is opened, Visual Studio will reset the physical path of the IIS virtual directory to point to the project directory.
This is problematic on many levels:
It's never wise to mix binary output directories and source trees
If the web application is buried deep within a directory hierarchy of other source, wherein many projects produce libraries which may be used as support libraries in the web application, then all the other supporting projects must have their binary output directories set to a bin directory a some non-obvious, nonsensical location somewhere in the source tree.
This "typical" VS setup does not have your web app setup duplicate the "production" setup you would get from a publish: there may be files in your source tree (an old .js file there there from a repository extraction, for example) that are not referenced in your projects, and so would not be in the production published package, but are there in your debugging setup.
It is very possible and very easy to configure all the projects in a Visual Studio solution to build to a bin directory in some subdirectory cleanly placed outside the source tree. It is also easy to ensure that the web app build places all content cleanly in this directory. It is also easy to configure an IIS virtual directory to point to this build output directory. And then Visual Studio, unannounced and unbidden, screws this up by arbitrarily changing the physical directory of the carefully configured virtual IIS app, to point to the middle of one's source tree.
How can this crazy-making behaviour be stopped? I.e. how do I prevent Visual Studio from automagically re-setting the physical path of the virtual web directory each time the web app project is opened?
This question has been asked many times here on Stack Overflow, but I have seen no real answers:
The response to this question (IIS8.5 is automatically changing Physical Path property) simply indicates how to control the order in which Visual Studio does its repointing.
This question and response (Visual Studio creating IIS virtual directories when solution opened) simply confirm the behaviour.
The response to this question (Opening projects changes iis settings) is simply wrong, as are some of the comments.
These questions (Visual Studio 2012 changes IIS application directory without asking), (Visual Studio changes local IIS configuration) have no responses.
Basically, no one has said it can't be done, but no one has give a decent solution either.
I have my application in IIS pointed at %SystemDrive%\inetpub\wwwroot\web, and would like it to stay that way. Like others, I discovered that every time I opened the solution in Visual Studio (I'm using 2017), it would change the application's path in IIS to point to the path that Visual Studio uses.
I've made the following change to the project settings (web tab) for my project. In the servers section, I've set the drop-down to "External Host", and then entered the project URL as https://localhost/web. I'm now able to open the solution in VS without it updating the path in IIS.

Create Visual Studio Project using files on Server

How do I create a Visual Studio Project for Development on my Local PC that links to Existing files and folders on a Server?
My employer has a large website. Most of that girth (close to 100 GB) is contributed to Portable and Image document (i.e. PDF and JPEG) files, but there are also numerous web files (.html, .aspx, .php, etc).
We have the following folders:
a WORKING folder that contains everything that is "Live" on our web server.
a BETA folder that contains newest technologies that are being tested and tried.
a DEVELOPMENT folder that contains numerous copies of projects that are being worked on by the different developers.
Developers are allowed to use whatever tools they prefer, so we have people who develop using Notepad++, Dreamweaver, Komodo, Zend Studio, and (now) Visual Studio.
It is NOT OK for me to create Visual Studio Projects for myself on the network servers. Other developers using other tools are not creating solution files or \bin and \obj folders on the servers, and I certainly should not be either.
So, to work on a file in Visual Studio, I use Windows Explorer to browse to the location, then I open it in the IDE.
However, this causes me to lose a lot of the power of Visual Studio - particularly if other classes used in this file, because I would have no access to the Intellisense for that class and I cannot simply Right-Click and go to definition.
Also, since each development environment is so large, I can not copy them to my laptop with its high tech 125 GB Solid State Drive (should be interesting to read that in a couple of years).
What I would like to do is create the Visual Studio Projects on my local drive, and then have them reference the files and folders on our network.
I've looked and found these similar questions, but my goal is slightly different:
Working efficiently on remote projects in Visual Studio
How do I add an existing directory tree to a project in Visual Studio?
How to "Add Existing Item" an entire directory structure in Visual Studio?
These are all great topics, but none of them show a way to create a local project that uses remote files.
It would seem that developers in large company teams would have already developed a way to do this, and that I just do not know what it is called.
I have found a way to do this!
For a long time, I was working with 2 sets of folders. One for our repository and one for Visual Studio.
I'd make changes in Visual Studio, then copy those working files over to the repository folder.
That was time consuming! Very.
Here is how I found to fix it: Open the Visual Studio Project file (*.csproj, *.vbproj, or *.phpproj) in NOTEPAD with Visual Studio closed.
Locate the <ItemGroup> tab, and change every path to be from the one shown to one that uses a relative path to get to the actual files.
Notepad's Replace... CTRL+H will save you hours here!
It makes a funky looking project environment, but it works!
If this helps anyone else or if it were even something you didn't know you could do to manipulate Visual Studio, kindly vote it up.

What's the minimum set of tools I need to open Windows Azure samples shipped by Microsoft?

I wanted to try open "Hello World" from here. I already had Visual Studio 2010 installed. I went here and downloaded WindowsAzureSDK-x86.exe and installed the SDK.
Yet when I double click the .sln in the sample Visual Studio opens the .csproj (the project with web role) just fine but complains it can't open the .ccproj file because its project type is not supported by this version of the application.
What else do I have to install so that I can open that .ccproj project file?
You need the Windows Azure SDK+tools. The easiest way to do this is to visit here and select "Get Tools and SDK." This will fire up the Web Platform Installer, which should do a much better job of setting up your environment.
A few more things: You'll need SQL Express (or SQL Server) installed as well. I "think" the Web Platform Installer will take care of that for you, but I'm not 100% sure. Also, you'll need to run Visual Studio as Administrator, to allow it to properly interact with the local Windows Azure simulator.
Turns out I needed to also install the thing called "VSCloudService.exe" on the same page. Once I installed it .ccproj files open just fine.

VS 2008 Express - clickOnce question

I have the VS Express 2008 where there is only ClickOnce deployment option. I need my app to be simple ran by clicking on the exe file without any installation.
I have found out that after deleting both manifests and icon /which is always in the output directory even though its embedd with "Do not copy" option/ it works well. Is it ok or is there any cleaner way how to do that? I mean, if the app is not being installed but only ran, do I still need external manifest files? I tried to embedd them but these still persist external (tried "Embed manifest with default setting" option or add my own and selected from list).
EDIT: In the Express, there is only ClickOnce.
Thanks
If you want to run it from the exe, ClickOnce isn't quite right. ClickOnce executes as a .application, and you should be able to just click the radio button (on the "Publish" tab) for "The application is available online only", which avoids any local ClickOnce install.
Otherwise, just build as Release and take the /bin/Release output; this is your standalone exe app. To get the right trust, a .NET exe can be executed from:
local drives
mapped network drives (f: etc) with the right .NET service pack
anywhere if "caspol" has been used to set a policy
I believe in Visual Studio Express, ClickOnce deployment is your only choice.

Resources