Where is App.config? - vb.net

I'm trying to set up logging with Microsoft's Enterprise Library (log4net seems to be a dead project). I'm using VB .NET 2008 and VS 2008. I've searched all over the MSDN documentation, CodePlex docs (including the Hands-On labs that installed and then vanished), and online tutorials to no avail.
They all refer to a mysterious "configuration file" or "App.config" that I can't find and can't seem to add. I even tried adding a new text file and renaming it "App.config" but that only made VS 2008 spit out a red wavy line on a blank file.
Any suggestions for finding the elusive app.config would be greatly appreciated.
(and, if that makes the EntLib configuration tool show up, I'll be absolutely delighted)
Edit:
I've been tricked!
The tree in VS 2008 isn't a true superset-subset relationship, which is why I got so frustrated.
To wit, the top of the tree:
alt text http://static.zooomr.com/images/7954203_910064e809.jpg
And a 'sub-section' of the tree.
alt text http://static.zooomr.com/images/7954204_69e03c8502.jpg

Im pretty sure you can use web.config if youre in a web app or web solution.
Otherwise, see here
[EDIT] In my VS the app file can be added like:
Add new item -> General -> Application Configuration file

Should be in the same directory as binaries, but you have to add it to your solution first, using Visual Studio window for adding new files to soultion.
Add -> New Item -> Application configuration file

You can add an app config file to any vb project by
right clicking on the project -> Add-> New Item -> ...
and selecting either
Application Configuration File
or selecting
Web Configuration File
(for app.config or web.config respectively)

Wanted to add my $0.02 as I stumbled on this question with frustrated googling, and my situation wasn't as others have described here. I created a new winforms project, didn't see app.config, and went to add it as others have described. Wasn't in the list. I turned on "Show all files" in Solution Explorer, and it was already there, but not a part of the project. Right clicked on it and selected "Include in project," and now I'm good to go. No idea why it created the file, but didn't include it in the project. (This is VS2010, btw.)

Related

Can Orchard 1.8.x be installed on a build server that does not have Visual Studio Installed?

I also asked this question on the Orchard forum but no joy there yet. So here it is again...
https://orchard.codeplex.com/discussions/569444 Please read for a few more details.
IF the .NET 4/4.5 SDK came with a developer command prompt (like previous SDKs) then I would not be asking this question.
But since Orchard is build with .NET 4.5 I am getting build errors using the old SDK. It seems that my only option is to install Visual Studio Express on the build server.
I am doing that as we speak so at this point the question is purely academic but I am still curious.
EDIT
STILL NO JOY. Even after installing VS 2013 Express Web the vcvarsall.bat that usually configure the build environment is still not present. So this is no longer a curiosity question. The Express edition also cannot create my build environment. Help.
Seth
Here is my answer...copied and pasted from the forum.
This is a late answer. Bottom line is that I did eventually get our build server to build orchard projects. I am not sure if this is a complete answer or not as I should have answered as soon as I had it done. But I pretty sure this will work.
One other thing to note...It is quite possible that not all of these steps are required. I tried a lot of different things and it might be in the end some of the steps were not needed. It might also reflect a problem on our build server...especially the fact that I had to manually add registry entries.
But here it is without details.
Install the .NET Framework SDK for Windows 7.1.
http://www.microsoft.com/en-us/download/details.aspx?id=8279
Install the .NET 4.5 Full
http://www.microsoft.com/en-us/download/details.aspx?id=30653
Install Visual Studio 2013 Express for Web
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
Install the Visual Studio 2013 Build Tools
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
Finally, even after that...it didn't work until I added the following registry keys. I would attach the .reg file but I don't see how.
Save the lines between the lines into a fixBuild.reg file. Then double click...
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VC7]
"FrameworkDir32"="C:\Windows\Microsoft.NET\Framework\"
"FrameworkDir64"="C:\Windows\Microsoft.NET\Framework64"
"11.0"="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\"
"FrameworkVer32"="v4.0.30319"
"FrameworkVer64"="v4.0.30319"
"12.0"="C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\"
Finally, to actually do the build, I created a batch file that does the build.
Save the lines between the lines into a doBuild.cmd file. Be sure to place this in the root of the source download...then double click to build...
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"
msbuild /t:FastBuild Orchard.proj
The first line gets your environment ready. The second build the project using the FastBuild target in the Orchard.proj file. You can read that file if you want to try other build targets.
******* EDIT
There is one thing I forgot to mention. And that is that one thing you have to do to get this to work is that you have to edit some CSPROJ files because the command line build fails with errors like these...
\Orchard\src\Orchard.Web\Modules\CKEditor\CKEditor.csproj(337,6): error : "None" element name for include "Placement.info" should be "Content".
\Orchard\src\Orchard.Web\Modules\Orchard.Tokens\Tests\Orchard.Tokens.Tests.csproj(82,6): error : "None" element name for include "app.config" sh
\Orchard\src\Orchard.Web\Modules\TinyMceDeluxe\TinyMceDeluxe.csproj(377,6): error : "None" element name for include "app.config" should be "Cont
\Orchard\src\Orchard.Web\Modules\Upgrade\Upgrade.csproj(156,6): error : "None" element name for include "app.config" should be "Content". [C:\Us
\Orchard\src\Orchard.Web\Themes\Themes.csproj(280,6): error : "None" element name for include "Upward\Views\Content-Story.Detail.cshtml" should
The fix is to do exactly what the error indicates. Open the csproj files and search/replace "
Also, some of the projects reference app.config files that do not exist in source. You also have to remove those references. I usually just delete the content node entirely or the group entirely.
Seth

Visual Studio 2013 C# Web Project builds but IDE reports The type or namespace name xxx could not be found error

When opening an MVC4 C# web project in Visual Studio 2013, the IDE reports the error "The type or namespace name '_' could not be found (are you missing a using directive or an assembly reference)", but the project builds and runs without any errors. Furthermore, intellisense does not include the project namespace.
The "missing" reference is to files within the same project.
for example; the web project namespace is "webproject.com", and references in a controller files to "webproject.com.models" is underlined in red with the error above.
I have checked the following:
All Solution projects are configured to use the same Target Framework(.Net 4)
web.config in the Views folder contains the namespace in the system.web.webPages.razor section
cleaned and rebuilt solution
deleted all bin and obj content
deleted .suo and .csproj.user files that were created by VS2010
The only way that I can get rid of these errors being reported in VS2013 is to unload then reload the project.
When opened in Visual Studio 2010 I do not get these problems.
I have the same issue.
ALthough the project compiles correctly, the code editor shows an error The type or namespace name '_' could not be found (are you missing a using directive or an assembly reference).
THere is one workaround. Just delete the *.SUO files and re-open the solution. THen for this only Session it works. Unfortunately after closing and reopening the solution the issue is back again. VS 2012 works fine.
Seems to be a bug in VS 2013....
My solution, when I encountered the problem with VS 2013 Express edition was to simply unload the offending project and reload. Opening the SUO or Project file and making changes had not affect.
Try to unload the project in VS2013, then right click the node and select edit "projectname.csproj". Check the individual references they might point to somewhere strange.
EDIT: the csproj file is an xml file and the references are located under Project -> ItemGroup -> Reference
I had the same issue.
It's a VS 2012 solution with different projects.
Search for all *.suo files and deleted them.
Rebuild and reopen Visual Studio.
There's a known issue with Web Application projects when bound to a TFS server that sounds like this issue. This occurs when the following TFS setting option is checked:
Options -> Source Control -> Environment -> Get everything when a solution or project is opened.
Disabling this option resolves the problem.
thanks,
Miguel Lacouture
[MSFT]
Same issue, on project reference.
I opened the referenced project file (*.csproj) with a text editor and did some cleanup:
1) reset these properties' values:
<PublishUrl>publish\</PublishUrl>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile />
2) removed dirty platform/configurations:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'x86|AnyCPU'">
...
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'x86|x86'">
...
Now I can compile without any issue.
Glad to share it with you! :))
Same issue. Opening the project's properties and making a change to the name (or any value) and then rebuilding seems to have resolved it.
I have just had this problem and none of the solutions here helped. I fixed mine by doing a repair of Visual Studio (An option when you select to uninstall the program). Hope this helps someone
I had same issue when I added a new class file ( e.g. MyClass.cs) and called it in some other C# code places. For some reason VS did not add that new class file to my working project folder (not seen in VS, but seen in Windows File Explorer). And, hence, the compile path for new class file is not included in the compile section of my project file (e.g. MyProject.csproj). So to solve this problem, First, right click on your working project > Add > Existing Item ... > Select your new class > OK.
Then, check the project file (*.csproj) and make sure a new element is inserted in the compile section such as:
Finally, rebuild your project and the problem should be solved.
Another reason for this issue is the project, I had long ago with VS, is my other project was set up with Client Profile as its target framework. So, to solve the issue: Right click your project in VS > Properties > Application tab > make sure Target Framework option is not Client Profile. You should change all projects in your solution to the same framework version AND all of them must not have Client Profile option.
Microsoft just released a new security update to be automatically applied to machines configured to use Microsoft Update.
Unfortunately, some ASP.NET MVC 3 and 4 VS projects can no longer build after the update is applied. These projects will fail with the following error:
"Could not locate the assembly "System.Web.Mvc,Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL"
My project also had the error "The type or namespace name 'System.Web.Mvc' could not be found (are you missing a using directive or an assembly reference)". Installing the latest version of Microsoft.AspNet.Mvc solved my problem. See the following article from Microsoft for more info:
http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx
Unloading and then reloading the project worked for me.

