VS2013 Database Project without generating dll - sql-server

How to disable generating dll in VS2013 Database Project?
I don't use SQLCLR at all.

Assuming that the goal is simply to not have the DLL in the output folder (e.g. \bin\{configuration}) along with the .SQL and .DACPAC files, the cleanest way to prevent this seems to be adding the following XML element under the main <PropertyGroup> element in your project's .sqlproj file:
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
The DLL is technically still generated, but that happens in the \obj\{configuration} folder.
EDIT:
If you also want to prevent the PDB file from being copied into the output folder, then use the following element in the same location as noted above:
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>

SSDT must generate a dll as the MSBuild Key Output to enable other project types to reference SSDT. Unfortunately many project systems in VS assume it's references generate a dll and when they don't unfortunate things happen.

You could just add
del $(TargetPath)
To the post-build event in Database Project.

Related

Add a large amount of files in a .vdproj (Visual Studio Installer) file

my problem is :
I have a VB .NET project, with an installation project made with the old poor "Visual Studio Installer".
The version of Visual Studio I'm currently using is 2015.
Now I need to insert into the installer project a huge amount of file, from different directories,
and the IDE doesn't let me to add multiple files in subdirectories, with a simple "copy and paste into".
Apparently, I have to manually create, into the file system, every sigle directory that I want to have in the final installation.
I've already did a little program that inserts those files programmatically into the main project file (.vbproj), that's simply an xml file, but the .vdproj file seems more "tricky" do manage,
it contains GUID numbers, as 9F6F8455-1EF1-4B85-886A-4223BCC8E7F7 that I'm not sure I'd want to tangle with.
Anyone has ever dealt with a problem like this?
I solved by myself.
Simply I was wrong, you can actually copy the directories you want to add, from a file explorer windows, and then paste it into the File System Windows of the installation project.
Anyway, I think I'm leaving here this question, in case anyone else would need that.

Utilizing a DLL not in System32

I am running on a system which I don't have administrative access on
An exe I am trying to run utilizes msvcp140.dll, and currently upon running will not run and throw an error message specifying that msvpc140.dll is missing.
Normally I would just install the dll to system32 and be done with it, however in this case I do not have administrative privileges.
Is there a way to map to this dll when running it? Some sort of batch command? Would this have to be somehow linked when compiling? Any advice?
Thanks!
you have the following options:
add the .dll to the directory where your .exe is located. This particular .dll is redistributable, meaning you can include it with your installer, although the proper way is to invoke MS VC++ redistributable installer.
recompile your application to use static linking to C++ runtime. In this case you won't need the .dll at all
I dont think you should copy msvcp140.dll into the system folder in case. System32 is a global folder, so any change of dlls in this directory can affect all installed applications.
This article from MSDN:
Describes how to deploy a Visual C++ application by copying files to
its folder.
Copy the appropriate MFC and C Run-Time (CRT) library files from the Visual Studio installation directory in the \VC\redist\version folder, and then paste them in the \Release\ folder of your MFC project.
This is also relevant for non MFC applications deployment.

Installshield The specified File key not found in the File table

I've packaged my WinForms app with the Visual Studio Installshield Limited Edition wizard.
When installing the app, I get this error during installation.
Error 2715. The specified File key ('myappname.xml_serializa') not found in the File table
Any ideas from anyone? I'm completely loss on this one.
In your installer project directory, open the *.isl file and search for the text in your error message, myappname.xml_serializa. It will most likely be in there quite a few times. Either remove it or correct all instances of it.
I had a similar problem recently and found out that it didn't find the key because I was not adding the .primaryoutput file on the section Specify Application Data -> Files. Check if you are adding all the necessary files for your setup before creating the installer. The installer will be created even if it doesn't have all the files, but it won't execute properly.
Hope this helps
Changing the *.isl file resolved our issue. I found that we had changed the .NET framework of a project and when we removed the project output from the Installshield using the prompt it did not update this file so when we added the output again it now contained two outputs. OUTPUT and OUTPUT1. Hope this helps
This is what worked for me: The project in my case was readonly as it was connected to TFS. If you are working offline, make sure you make the project files writable. (Uncheck Read Only at the folder level)
This worked for me:
In your setup project double-click Project Assistant.
Click on Application Files.
Select file(s) with the file extension that was reported in the error message(s).
Click on Delete.
Repeat for any files as needed.
Go back to setup project in Solution Explorer.
Click on Rebuild

How to stop Silverlight xap files including "Copy Local=False" dlls?

In the past I've used the solution outlined in the following URL to avoid multiple downloads of 3rd party dlls in modular Silverlight applications:
How to optimize the size of silverlight XAP file by removing common files?
However I am working on a Visual Studio 2010/Silverlight 5 solution application where this is not working.
I have a PRISM module let's call it Parent1.csproj that has no references to my 3rdParty dlls but it does have a reference to two other project files which reference the 3rdParty dlls child1.csproj and child2.csproj
child1.csproj and child2.csproj both have "Copy Local" set to false for 3rdParty.dlls but in spite of this the .xap file for Parent1.csproj contains the 3rd party dlls.
If I set child1.csproj and child2.csproj references in the Parent1.csproj file with "Copy Local" set to false then I get a dramatically reduced xap file with no 3rd party dlls but also none of the other code in the child projects that I actually need to be able to run.
It seems as if included project files get their "Copy Local" setting ignored and use the parent "Copy Local" setting instead, and there's no way for me to exclude those 3rdParty.dlls
Have I missed something subtle here? Is there some other way I can avoid downloading those 3rdParty.dlls in multiple modules when the shell application has already downloaded them?
I'm not 100% sure why this problem occurs, but it is related to Prism. The way we've solved it is add references to all the startup project and each of the sub projects even though they're not directly referenced but that project.
Make sure that the "Reduce XAP size by using application library caching" is enabled for all your projects.
Make sure that Parent1.csproj has references to all your 3rd party dlls.
Add these same references to child1.csproj and child2.csproj.
Double check you have extmap files for all your 3rd party dlls. If these are missing the dlls will be loaded into the XAP files.
Adding the references to the module projects and setting Copy Local to false on them will work, which is more or less what the accepted answer describes. However, Application Library Caching is not supported in Prism modules, so that may not work as expected.
If you have a lot of assembly references, adding them in this fashion is not very maintainable. You could also use a post-build step that removes unneeded assemblies from the XAP. Here's a short article that I wrote about how.

Application built using VS2010 does not work in VS-Express2008 - C

I have wrote an application that consists of two projects in a solution, each project contains only 1 .c source file. I was using Visual Studio 2010 Ultimate but due to the University only supporting 2008 I decided to create a blank solution and copy the source files into the new one.
After creating a new solution in VS2008 express, creating two projects and re-creating and adding the source files to the projects I ran the application.
For some reason only one part of the application does not work, I use CreateProcess() to execute "Project1.exe" from Project 2.
This works fine under vs2010 but for some reason it's not working under VS2008 express, GetLastError() is showing an Error 2: File Not Found.
This is an image showing the same code in both IDE's:
I'm not using anything special and I've made sure that both solutions/projects are using .Net 3.5.
I can't work out why it would work for one IDE and not the other.
Any suggestions? Thanks!
Edit:
Screenshot of .exe's
You are not passing the full path name of the .exe to CreateProcess(). This usually only works if you are lucky. The .exe files would have to be in the same directory and the working directory has to be set to that directory. First verify that the .exes are where you hope they are.
Avoid the dependency on the working directory by generating the full path to the 2nd .exe. Use GetModuleFileName(), passing NULL, to get the full path of your 1st .exe

Resources