When publishing a Visual Studio 2012 MVC website, there is the option to "Delete all existing files prior to publish". I've had this checked when publishing my websites, which I do over the File System, but this takes the web down until the publish is done. I'm wondering what are the situations where this option should be turned on.
I had situations where not all files that changed were being updated and the old files were being kept. Although I still don't know why that happened, let Visual Studio delete this files helped. Still, I will never save/activate this option in one of my profiles. Use it with care, I guess.
I had a situation in a MVC project where I moved a view file to the Shared folder. When I did a publish without doing a delete all, it left that file in the original folder. When I called the Controller method that referenced that view on the live site, it found the view file in the original folder before the one in the Shared folder. Doing a delete all first would have kept that problem from happening.
I am developing a cross platform (Android, IOS, WP) application that needs to have a relatively large prepopulated database. I am using Visual Studio 2013 with Cordova plugins.
Most answers on the internet point here or here. However these links always start with "copy your prepopulated database to the assets folder".
In my Visual Studio project, there is no assets folder. This is what I have:
How should I go about this? Preferably the solution should work on all platforms. Thanks.
No need to copy or to insert the values at first run of your app.
Instead use openDatabase with createFromLocation param as described here:
http://redwanhilali.com/ionic-sqlite/
The SQLite forces you to create THE COMPLETE Database executing "Create Tables" commands in a function inside the App, right?
That function ONLY executes if the Database DON'T EXIST. If already exists = don't execute that function!
So... to the "CREATE TABLE" commands, add "INSERT INTO" commands with what you need to populate! This will only execute the first time.
If you want a cleaner code, you can put all the data in an Array and then execute the Inserts with a For Loop.
(I did this in many Apps and worked like a charm!)
ADDED:
To solve "Code Brevity" I suggest 2 Options:
Option 1 - XML File: Add an external XML file with the info, and just read it in the "create db" function, and execute the "inserts" in a For Loop reading the XML file.
Option 2 - create a special js file (name it "populateDB.js" for example!) and enter all the code there... you won't see the code again!
I hope it helps because you cannot include a DB in your project, you HAVE to create it on the device...
I like your question. It made me think about an upcoming project and how I am going to solve a similar issue.
The link you shared: http://gauravstomar.blogspot.com/2011/08/prepopulate-sqlite-in-phonegap.html is a good place to start. The "assets" directory referenced isn't visible because, through Visual Studio you are looking at the Windows platform version of the code. Note, in the Xcode/iOS screen capture in the link you reference, the database file isn't in an assets folder, but rather "Resources" that roughly equates to assets within the Android project.
You will need a Mac and Xcode to build your project for iOS, this can not be done with Visual Studio or on a Windows machine. When the project is created by cordova with the "cordova platform create ios" command, you will see a resources directory and you can continue with your instructions.
Similarly, with Android you can open the Android project in Eclipse, or another editor/file browser and do the same. Myself, I am not brave enough (lack of experience) with Visual Studio to browse other platforms in a Visual Studio Solution.
ADDED NOTE: At http://gauravstomar.blogspot.com/2011/08/prepopulate-sqlite-in-phonegap.html be sure to read through the recent discussions/comments with regard to copying the file into place within the app. Appears to still work fine, but the process has changed slightly with newer versions of Cordova.
When using Visual Studio (and Phonegap), you cannot see assets folder. If you would like to develop prepopulated DB in Visual Studio, you had better apply sqlite plugin.
You need two plugins.
1) Cordova-sqlite-evcore-extbuild-free
2) cordova-plugin-dbcopy ->this plugin will copy your database to assets folder.
I think the following Git will help you.
https://github.com/ymochi/prepopulated-DB-for-hybrid-applications
The kpm pack command needs the runtime for the server - is it possible to install windows runtimes on osx just for the pack and deploy?
Ok, it seems that in order to recognise that the deployment is an aspnet vNext project and to handle that as a 'ProjectK Web Application deployment', you have to make it look like it all came from Visual Studio (or at least that was the only way I managed to get it to work right now)...
I did this by taking an example one from somewhere else...
I took a simple single vnext web project .sln file and changed the project name and project GUID.
I took the .kproj Visual Studio project file and did the same.
There isn't much that needs to be changed - only the name of the project and GUID. It's nice that there isn't any file lists in there so I feel that this might end up as a once-only activity...
I did find that there are some project structure rules that seemed to make it break. You seem to have to have the sln file in the top level folder and a folder underneath for the web project. If there is ONLY a web project then this might seem overkill, but I tried collapsing everything up to the top with the sln file correctly pointing, but that didn't work.
The other thing that you need to make sure you have is a reference to "Microsoft.AspNet.Server.IIS" in the project.json dependencies. Without this, the AspNet.Loader.dll and bin folder don't get deployed.
Apart from that, I am now able to use Sublime Text (or whatever I want on osx), test using "k kestrel", checkin through git and it gets deployed automatically to an azure web site! yippee!
Actually this makes much more sense because it is letting the target decide upon the binaries it needs to satisfy the deployments. Next challenge might be to get it to pull 'my' libraries from a custom NuGet source to get my binary libraries in there and avoid uploading ALL of the source to the website!
Oh - and another tip: Quit kestrel with 'Enter' for a clean quit instead of Z which leaves the port listening but non-functional!
I'm having problems with TFS when adding new files or folders to my solution.
When any other people in the team try to "get latest" it updates every changed file but it doesn't download the new added files!!
If we go to the Source Control explorer, the new files appear as "not downloaded"... and if we force it to download, then we have to include the file in the project in his machine too.
I can't believe this is the normal behavior for TFS (I think this is basic) so I assume we are doing something wrong... Any idea of what's happening??
Thanks in advance ;-)
Have you also checked in the project file to which the added files are related? In Solution Explorer these files will only be available if they are also in the local project file. Also check if the user attempting to download has the project file checked out already.
Update:
From within Solution Explorer you'll only get what's required for the referenced files in the .proj file. For Source Control Explorer yes it should get those files if you've never downloaded them before. Best way to be sure is rather than just do Get Latest (which tries to sync what it understands server side about your local workspace with the server) do a Get Specific Version -> Latest Version. This way you can "force" download of all project files irrespective of existing workspace status.
The hint above did not help in my scenario.
What did do the trick was to check out an old version (with the two overwrite-checkboxes) and get the latest version afterwards (also with the two overwrite-checkboxes).
This is a huge bug in TFS IMO.
I just had the same problem. My co-worker created a new file (with content, not just an empty file). He did a check-in, and everything went well on his end. But the file never got downloaded to my project. I could go into Source control explorer and navigate to the file in question, then do a "get latest version" or "get specific version" on it, but it still didn't appear in my project.
Then my co-worker did some cosmetic changes to the file and did another commit. This time, when I did a simple "get latest version" on the whole project, the file downloaded without a problem.
Check the most voted answer in this thread. This should be the nearest to what you are looking for
Find unadded files in Team Foundation Server
I have a simple Silverlight program that displays a bunch of images. I modified it do display more images, but it when I hit "run without debugging" is keeps running the old build with fewer images. When I copy the code into a new project and run it, it works fine for the first time, but then each subsequent change is not displayed. What could be the problem? I'm using Visual Web Developer 2008 Express.
Always check "Configuration Manager" option on "Build" menu in Microsoft Visual Web Developer. The checkBox "build" has to be checked, otherwise it won't build.
Happened to me, I hope this helps others.
I just had this happen to me in VS 2013 for Web. Had to change the Project URL in:
"Project properties"
β"Web"βtab
ββ"Servers"
To a different localhost number and recreate Virtual directory.
Before my Project URL was:
http://localhost:55487/
I changed it to:
http://localhost:55488/
Then clicked "Create Virtual Directory".
Would like to know why this happened in the first place.
I found that I had to close all open instances of Visual Studio before I got it working again
This happens because your cache memory is full. just go to you bin and obj folder and delete all the temporary files. Now it will run properly.
Maybe it's a caching issue (webbrowser / proxy).
To fool the browser try to embed the xap file with an additional parameter that changes every time you open the plugin:
<param name="source" value="ClientBin/BubuApp.xap?<%=Guid.NewGuid().ToString() %>"/>
If this don't help, try to clean the project (delete obj / bin folders & xap file).
I was also suffering from this issue and none of the suggestions worked. I was building a Office.js add-in and debugging was with IIS Express.
What fixed the issue for me was deleting files in
C:\Users\<user>\AppData\Local\Temp\Temporary ASP.NET
Actually, I went ahead and and deleted the entire C:\Users\<user>\AppData\Local\Temp folder out of spite :)
I also had this issue and while some of the fixes above helped temporarily, the one that worked for me was to remove the history and caching in Internet Options.
Go into Internet Option (also available in VS via Tools > options > Environment > Web Browser > Internet Explorer Options).
On the General tab click Settings in the Browsing History section.
On the Temporary Internet Files page select Every time I start
Internet Explorer
On the History tab set the Days to keep history to 0
On the Caches and Database tab make sure Allow website caches and
databases is NOT ticked.
I'm not sure if all of the above are required, but I've made a number of changes to files and so far they have been reflected straight away in the dynamic versions without any noticeable performance problems.
I've also since realised if I set 'Every time I visit the webpage' instead of 'Every time I start Internet Explorer' I don't have to stop and restart the project to see the changes. Which is how it should be!
I used to suffer this. All of this used to be (for me) a folder's contents issue.
Maybe you can check this:
Delete %windir%\microsoft.net\framework\v4.0xxx\Temporary
IIS Express: even if you change the output file for compiled results, you will see in applicationhost.config that many times IISExpress is really "looking" to the default bin folder of your project.
It is even possible that you have different configurations for Debug or Release, so maybe IIS is looking BIN with Release code, and you are now compiling in Debug to another folder, do you understand me?
Happened to me too. Well i dont know the exact reason for this behavior. But when i close the visual C express 10 and then open again and build it builds the new saved file. I guess it still hangs on to the old file when there is an error in some debug mode or something.
Stop all incntance of VS.
Delete all /bin, not just /bin/Debug. All /bin
Remove user option .suo file in solution dir. It will create on self.
Remove all restore windows point
Stop IIS.
6 Start IIS after 1 minutes.
Rebuild solution, Buid projects
It happing on me too. Very nasty. You may restart your computer.
Check for global asembly dll.
Just delete folder 'Release' in project with old code build.
I had the same problem and none of the answers were working for me. It turns out that building the ASP.Net project did not build the Silverlight project, so running without debugging didn't update the Silverlight.
Fix: Right click the Asp.Net project. Build Dependencies > Project Dependencies. Check the Silverlight project. Now building should work.
If this is a web application, change the Project URL with a new port number.
Example :
Change from http://localhost:3688/
To http://localhost:36881/
To do this:
Navigate to Project properties -> Web
Change the URL
Hit "Create Virtual Directory"
Finally, Build and RUN
I had this issue in a web site.
The site referenced 1 of the projects in the solution, and changes to it would not reflect in the debug.
Issue was a third project was referencing an outdated dll of the same same referenced project.
I removed the project and all references in other projects and readded and re-referenced everything and it worked fine.
Check you haven't got two versions of whichever file you're updating (one for one group of users, one for a different group of users).
In my case(VS 2015) it was because of the missing dll in the .exe directory... I made a "clean solution", then additionally deleted all bin and obj folders' contents. Reason to do so was VS keeping to load old dll build. Solution was to select folder of the running debug config, i.e. everytime I rebuild project destination location with dll and a reference to it stays with warning mark for some time until intellitrace does its job. After doing the setup mentioned above, I still have to do a manual rebuild on a project that generates a dll into specified dir. Pressing F5 does nothing, I don't have time to find out why... Main thing is its working for me
I had this recently too and I didn't see the answer here. I was changing an MMI to get rid of redundant buttons, and they didn't go away.
Really old legacy code. To make it keep user settings - like language - someone had made it keep the Settings. I was not allowed to change this, they want it like that.
To get rid of the old settings and allow new ones:
open regedit
navigate to HKEY_CURRENT_USER - Software - MyProject - SubProject
here you see Recent File List and Settings.
Delete Settings completely - don't worry, it will make a new one.
Please check is there any old .tlb file present in someother folder. In my case i was using the .tlb file generated using .NET dll and then created the .tlb file using RegAsm. I tried to use the .tlb file in vb6 code, it still refers old code only. After a long search i found same .tlb file older version found in Visual Studio\VB98 folder. I removed it then it worked fine. This may not be relevent for this issue but could give you another way of thinking
There is a scroll bar at the top which has 3 options:
debug
release
configuration manager
Make sure release is selected.
I had to clear browsing data and it worked in my case