How to write the sample COM Server in Visual D

I'm struggling to get a simple COM Server running in Visual D 2010. These are the steps I did so far:
Clean Visual D 2010 solution of type Dynamic Library (DLL)
I've copied contents of dserver.d into dllmain.d
I've copied file chello.d and dserver.def into the solution's source folder, as well as advapi32.lib and ole32.lib from the <D install dir>\dmd2\windows\lib.
I've added the copied file into the solution by right-clicking the project in the solution explorer and Add->Existing item...
Renamed file dserver.def into dll.def, overwriting existing project's file.
Applied a patch to the chello.d and dllmain.d (originally dserver.d) as written on this forum thread
Build Debug. No errors.
Calling regsvr32 COMServer.dll returns these four message boxes:
then
then
and finally
I am still unable to access the COM object from VBA. And referencing the DLL directly (by Browse... button and pointing to the COMServer.dll) fails with "Can't add a reference to the specified file."
I took another look at the forums and the problem with the samples seems related to TLS on Windows XP. I posted a (somewhat hacky) solution to it here:
http://forum.dlang.org/thread/mqoxluonyjdtjxauaxnl#forum.dlang.org?page=2
I can't provide you with a working answer. It looks like this was a year ago, I was trying to get an example of using a COM server working. This uses Juno (not 64bit ready), has nothing to do with Visual D, and most importantly I couldn't get to work. The issue I hit was related to registering the server ("side-by-side configuration is incorrect").
My qualifications for COM are all there in the history of Juno (so not much of any). If you're more familiar with COM you may get further, if it doesn't compile for the latest DMD let me know (2.064 isn't out yet anyway).

libc.dll files is required but can not find it

I am trying to publish my application using installShield utility. Every thing works fine but it gives warning that it asks for two files:
libc.dll
Flash32_11_7_700_224.ocx
Those two files are prerequisite according to the package but I could not find them.
I tried to search in the web for those two files with no luck.
Can any one help in this?
Explanation of Error
This error can be encountered in Flexera's InstallShield. The specific error is:
ISEXP : warning -6248: Could not find dependent file <dependent file>,
or one of its dependencies of component <component>
The official troubleshooting information from helpnet.installshield.com did not help me, but it says to:
Use the "Build Tables & Refresh Files" option to build the release
if the release location is in <ISProjectDataFolder>
or <ISProjectFolder>. For more information, see "How the Run time
Locates Assemblies", available in the .NET Framework SDK help or on MSDN.
Workaround
If the application works fine, and you just want to get rid of the warnings, you can follow this Stack Overflow Q&A.
(InstallShield, Installation Designer, Left Panel) Specify Application Data > Files
(Destination computer's files panel) Right click primary output > Dependencies from scan at build... > Uncheck dependencies you do not want
The above picture from the Stack Overflow answerer #Tom Wilson shows what you should see. Note that primary output was the central .exe of my project. When I used this technique on my primary output, the other components in my project were also fixed.
Resolution
If this problem is crashing your application, and not just an annoying warning...
In the case of libc.dll, I would direct you to add Redistributables to your project.
(InstallShield, Installation Designer, Left Panel) Specify Application Data > Redistributables
For instance, I use Microsoft .NET Framework 4.7.1 Full.
I believe this solution will work for libc.dll, but cannot verify. I base this on reading support.microsoft.com, which I think implies libc.dll is contained in C Run-Time (CRT), which I would also believe is part of the .NET Framework.
In the case of flash32_11_7_700_224.ocx, I would direct you to System Software Requirements. This ocx is installed with many Adobe products. You may want to prompt the user that they need to install this, at the time software installation.
(InstallShield, Installation Designer, Left Panel) Define Setup Requirements and Actions > Requirements
(Central Panel) System Software Requirements > Right click > Create New Launch Condition (System Search Wizard)
Follow the wizard there to block installment if it does not exist, or use one of the premade requirements if that helps your case. Tip: remember to supply a link to Adobe in your prompt, so your end-user can quickly download it!

Resolving problems with DSL SetUp project

I'm fighting with the InstallerDefinition.dslsetup file in a DSL setup project. I'm getting the following error:
Running transformation: The setup project could not retrieve the output path for project 'PsiTraffic.Modeling.PomModel.Dsl' from the environment. Ensure that this project exists in the solution. Only Visual C# and Visual Basic project types are supported.
The Project 'PsiTraffic.Modeling.PomModel.Dsl' is in the solution, its also a project reference of the setup solution. The project is C# so the only two pointer's it gave me are useless.
This is the section that it is reffering to in the dslsetup file:
<dslSchemas>
<dslSchema project="PsiTraffic.Modeling.PomModel.Dsl" filePath="GeneratedCode\PomModelSchema.xsd"/>
</dslSchemas>
If I provide a full path to the file the error goes away but this goes against the whole point of the project attribute, and I get errors later from the supportingAssembly attributes.
There aren't very many good examples on this and its Visual Studio doesn't provide you with much in the way of support to diagnose the problem.
Any insights or good examples would be appreciated.
It turns out that the problem was down to using solution folders and not having all the projects on the same directory level. This is a truly hideous "feature" as far as I'm concerned, and its really bad that as far as I can see its not documented.
So if you encounter similar problems make sure you're not using subfolders or solution folders.